Download the PHP package wingly/pwinty without Composer

On this page you can find all versions of the php package wingly/pwinty. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pwinty

Pwinty

tests StyleCI

This package makes working with Pwinty image-printing API in Laravel applications a breeze. You can place orders, add images and submit them for shipping. You can also subscribe to Pwinty webhooks after you configure your callback URL at the Pwinty dashboard.

Installation

You can install this package through composer.

Usage

Database migrations

The Pwinty service provider registers it's own database migrations, so make sure that you run your migrations after installing the package. A new orders table will be created to hold all your users orders.

Pwinty environment setup

You need to configure your Pwinty API key and merchant ID in your .env file.

You should also set the API environment to be either "sandbox" or "production"

Working with orders

Add the Orderer trait to your model. The trait provides methods to create and retrieve orders easily.

By default the App\User model is used. You can change this by specifying a different model in your .env file.

Creating orders

To create a new order first retrieve an instance of your orderer model and use the newOrder method to create an order. This method will return you an instance of the OrderBuilder where you can set your order parameters. You should finish the order by calling the create method last. Check the Pwinty documentation for all available parameters.

Adding images to orders

After creating an order you can add images to the order by calling the addImage method on your Order instance. The method requires an identification code of the product for this image and the image's URL. You can add multiple images to the order by chaining the addImage method.

Submitting an order

When you are ready you can submit your order to Pwinty for processing. The validity of the order will first be checked and then submitted. If the order is not ready to be submitted an OrderUpdateFailure exception will be thrown. You can check if an order is submitted by calling the submitted method on your Order instance.

Cancelling an order

You can cancel an open order at any given time by calling the cancel method on your Order instance. If the order status is not cancellable an OrderUpdateFailure exception will be thrown. You can check if an order is cancelled by calling the cancelled method.

Updating an order

You can update any attribute of an open order by calling the updatePwintyOrder on your Order instance. If the order status is not updatable an OrderUpdateFailure exception will be thrown. The method will return you the raw Pwinty order object.

Getting the raw Pwinty order

You can get the raw Pwinty order object by calling the asPwintyOrder method on your Order instance. Check the Pwinty documentation for an example response.

Processing Pwinty Webhooks

Pwinty can make callbacks to a custom URL whenever the status of one of your orders changes. By default, a route that points to a webhook controller is configured through the Pwinty service provider. All incoming Pwinty webhook requests will be handled there. Make sure that you have set up your callback URL under the integrations section of the Pwinty dashboard. The webhook controller listens to the pwinty/webhook URL path.

Signed Webhook URL

To secure your webhooks you must add a signed URL to Pwinty dashboard. For convenience the package contains a console command that will generate a secure URL for you. Copy the signed URL and add it to Pwinty dashboard. A middleware is in place to validate the signed route requests.

CSRF Protection

You gonna need to list the URI as an exception to the VerifyCsrfToken middleware included in your application.

Events

The package emits a Wingly\Pwinty\Events\WebhookProcessed event when a webhook was processed. The event contains the full payload of the Pwinty webhook. You can listen to this event if your application requires to take any actions when a webhook is received.

Changelog

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details.

Credits

License

The MIT License (MIT). Please see the license file for more information.


All versions of pwinty with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
illuminate/database Version ^8.0
illuminate/support Version ^8.0
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wingly/pwinty contains the following files

Loading the files please wait ....