Download the PHP package payscribe/php-sdk without Composer

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

Payscribe PHP SDK

Virtual accounts, virtual cards, bill payments, and webhook verification.

Features

Requirements

Installation

Quickstart

Environment

Method Environment
Payscribe::sandbox($key) Sandbox (test)
Payscribe::production($key) Live

Configuration

Resources

$payscribe->customers

Method Returns
create(string $firstName, string $lastName, string $email, string $phone, string $country = 'NG'): array array with customer_id

Create a customer before issuing accounts or cards:

$payscribe->virtualAccounts

Method Returns
createStatic(string $customerId, array $banks, string $currency = 'NGN', ?string $identityType = null, ?string $identityNumber = null): VirtualAccount VirtualAccount{accountNumber, bank, currency, customerId, ...}
createDynamic(string $reference, float $amount, string $amountType, int $expiresDuration, string $expiresType, string $customerName, string $customerEmail, string $customerPhone, string $currency = 'NGN', ?string $description = null): VirtualAccount Same shape
get(string $accountNumber): VirtualAccount Single account
activate(string $accountNumber): ActionResponse Activate an account
deactivate(string $accountNumber): ActionResponse Deactivate an account
confirmPayment(string $sessionId, float $amount, string $accountNumber, ?string $transId = null): ActionResponse Confirm a pending payment
simulateTransfer(string $reference, float $amount, string $account, string $name, string $bank, string $senderAccountNumber, string $senderName, string $hash, ?string $description = null, string $currency = 'NGN'): ActionResponse Sandbox only; simulates an incoming transfer

$payscribe->virtualCards

Method Returns
create(string $customerId, string $currency, string $brand, float $amount, string $reference, string $type = 'virtual', ?bool $contactless, ?float $dailyLimit, ?float $transactionLimit): Card Card{id, brand, currency, lastFour, getMaskedNumber(), ...}
createWithStablecoin(...same..., string $stablecoinCurrency = 'USDT', string $stablecoinNetwork = 'Tron', string $stablecoinChain = 'TRC20'): Card Card (funded via stablecoin deposit)
topUp(string $cardId, float $amount, ?string $reference = null): ActionResponse Add funds
topUpWithStablecoin(string $cardId, float $amount, string $stablecoinCurrency = 'USDT', string $stablecoinNetwork = 'Tron', string $stablecoinChain = 'TRC20', ?string $reference = null): ActionResponse Add funds via crypto
withdraw(string $cardId, float $amount, string $reference): ActionResponse Withdraw funds
get(string $cardId): Card Single card details
replace(string $cardId): Card Replace lost/stolen card
regularize(string $cardId): Card Alias for replace
transactions(string $cardId, string $startDate, string $endDate, ?int $page, ?int $pageSize): array ['data' => Transaction[], 'total' => int, 'page' => int]
freeze(string $cardId, string $reference): ActionResponse Freeze card
unfreeze(string $cardId, string $reference): ActionResponse Unfreeze card
terminate(string $cardId, string $reference): ActionResponse Close card permanently
updateContact(string $cardId, ?string $email, ?string $mobile, ?string $address1, ?string $address2, ?string $city, ?string $state, ?string $zipcode, ?string $country): ActionResponse Update billing contact

Valid currencies: USD, NGN, GBP, EUR Valid brands: visa, mastercard

$payscribe->bills

Bills are exposed under $payscribe->bills, grouped by product category. Every method returns the unwrapped API payload as an array.

Resource Method Endpoint
requery requery(string $transactionId) GET requery
cable fetchBouquets(string $service) GET bouquets
cable validateSmartCard(string $service, string $account, string $planId, ?int $month = null) POST multichoice/validate
cable pay(string $planId, string $customerName, string $account, string $service, string $reference, ?string $phone, ?string $email, ?int $month) POST multichoice/vend
cable topUp(float\|string $amount, string $customerName, string $account, string $service, string $reference, ?string $phone, ?string $email, ?int $month) POST multichoice/topup
internet listServices() GET internet/list
internet spectranetPinPlans() GET internet/spectranet/pins/plans
internet purchaseSpectranetPins(string $planId, int $quantity, string $reference) POST internet/spectranet/pins/vend
data lookup(?string $network, ?string $category) GET data/lookup
data vend(string $plan, string\|array $recipient, string $network, ?string $reference) POST data/vend
epins list() GET epins
epins purchase(string $id, int $quantity, string $reference) POST epins/vend
epins lookupJambUser(int\|string $id, string $account) POST epins/jamb/user/lookup
epins retrieve(string $transactionId) GET epins/retrieve
airtimeToWallet lookup() POST airtime_to_wallet
airtimeToWallet process(string $network, float\|string $amount, string $phoneNumber, string $from, ?string $reference) POST airtime_to_wallet/vend
electricity validate(string $meterNumber, string $meterType, float\|string $amount, string $service) POST electricity/validate
electricity pay(string $meterNumber, string $meterType, float\|string $amount, string $service, string $customerName, ?string $address, ?string $phone, ?string $email, ?string $reference) POST electricity/vend
sms send(string $to, string $message, ?string $reference, ?string $senderId) POST sms
betting listProviders() GET betting/list
betting lookup(string $betId, string $customerId) GET betting/lookup
betting fundWallet(string $betId, string $customerId, string $customerName, float\|string $amount, string $reference) POST betting/vend
airtime vend(string $network, float\|string $amount, string\|array $recipient, ?bool $ported, ?string $reference) POST airtime
airtime bulkVend(array $rows, ?string $reference) POST airtime
international countries() GET international-bills/countries
international providers(string $iso) GET international-bills/providers
international products(string $iso, string $code) GET international-bills/products
international rate(string $iso, string $sku, float\|string $amount) GET international-bills/rate
international vend(string $iso, string $providerCode, string $sku, float\|string $amount, string $account, string $reference, ?string $debitCurrency) POST international-bills/vend

$payscribe->webhooks

Verify webhook payloads using HMAC-SHA256. Use the raw request body (not re-encoded JSON).

Method Returns
verifySignature(string $rawBody, string $signature, ?int $timestamp = null, int $tolerance = 300): bool true if signature matches
constructEvent(string $rawBody, ?string $signature, ?int $timestamp = null, int $tolerance = 300): array Parsed event array, throws on invalid signature

Pass a Unix $timestamp to activate replay protection — the SDK signs {timestamp}.{payload} and rejects payloads older than $tolerance seconds (default 5 min). Legacy mode works without a timestamp.

php use Payscribe\Exception{ PayscribeException, AuthException, ValidationException, RateLimitException, ServerException, };

try { $card = $payscribe->virtualCards->get('crd_unknown'); } catch (AuthException $e) { echo 'Check your secret key'; } catch (ValidationException $e) { echo 'Validation failed: ' . $e->getMessage(); } catch (RateLimitException $e) { $retryAfter = $e->getContext()['retry_after'] ?? 1; sleep($retryAfter); // retry } catch (ServerException $e) { echo 'Server error, will be retried automatically: ' . $e->getMessage(); } catch (PayscribeException $e) { echo "API error ({$e->getCode()}): {$e->getMessage()}"; } bash php security_verify.php bash

All unit tests (mocked HTTP, no API key required)

vendor/bin/phpunit

Integration tests (requires sandbox key in .env)

PAYSCRIBE_SECRET_KEY=sk_test_xxx vendor/bin/phpunit --testsuite=Integration

Security redaction verification

php security_verify.php

With coverage

php -d xdebug.mode=coverage vendor/bin/phpunit --coverage-text



## Legacy Bill Payments

Deprecated — use the native `$payscribe->bills` resource above instead. For reference, `main.php` contains the legacy bill-payment methods.

## License

MIT

All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
vlucas/phpdotenv Version ^5.6
guzzlehttp/guzzle Version ^7.0
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.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 payscribe/php-sdk contains the following files

Loading the files please wait ...