The PHP SDK is available at OrcusHQ/orcuspay-php.

Requirements

  • PHP 8.1 or newer
  • curl extension
  • json extension
  • Orcuspay access and secret keys

Install

composer require orcushq/orcuspay-php
If the package is not published to Packagist yet, install from GitHub:
composer config repositories.orcuspay-php vcs https://github.com/OrcusHQ/orcuspay-php
composer require orcushq/orcuspay-php:dev-main

Create a checkout session

<?php

require __DIR__ . '/vendor/autoload.php';

use OrcusPay\OrcusPayClient;

$orcuspay = new OrcusPayClient(
    accessKey: 'ak_test_xxxxx',
    secretKey: 'sk_test_xxxxx'
);

$session = $orcuspay->createCheckoutSession([
    'amount' => 10000,
    'currency' => 'BDT',
    'success_url' => 'https://example.com/payment/success',
    'cancel_url' => 'https://example.com/payment/cancel',
    'customer' => [
        'name' => 'Test Customer',
        'email' => 'customer@example.com',
        'phone' => '01700000000',
    ],
]);

Available methods

  • createCheckoutSession(array $payload)
  • retrieveCheckoutSession(string $sessionId)
  • listPayments(array $query = [])
  • getPayment(string $id)
  • listPaymentLinks(array $query = [])
  • createPaymentLink(array $payload)
  • getPaymentLink(string $id)

API URL

The SDK defaults to https://brain.orcuspay.com/api. Only change this if Orcuspay support gives you a different API host.