Download the PHP package beziworld/laravel-inpost-pay without Composer

On this page you can find all versions of the php package beziworld/laravel-inpost-pay. 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 laravel-inpost-pay

Laravel InPost Pay

tests Latest Version

InPost Pay merchant integration for Laravel (the one-click checkout in the InPost Mobile app):

Polska wersja dokumentacji

Why this package

Existing InPost Pay integrations are platform plugins: the official Magento 2 modules (inpost/magento2-module-inpost-pay and its Hyvä/GraphQL add-ons) and a Shopware 6 plugin (crehler/inpost-pay). There is no Laravel package and no framework-agnostic PHP client on Packagist. This package brings the complete merchant side of InPost Pay to any Laravel shop: both directions of the API, the RSA and SHA-512 signature schemes (verified against the official examples), and a basket model that matches the documentation field by field.

Installation

Register https://your-shop/inpost-pay as the merchant backend URL and https://your-shop/inpost-pay/events as the transaction webhook URL in the InPost Pay merchant panel. Sandbox credentials are requested through inpostpay.pl/kontakt.

Implement the merchant side

InPost Pay calls your shop to read baskets and create orders. Implement two contracts and bind them:

OrderHandler::create(OrderRequest $order) receives the customer, delivery (deliveryType, deliveryPoint, deliveryAddress, deliveryCodes), invoice data, accepted consents and InPost discounts, and returns the created order in the documented order_details structure. handleEvent(OrderEvent $event) receives payment updates ($event->isPaid() for AUTHORIZED).

Errors thrown as MerchantApiError (basketNotFound(), orderNotFound(), badRequest() or a custom code) are returned as {"error_code": ..., "error_message": ...} with their HTTP status; other exceptions are reported and answered with HTTP 500 INTERNAL_SERVER_ERROR.

Routes

Method Path (under INPOST_PAY_ROUTE_PREFIX) Contract method Event
GET /v1/izi/basket/{basketId} BasketProvider::basket
POST /v1/izi/basket/{basketId}/confirmation BasketProvider::confirmBinding BasketBindingConfirmed / BasketBindingRejected
POST /v1/izi/basket/{basketId}/event BasketProvider::handleEvent BasketChanged
DELETE /v1/izi/basket/{basketId}/binding BasketProvider::unbind BasketUnbound
POST /v1/izi/order OrderHandler::create OrderCreated
GET /v1/izi/order/{orderId} OrderHandler::find
POST /v1/izi/order/{orderId}/event OrderHandler::handleEvent OrderEventReceived, OrderPaid
POST INPOST_PAY_WEBHOOK_PATH TransactionWebhookReceived, PaymentAuthorized, PaymentDeclined, RefundCompleted, RefundDeclined, SettlementReceived

Every Merchant Backend API request is verified: the public key of the x-public-key-ver version is fetched from /v1/izi/signing-keys/public/{version} (cached for a day), its SHA-256 must match x-public-key-hash, the x-signature is checked with SHA256withRSA over base64(base64(sha256(body)),merchant_external_id,version,timestamp) and the timestamp must be within 240 seconds. Failures return HTTP 401 INVALID_SIGNATURE. INPOST_PAY_VERIFY_SIGNATURE=false disables the check for local debugging only.

Call InPost Pay

Other stores or credentials at runtime:

Errors

Exception When
ApiException InPost Pay rejected the request: httpStatus(), errorCode(), body()
AuthenticationException the token endpoint rejected the client credentials
RateLimitExceeded HTTP 429, retryAfter() in seconds
InvalidConfiguration missing client credentials or merchant secret, or contracts not bound
InvalidSignature a request or webhook failed signature verification (handled by the routes)
MerchantApiError thrown by your contracts to answer InPost Pay with an error code

Reads are retried twice on connection errors and HTTP 5xx; writes (basket updates, order updates, refunds) are never retried automatically. A request answered with HTTP 401 is repeated once with a fresh token.

Development

Author

Created and maintained by Kamil Ćwiertnia, beziworld.eu.

Need an integration? Get in touch through beziworld.eu.

Other packages by the author

laravel-inpost · laravel-paynow · laravel-przelewy24 · laravel-payu · laravel-tpay

License

MIT. See LICENSE.md. This package is not affiliated with InPost S.A.


All versions of laravel-inpost-pay with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
ext-openssl Version *
guzzlehttp/guzzle Version ^7.8
illuminate/cache Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/events Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.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 beziworld/laravel-inpost-pay contains the following files

Loading the files please wait ...