){if($setting['response'][0]['favicon'] == )
" alt="Merchant Logo" class="merchant-logo">
$settings['username'],
"password" => $settings['password']
];
$ch = curl_init($base_url."/api/get_token");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL
$response = curl_exec($ch);
curl_close($ch);
$response = json_decode($response, true);
$data = [
"order_id" => $order_id
];
$ch = curl_init($base_url."/api/verification");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $response['token'],
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
if (isset($data[0]['bank_status']) && $data[0]['bank_status'] == "Success") {
$check_transactionid = pp_check_transaction_exits($data[0]['bank_trx_id']);
if($check_transactionid['status'] == false){
if(pp_set_transaction_byid($payment_id, $plugin_slug, $plugin_info['plugin_name'], $data[0]['method'], $data[0]['bank_trx_id'], 'completed')){
echo '';
}
}else{
?>
Transaction ID already exits
Transaction not valid or not found.
Transaction
$settings['username'],
"password" => $settings['password']
];
$ch = curl_init($base_url."/api/get_token");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL
$response = curl_exec($ch);
curl_close($ch);
$response = json_decode($response, true);
$separator = (strpos(getCurrentUrl(), '?') !== false) ? '&' : '?';
$tran_id = rand();
if (filter_var($transaction_details['response'][0]['c_email_mobile'], FILTER_VALIDATE_EMAIL)) {
$cust_phone = $setting['response'][0]['support_phone_number'];
$cust_email = $transaction_details['response'][0]['c_email_mobile'];
}else{
$cust_phone = $transaction_details['response'][0]['c_email_mobile'];
$cust_email = $setting['response'][0]['support_email_address'];
}
$data = [
'prefix' => $settings['prefix'],
'token' => $response['token'],
'return_url' => getCurrentUrl() . $separator . "status=success",
'cancel_url' => getCurrentUrl() . $separator . "status=cancel",
'store_id' => $response['store_id'],
'amount' => $transaction_amount,
'order_id' => $payment_id,
'currency' => 'BDT',
'customer_name' => $transaction_details['response'][0]['c_name'],
'customer_address' => 'dhaka',
'customer_phone' => $cust_phone,
'customer_city' => 'Dhaka',
// Additional fields
'client_ip' => '102.101.1.1',
'discount_amount' => '0',
'disc_percent' => '0',
'customer_email' => $cust_email,
'customer_state' => 'dhaka',
'customer_postcode' => '2113',
'customer_country' => 'BD',
'shipping_address' => '',
'shipping_city' => '',
'shipping_country' => '',
'received_person_name' => '',
'shipping_phone_number' => $cust_phone
];
$ch = curl_init($base_url."/api/secret-pay");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $response['token']
]);
$response_curl_before = curl_exec($ch);
curl_close($ch);
$response_curl = json_decode($response_curl_before, true);
if(isset($response_curl['checkout_url'])){
echo '';
}else{
?>