PHP code example of aba_payway_gateway / php_payway_partner

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

    

aba_payway_gateway / php_payway_partner example snippets


$partner = new PaywayPartner(
        partnerName: $_ENV['ABA_PARTNER_NAME'] ?? '',
        partnerID: $_ENV['ABA_PARTNER_ID'] ?? '',
        partnerKey: $_ENV['ABA_PARTNER_KEY'] ?? '',
        partnerPrivateKey: utf8_decode(base64_decode($_ENV['ABA_PARTNER_PRIVATE_KEY'] ?? "")),
        partnerPublicKey: utf8_decode(base64_decode($_ENV['ABA_PARTNER_PUBLIC_KEY'] ?? "")),
        baseApiUrl: $_ENV['ABA_PARTNER_API_URL'] ?? '',
    );
    $service = new PaywayPartnerService($partner);

$merchant = new PaywayPartnerRegisterMerchant(
        pushback_url: 'https://www.mylekha.org/',
        redirect_url: 'https://www.mylekha.org/',
        type: 0,
        register_ref: "Merchant003",
    );
    $response = $service->registerMerchant($merchant);


$merchant = new PaywayPartnerCheckMerchant(
        register_ref: "Merchant003",
    );
    $service = new PaywayPartnerService($partner);

    $response = $service->checkMerchant(merchant: $merchant);

$service = (new PaywayPartnerClientService($partner));
$str = $service->getStr($requestTime, $requestData);
$hash = $service->getHash($str);

$service = PaywayPartnerClientFormRequestService($partner);
$encrypted = $service.opensslEncrypt(json_encode($data), $partner.partnerPublicKey);
$decrypted = $service.opensslEncrypt(json_encode($data), $partner.partnerPrivateKey);