PHP code example of swedbank-pay / swedbank-pay-sdk-php
1. Go to this page and download the library: Download swedbank-pay/swedbank-pay-sdk-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
swedbank-pay / swedbank-pay-sdk-php example snippets
use SwedbankPay\Api\Client\Client;
use SwedbankPay\Api\Service\Paymentorder\V3\Request\Purchase;
use SwedbankPay\Api\Service\Paymentorder\V3\Request\TransactionCapture;
$client = new Client();
$client->setAccessToken('...')->setPayeeId('...');
$client->setApiVersion('3.1');
// Create paymentOrder
$purchase = new Purchase($paymentOrderObject);
$purchase->setClient($client);
$response = $purchase->send();
$paymentOrder = $response->getResponseResource()->getPaymentOrder();
echo $paymentOrder->getStatus(); // "Initialized" / "Paid" / "Aborted" / ...
echo $paymentOrder->getId();