Download the PHP package wajub/wajub-php without Composer

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

Total Downloads Latest Stable Version License

Introduction

Official server-side SDK for the Wajub API: create payments, confirm them, pay out and verify webhooks from any PHP application, Laravel included.

It runs on your server with a secret (sk.…, sk_test.…) or restricted (rk.…, rk_test.…) API key. Never expose these keys in client-side code: in the browser, use Wajub.js with your publishable key (pk.…, pk_test.…).

Requirements

Requirement Version
PHP 8.4 or later
Extension ext-json

Installation

Quick start

Amounts are in the currency's main unit: 12.50 for GHS 12.50, 15000 for XAF 15,000.

Then confirm the result on your server: handle the payment.succeeded webhook, or call $wajub->payments->retrieve($payment->id).

Parameters take the API's field names. What comes back is an object: read a field as a property ($payment->status) or as an array key ($payment['status']).

Configuration

Key Description
api_key Secret or restricted API key (sk.…, sk_test.…, rk.…, rk_test.…). Required.
webhook_secret Webhook signing secret (whsec_…), needed only for webhooks->constructEvent(). Falls back to WAJUB_WEBHOOK_SECRET.
timeout Request timeout in seconds.

The SDK does not read the API key from the environment: read WAJUB_API_KEY yourself and pass it as api_key, as above.

Laravel

Add the keys to config/services.php, then bind the client once:

Resources

Purpose Property Methods
Payments $wajub->payments create, retrieve, list, cancel, process, processSplit, listRefunds
Refunds $wajub->refunds create, retrieve, list
Customers $wajub->customers create, retrieve, update, delete, list, block, unblock, activate, deactivate, listTaxIds, createTaxId, deleteTaxId
Payment links $wajub->links create, retrieve, update, delete, list
Invoices $wajub->invoices create, retrieve, update, delete, list, send, markPaid, cancel
Payouts $wajub->transfers create, retrieve, list
Payout recipients $wajub->beneficiaries create, retrieve, update, delete, list
Destination checks $wajub->identity resolve, validate
Balance $wajub->balance retrieve
Disputes $wajub->disputes list, retrieve, submitEvidence, accept, close, sendMessage
Events $wajub->events list, retrieve, resend
Webhook endpoints $wajub->webhookEndpoints create, retrieve, update, delete, list, rotateSecret
Webhook verification $wajub->webhooks constructEvent
Connected accounts (Sync) $wajub->accounts create, retrieve, update, delete, list, regenerateToken
Tax $wajub->tax getSettings, updateSettings, rates, calculate, reports, listCodes, retrieveCode, listRegistrations, createRegistration, retrieveRegistration, updateRegistration, deleteRegistration, jurisdictions, thresholds, thresholdAlerts
Fraud (Shield) $wajub->shield getSettings, updateSettings, stats, listBlocklist, addToBlocklist, removeFromBlocklist
Reference data $wajub->global ping, channels, countries, currencies

Acting for a connected account

Pass the connected account with sync on the call:

Webhooks

Pass the raw request body, not parsed JSON, with the X-Wajub-Signature and X-Wajub-Timestamp headers. In a Laravel controller:

The event is an array; its type is in event. A delivery that does not verify throws WebhookSignatureVerificationError. If your server's clock drifts, pass a tolerance in seconds as a fourth argument. In Laravel, exempt the webhook route from CSRF verification.

Pagination

list() returns a page you can walk one page at a time, or iterate across all pages; rows are arrays:

Idempotency

Temporary failures are retried for you. To make a create safe to repeat on your side too, after a restart or in a queued job's retry, pass your own key:

Error handling

API errors throw a subclass of Wajub\Exception\WajubError:

Class in Wajub\Exception Raised on
AuthenticationException 401
PermissionException 403
NotFoundException 404
InvalidRequestException 400, 422
RateLimitException 429, with retryAfter in seconds
WajubError Any other error status, and the parent of the classes above
ApiConnectionException No response: network error or timeout

Every error carries getMessage(), errorCode, httpStatus, errors (the first message of each field) and raw (the response body). getCode() is always 0: read errorCode.

Testing

Use a sandbox key (sk_test.…): the key chooses the environment, and no real money moves. The test phone numbers and cards are on Test scenarios. To receive webhooks on your machine, forward them with the Wajub CLI.

Documentation & support

License

The Wajub PHP SDK is open-sourced software licensed under the MIT license.


All versions of wajub-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-json Version *
guzzlehttp/guzzle Version ^8.2
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 wajub/wajub-php contains the following files

Loading the files please wait ...