Download the PHP package payshen/payshen-php without Composer

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

Payshen PHP

The PHP client for the Payshen API: create and route payments, capture, void and refund them, read their timeline, and verify the webhooks Payshen sends.

Payshen routes each payment to one of the providers you already have (Stripe, Adyen, Checkout.com, payabl. and more). Payshen never holds or moves money: payments run on your own provider accounts.

Install

Create a payment

The customer pays on the provider's page and comes back to your return_url. The return is not the outcome: the outcome is the webhook (payment.authorized, payment.captured, payment.declined, ...).

Capture, void, refund

A capture or void a provider only accepted answers with the payment PENDING; it becomes CAPTURED or CANCELLED when the provider confirms, and the webhook follows.

Read

Webhooks

The signature proves a delivery came from Payshen and is recent (5 minutes by default); it does not make it new. Webhook::claimEvent($raw, $header, $secret, $store) verifies, parses and takes each event once, with a WebhookEventStore you back with your database:

During a secret rotation pass both secrets: Webhook::parseEvent($raw, $header, [$new, $old]).

Errors

Exception When
AuthenticationException 401 or 403: a missing, wrong or revoked key, or one not allowed this call
ValidationException 422: refused as sent; errorCode names the rule
RateLimitException 429 after the client's retries; retryAfterSeconds when the API said
NetworkException No answer at all. On a POST, retry with the same idempotency key
PayshenException Everything else, and the parent of all of the above

Every exception has status, errorCode (refund_pending, not_capturable, payment_result_unknown, ...) and requestId. Branch on errorCode, not on the message.

Options

$payshen->request('GET', '/api/v1/...') calls any endpoint and returns the whole answer.

Documentation

License

MIT


All versions of payshen-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-curl Version *
ext-json Version *
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 payshen/payshen-php contains the following files

Loading the files please wait ...