1. Go to this page and download the library: Download 202ecommerce/bridge-sdk 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/ */
use BridgeSDK\Client;
use BridgeSDK\Service\ClientApiService;
$clientId = 'your-client-id';
$clientSecret = 'your-secret-idtoken';
$id = 'payment-id';
$client = (new Client())
->setCredential($clientId, $clientSecret);
$response = (new ClientApiService($client))
->getPayment($id);
use BridgeSDK\Client;
use BridgeSDK\Model\Payment\CreatePayment;
use BridgeSDK\Model\Payment\CreatePaymentTransaction;
use BridgeSDK\Model\Payment\PaymentUser;
use BridgeSDK\Request\CreatePaymentRequest;
$clientId = 'your-client-id';
$clientSecret = 'your-secret-idtoken';
$body = (new CreatePayment())
->setBankId(6)
->setSuccessfulCallbackUrl('http://test.tot/?success')
->setUnsuccessfulCallbackUrl('http://test.tot/?error')
->setTransactions([
(new CreatePaymentTransaction())
->setCurrency('EUR')
->setLabel('Label Unit test')
->setAmount(10.50)
->setClientReference('unit_test')
->setEndToEndId('unit_test')
])
->setUser(
(new PaymentUser())
->setFirstName('Unit')
->setLastName('Test')
->setExternalReference('unit_test')
->setIpAddress('192.168.1.1')
);
$request = (new CreatePaymentRequest())
->setModel($body);
$client = new Client();
$model = $response->getModel();
try {
$response = $client->setCredential($clientId, $clientSecret)
->sendRequest($request);
echo '<pre>';
var_dump($response->getModel());
echo '</pre>';
} catch (Exception $e) {
echo ($e->getMessage() . $e->getFile() . ':' . $e->getLine() . $e->getTraceAsString());
}
use BridgeSDK\Client;
use BridgeSDK\Model\Payment\CreatePayment;
use BridgeSDK\Model\Payment\CreatePaymentTransaction;
use BridgeSDK\Model\Payment\PaymentUser;
use BridgeSDK\Service\ClientApiService;
$clientId = 'your-client-id';
$clientSecret = 'your-secret-idtoken';
$body = (new CreatePayment())
->setBankId(6)
->setSuccessfulCallbackUrl('http://test.tot/?success')
->setUnsuccessfulCallbackUrl('http://test.tot/?error')
->setTransactions([
(new CreatePaymentTransaction())
->setCurrency('EUR')
->setLabel('Label Unit test')
->setAmount(10.50)
->setClientReference('unit_test')
->setEndToEndId('unit_test')
])
->setUser(
(new PaymentUser())
->setFirstName('Unit')
->setLastName('Test')
->setExternalReference('unit_test')
->setIpAddress('192.168.1.1')
);
$client = (new Client())
->setCredential($clientId, $clientSecret);
$response = (new ClientApiService($client))
->createPayment($body);
try {
$client = new \BridgeSDK\Client();
$response = $client->retrieveWebhookResponse();
$model = $response->getModel();
} catch (Exception $e) {
// handle exception
}
// Do webhook process
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.