PHP code example of payomatix / web-sdk
1. Go to this page and download the library: Download payomatix/web-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/ */
payomatix / web-sdk example snippets
ayomatix\Payomatix;
$payomatix = new Payomatix();
// customize curl timeouts
$payomatix->setOptions([
'timeout' => 60
]);
$response = $payomatix->nonSeamlessPayment([
'other_data' => [
'first_name' => 'your-name',
'last_name' => 'your-name',
'address' => 'address',
'state' => 'state',
'city' => 'city',
'zip' => '123456',
'country' => 'IN',
'phone_no' => '1234567890',
'card_no' => '4242424242424242',
],
'email' => '[email protected] ',
'amount' => '30.00',
'currency' => 'USD',
'merchant_ref' => 'ce35d90-fc2e-4a43-a900-1872d9c00890',
'return_url' => 'https://mysite.com/redirect/dce35d90-fc2e-4a43-a900-1872d9c00890',
'notify_url' => 'https://mysite.com/notify/ce35d90-fc2e-4a43-a900-1872d9c00890'
]);
if (isset($response['redirect_url']) && !empty($response['redirect_url'])) {
header('Location: ' . $response['redirect_url']);
} else {
print_r($response);
}
ayomatix\Payomatix;
$payomatix = new Payomatix();
$response = $payomatix->seamlessPayment([
'first_name' => 'your-name',
'last_name' => 'your-name',
'address' => 'address',
'country' => 'IN',
'state' => 'state',
'city' => 'city',
'zip' => '123456',
'phone_no' => '1234567890',
'email' => '[email protected] ',
'amount' => '30.00',
'currency' => 'INR',
'return_url' => 'https://mysite.com/redirect/dce35d90-fc2e-4a43-a900-1872d9c00890',
'notify_url' => 'https://mysite.com/notify/ce35d90-fc2e-4a43-a900-1872d9c00890',
'merchant_ref' => 'ce35d90-fc2e-4a43-a900-1872d9c00890',
'type_id' => '1',
'card_no' => '4242424242424242',
'ccexpiry_month' => '01',
'ccexpiry_year' => '2029',
'cvv_number' => '123'
]);
if (isset($response['redirect_url']) && !empty($response['redirect_url'])) {
header('Location: ' . $response['redirect_url']);
} else {
print_r($response);
}
ayomatix\Payomatix;
$payomatix = new Payomatix();
$response = $payomatix->status([
'merchant_ref' => 'ce35d90-fc2e-4a43-a900-1872d9c00890'
]);
if (isset($response['redirect_url']) && !empty($response['redirect_url'])) {
header('Location: ' . $response['redirect_url']);
} else {
print_r($response);
}
ayomatix\Payomatix;
$payomatix = new Payomatix();
$payomatix->setOptions([
'timeout' => 60,
'connect_timeout' => 60,
'ssl_verifyhost' => false
]);