PHP code example of worldline / sips-payment-sdk

1. Go to this page and download the library: Download worldline/sips-payment-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/ */

    

worldline / sips-payment-sdk example snippets




//these parameters should not be hardcoded.
$sipsClient = new SipsClient(
    new SipsEnvironment("SIMU"), 
    "002001000000001", 
    "002001000000001_KEY1",
    1
    );

$paypageRequest = new PaypageRequest();
$paypageRequest->setAmount(200);
$paypageRequest->setCurrencyCode("EUR");
$paypageRequest->setNormalReturnUrl('http://lib.wl.be//return.php');
$paypageRequest->setOrderChannel("INTERNET");

$paypageRequest->setTransactionReference("myUniqueIdentifier");

$initializationResponse = $sipsClient->initialize($paypageRequest);

$sipsClient = new SipsClient( new SipsEnvironment("SIMU"), "002001000000001", "002001000000001_KEY1", 1 );
$paypageResponse = $sipsClient->finalizeTransaction();

html
<form action="<?= $sipsResponse->getRedirectionUrl()