Download the PHP package ngandu-dev/flexpay without Composer

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

FlexPay PHP

Latest Stable Version Quality Tests License

A PHP client for FlexPay corporate mobile and card collections, transaction checks, callback parsing, and legacy payouts. Contact FlexPay for merchant credentials and their API documentation.

These examples use the version 4 API. Read the version 4 upgrade guide when upgrading an existing integration.

Requirements and installation

PHP 8.4 or later and Composer 2 are required. Install version 4 with:

Configuration

A client requires credentials and a BaseUrl value with exactly three service prefixes: payment, check, and payout. Choose the production preset explicitly:

BaseUrl::production() selects these versioned prefixes:

Property Prefix Operation path
payment https://corporateapi.flexpay.cd/api/rest/v1 /paymentService for mobile and card
check https://apicheck.flexpaie.com/api/rest/v1 /check/{orderNumber}
payout https://backend.flexpay.cd/api/rest/v1 /merchantPayOutService

For sandbox integrations, use the FlexPay sandbox and pass its deployment URL to BaseUrl::sandbox(). It sets payment, check, and payout to that URL:

Prefixes must be absolute HTTP(S) URLs without credentials, query strings, fragments, backslashes, or interior whitespace. Surrounding whitespace and trailing slashes are removed. Invalid prefixes throw InvalidArgumentException before HTTP. There is no environment flag or default network choice. An optional third constructor argument accepts Symfony's HttpClientInterface for HTTP integration and tests. An injected HTTP client must not add its own retries or redirect behavior. The client sets bearer authentication, disables redirects, and bounds each HTTP attempt to 30 seconds. The bearer token never enters payment JSON.

Mobile collection

isAccepted() reports provider code zero. It does not confirm that the customer paid or guarantee that an order number was supplied. Preserve the returned orderNumber for status checks.

Card collection

Mobile and card requests send the corporate callback_url field. Card return URLs use approve_url, cancel_url, and decline_url. Immutable request objects contain no merchant or token. The transport adds the merchant during HTTP encoding. Amounts must be finite and positive; references and URL fields must be nonblank. Mobile and payout phone numbers must contain exactly 12 digits. Request validation checks URL fields for nonblank content; it does not validate reachability or callback delivery.

Payout

Payout retains the existing endpoint and JSON format, including numeric type: 1 and callbackUrl. All POST operations are sent once. Only GET transaction checks retry transient failures, at most three retries after the first attempt, for transport failures and HTTP 5xx. Backoff is 500, 1000, then 2000 milliseconds. An integer-seconds Retry-After can extend that delay up to two seconds. Longer delays, HTTP dates, and malformed values stop automatic retries. HTTP 4xx and malformed HTTP 2xx responses are not retried. Reconcile an ambiguous POST result before resubmitting it.

Transaction checks and callbacks

Use the provider's order number for checks. The client encodes it as one path segment and rejects blank values and dot-only path segments. CheckResponse::isSuccessful() requires both response code zero and nested transaction status zero. A missing transaction returns false. Malformed nested transactions, including a missing currency, throw NetworkException with type invalid_response.

Callback parsing does not require a client or credentials:

The callback parser validates the supplied data; it does not authenticate the sender or authorize fulfillment. Invalid callback data throws InvalidArgumentException. Reporting fields include reference, orderNumber, providerReference, amount, amountCustomer, phone, currency, createdAt, and channel when present.

Response codes and transaction statuses are always immutable Status values. Read their numeric value; isSuccessful() recognizes zero and isFailure() recognizes one. Other codes satisfy neither predicate and remain observable without assigning them a pending or terminal meaning. Callback success requires code zero.

Development

Contributing and security

See CONTRIBUTING.md for the contribution workflow and SECURITY.md for private vulnerability reporting. Contributions follow the MIT License.


All versions of flexpay with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
symfony/http-client Version ^7.0|^8.0
webmozart/assert Version ^1.11|^2.4
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 ngandu-dev/flexpay contains the following files

Loading the files please wait ...