alekserok / omnipay-payson
Payson.se Gateway for the Omnipay payment processing library
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/alekserok/omnipay-payson
Requires
- omnipay/common: ^3
 - php-http/guzzle6-adapter: ^2.0
 
Requires (Dev)
- omnipay/tests: ~3.0
 - phpro/grumphp: ^0.14
 - squizlabs/php_codesniffer: ^3
 
This package is auto-updated.
Last update: 2025-10-06 05:37:50 UTC
README
Payson.se Gateway for the Omnipay PHP payment processing library.
See Payson Rest Api V2 for details
See Payson Api V1 for details
Usage (Api V2):
// create payson transaction:
$gateway = Omnipay::create('Payson_ApiV2');
$gateway->initialize([
    'apiKey' => '2acab30d-fe50-426f-90d7-8c60a7eb31d4',
    'agentId' => '4',
    'testMode' => true,
]);
$response = $gateway->purchase([
     'returnUrl' => 'http://hostname/return',
     'notifyUrl' => 'http://hostname/notify',
     'termsUrl' => 'http://hostname/terms',
     'currency' => 'sek',
     'items' => [
         [
             'name' => 'Item name',
             'unitPrice' => 10.01
             'quantity' => 1,
             'reference' => 'order or transaction Id in your system'
             'type' => 'service'
         ]
     ]
 ])->send();
 
if ($response->isRedirect()) {
    $transactionReference = $response->getTransactionReference(); 
    $responseData = $response->getData();
    $response->redirect();
}
// check transaction status and update payment status in your system
$response = $gateway->completePurchase([
    'transactionReference' => $transaction->reference
])->send();
if ($response->isSuccessful()) {
    $restponseDetails = $response->getData();
}
Usage (Api V1):
$gateway = Omnipay::create('Payson_ApiV1');
$gateway->initialize([
    'apiKey' => '2acab30d-fe50-426f-90d7-8c60a7eb31d4',
    'agentId' => '4',
    'testMode' => true,
    'receiverEmail' => 'testagent-checkout2@payson.se'
]);
$response = $gateway->purchase([
    'returnUrl' => 'http://hostaname/return',
    'notifyUrl' => 'http://hostname/notify',
    'cancelUrl' => 'http://hostname/cancel',
    'currency' => 'sek',
    'memo' => 'transaction or order id or something else',
    'amount' => 10.01
])->send();