PHP code example of girosolution / girocheckout-sdk
1. Go to this page and download the library: Download girosolution/girocheckout-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/ */
girosolution / girocheckout-sdk example snippets
use girosolution\GiroCheckout_SDK\GiroCheckout_SDK_Request;
$request = new GiroCheckout_SDK_Request('giropayTransaction');
$request->setSecret($projectPassword);
$request->addParam('merchantId',$merchantID)
->addParam('projectId',$projectID)
->addParam('merchantTxId',1234567890)
->addParam('amount',100)
->addParam('currency','EUR')
->addParam('purpose','Beispieltransaktion')
->addParam('bic','TESTDETT421')
->addParam('info1Label','Ihre Kundennummer')
->addParam('info1Text','0815')
->addParam('urlRedirect','https://www.my-domain.de/girocheckout/redirect-giropay')
->addParam('urlNotify','https://www.my-domain.de/girocheckout/notify-giropay')
//the hash field is auto generated by the SDK
->submit();
if($request->requestHasSucceeded()) {
$request->getResponseParam('rc');
$request->getResponseParam('msg');
$request->getResponseParam('reference');
$request->getResponseParam('redirect');
$request->redirectCustomerToPaymentProvider();
}
/* if the transaction did not succeed, update your local system, get the responsecode and notify the customer */
else {
$request->getResponseParam('rc');
$request->getResponseParam('msg');
$request->getResponseMessage($request->getResponseParam('rc'),'DE');
}
use girosolution\GiroCheckout_SDK\GiroCheckout_SDK_Request;
$projectPassword = xxx;
$notify = new GiroCheckout_SDK_Notify('giropayTransaction');
$notify->setSecret($projectPassword);
$notify->parseNotification($_GET);