PHP code example of restoore / systempay-webservice
1. Go to this page and download the library: Download restoore/systempay-webservice 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/ */
restoore / systempay-webservice example snippets
'providers' => [
...
Restoore\SystempayWebservice\SystempayWebserviceServiceProvider::class,
]
'providers' => [
...
Restoore\SystempayWebservice\SystempayWebserviceServiceProvider,
]
'SystempayWebservice' => Restoore\SystempayWebservice\Facades\SystempayWebservice::class
return [
'shopid' => 'YOUR_SHOPID'
'certificate' => 'YOUR_KEY',
'mode' => 'PRODUCTION',
//Systempay's url
'url_wsdl' => 'https://paiement.systempay.fr/vads-ws/v5?wsdl',
'ns' => 'http://v5.ws.vads.lyra.com/Header/'
];
$commonRequest = [
'paymentSource' => 'CC',
'submissionDate' => $submissionDate
];
$threeDSRequest = [
'mode' => "DISABLED"
];
$paymentRequest = [
'amount' => "2990",
'currency' => "978",
'manualValidation' => '0'
];
$orderRequest = [
'orderId' => "TEST004",
'extInfo' => [
'key' => 'Numéro adhérent',
'value' => '00000001'
]
];
$cardRequest = [
'number' => "4970100000000000",
'scheme' => "VISA",
'expiryMonth' => "12",
'expiryYear' => "2023",
'cardSecurityCode' => "123",
//'cardHolderBirthDay' => "2008-12-31" =>
$uuid = SystempayWebservice::getPaymentUuid($transactionId, $submissionDate);
if(SystempayWebservice::findPayments('PHPUnitTest') === true){
foreach(SystempayWebservice::getResult()->transactionItem as $transaction){
//do something smart
}
}
...
if(SystempayWebservice::getPaymentDetails('589f5c2b0b954e3aa802aaa8a22fb17d') === true){
echo "the transaction amout is " . SystempayWebservice::getResult()->paymentResponse->amount;
}
...
$result = SystempayWebservice::updatePayment($uuid, '2590',date('Y-m-d\TH:i:s\Z', time() + 3600 * 24) ,978,0,'Here is my comment !');
if($result === true){
echo "the new transaction amout is " . SystempayWebservice::getResult()->paymentResponse->amount;
}
...
if(SystempayWebservice::validatePayment('589f5c2b0b954e3aa802aaa8a22fb17d') === true){
echo "the transaction is validated";
}
...
SystempayWebservice::refundPayment('0de9251b645e42bda30f1397a9ad6e32', 1500, null, 978, 0, 'Here my refund comment !');
...
SystempayWebservice::cancelPayment($uuid, 'Here my cancel comment !');
...
php artisan vendor:publish --provider="Restoore\SystempayWebservice\SystempayWebserviceServiceProvider" --tag="config"
php artisan vendor:publish --provider="Restoore\SystempayWebservice\SystempayWebserviceServiceProvider" --tag="tests"