A small example package
Project description
AYA Online Merchant
Installation
composer require aya/aya-php
Initialization
use Aya\OnlineMerchant\AyaOnlineMerchant;
$AyaClient = new AyaOnlineMerchant( $key, $secret, $phone, $password, $decryptKey, $production );
Config Values
These are the options needed to setup the AyaOnlineMerchant Client to use in your application.
{
key: "Foo", //required, provided by Aya Pay
secret: "Bar", //required, provided by Aya Pay
phone: "09123456789", //required, provided by Aya Pay, phone number without country code
password: "123456", //required, provided by Aya Pay, 6-digit number string
decryptKey: "Foobar", //required, provided by Aya Pay
production: true //optional, defaults to false, declares the environment
}
Methods
Create Payment Request (createTransaction)
This method is used to push a payment request to your customer so they can make a payment to complete a purchase via Aya Pay.
v1
createTransaction(string $customerPhone, string $amount, string $externalTransactionId, string $externalAdditionalData);
$result = $AyaClient->createTransaction(
"09123456789", //required, customer's phone number
"1000", //required, payment amount
"externalTransactionId", //required, your unique order number
"externalAdditionalData", //required, remark
);
v2
v2 is used when you have dedicated business agreements set up with Aya Pay for special flows.
createTransaction(string $customerPhone, string $amount, string $externalTransactionId, string $externalAdditionalData, bool $v2, string $serviceCode, int $timelimit);
$result = $AyaClient->createTransaction(
"09123456789", //required, customer's phone number
"1000", //required, payment amount
"externalTransactionId", //required, your unique order number
"externalAdditionalData", //required, remark
true, //enable v2 usage
"servicecode", //required, provided by Aya Pay
15 //optional, minutes
);
Create QR (createQR)
v1
This method is used to request a string to generate a QR which your customer can scan and make payment to you via Aya Pay.
createQR(string $amount, string $externalTransactionId, string $externalAdditionalData);
$result = $AyaClient->createQR(
"1000", //required, payment amount
"externalTransactionId", //required, your unique order number
"externalAdditionalData", //required, remark
);
v2
v2 is used when you have dedicated business agreements set up with Aya Pay for special flows.
createQR(string $amount, string $externalTransactionId, string $externalAdditionalData, bool $v2, string $serviceCode, int $timelimit);
$result = $AyaClient->createQR(
"1000", //required, payment amount
"externalTransactionId", //required, your unique order number
"externalAdditionalData", //required, remark
true, //enable v2 usage
"servicecode", //required, provided by Aya Pay
15, //optional, minutes
);
Refund Payment (refundPayment)
This method is used to refund a payment made by customer to their Aya Pay wallet.
refundPayment(string $externalTransactionId, string $referenceNumber);
$result = $AyaClient->refundPayment(
"externalTransactionId", //required, your unique order number
"referenceNumber", //required, reference number from Aya when creating transaction (or) Qr
);
Decrypt Payment (decryptPayment)
This method is used to decrypt the data we send to your application server after a successful payment made by the customer to you.
$data = $AyaClient->decryptPayment("encryptedPaymentData");
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for kst_pip_test-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b1ea7498be90eafa70eb667316ab26ded9f064d7a023e8575df6d0873849fb7 |
|
MD5 | 93d2570f770547a1fcc361d5852a4205 |
|
BLAKE2b-256 | 913e94de2bb6d724c15cac622e432cbb37bd74c18722ea97ddaa87881e6a7fea |