1. Go to this page and download the library: Download vincsis/omnipay-ticketasa 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/ */
vincsis / omnipay-ticketasa example snippets
{
"TransactionType": 1,
"Approved": true, // must be true
"AuthorizationCode": "123456", // Authorization number from bank
"TransactionIdentifier": "3dbff695-d7e0-4e90-8187-1e93cf13bb40", // Order Number
"TotalAmount": 1, //Mount
"CurrencyCode": "320",
"RRN": "227603509881",
"CardBrand": "Visa",
"IsoResponseCode": "00",
"ResponseMessage": "Transaction is approved", // Message Approvement.
"OrderIdentifier": "TICKET-ASA-3dbff695-d7e0-4e90-8187-1e93cf13bb40" // Order Identifier PREFIX + Order Number
}
php
use Omnipay\Omnipay;
try {
$gateway = Omnipay::create('Ticketasa');
$gateway
->setTestMode(true) // false to use productions links , true to use test links
->setPWTId('xxxxxxxx')
->setPWTPwd('xxxxxxxx')
// **Required and must be https://
->setNotifyUrl('https://localhost/webhook.php')
// **Required and must be https://
->setReturnUrl('https://localhost/webhook.php')
->setDiscount(false);
$cardData = [
'firstName' => 'Gabriel', //optional
'LastName' => 'Arzu', // optional
];
$transactionData = [
'card' => $cardData,
'amount' => '1.00', // Mandatory
'TransactionId' => '2100001', // mandatory, must be unique in each transaction
];
$response = $gateway->purchase($transactionData)->send();
if($response->isSuccessful())
$response->getHostedPageURL(); // return the link with encrypted params
$response->redirectToHostedPage(); //Redirect automatically to payment form
} catch (Exception $e){
$e->getMessage();
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.