PHP code example of shibanashiqc / phone-pay-php

1. Go to this page and download the library: Download shibanashiqc/phone-pay-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/ */

    

shibanashiqc / phone-pay-php example snippets


use Shibanashiqc\PhonePayPhp\PhonePay;

$phone_pay = new PhonePay('MERCHAN', 'saltKey-0000', 1);
// $phone_pay->client->setAsDefaultBaseUrl(); // if you got production keys the enable this
$phone_pay->client->setCallbackUrl('https://site/phonepay/callback');
$phone_pay->client->setRedirectUrl('https://site/phonepay/callback');

$request = $phone_pay->getPaymentRequest(1, '1234567890', '1234567890', '9999999999');
$redirect_url = $phone_pay->getPaymentRedirectUrl($request);
echo $redirect_url; 


composer