https://i.hizliresim.com/en51ig0.png
https://i.hizliresim.com/ny83zcp.png
Mobile payment also disconnects after 3d Secure screen.
If the payment is successful or incorrect after the 3D Secure screen, how can it return to the application?
/public_html/app/addons/payment_gate/Tygh/Addons/PaymentGateApp/PaymentGateMobile.php
/** @inheritdoc */
public function getDetails(array $request)
{
$this->preparation_result->setSuccess(true);
$payment_url = $this->getPaymentUrl();
$this->details_builder->setPaymentUrl($payment_url);
$this->details_builder->setMethod(self::PAYMENT_GATEWAY_REQUEST_METHOD);
$query_parameters = $this->getPaymentRequest();
$this->details_builder->setQueryParameters($query_parameters);
$cancel_url = $this->getCancelUrl();
$this->details_builder->setCancelUrl($cancel_url);
$return_url = $this->getReturnUrl();
$this->details_builder->setReturnUrl($return_url);
$this->preparation_result->setData($this->details_builder->asArray());
return $this->preparation_result;
}
public function getPaymentRequest()
{
return [
'page' => 'mobile',
'order_id' => $this->order_info['order_id'],
'amount' => $this->order_info['total'],
'c_card' => $this->order_info['payment_info']['c_card'],
'card_number' => $this->order_info['payment_info']['card_number'],
'expiry_year' => $this->order_info['payment_info']['expiry_year'],
'expiry_month' => $this->order_info['payment_info']['expiry_month'],
'cvv2' => $this->order_info['payment_info']['cvv2'],
'cardholder_name' => $this->order_info['payment_info']['cardholder_name'],
'cancel_url' => $this->getCancelUrl(),
'return_url' => $this->getReturnUrl(),
];
}
/public_html/app/addons/payment_gate/payments/payment_gate.php
Tygh\Addons\PaymentGateApp\PaymentGateMobile;
defined(‘BOOTSTRAP’) or die(‘Access denied’);
if (defined(‘PAYMENT_NOTIFICATION’)) {
if ($mode === 'cancel') {
$pp_response = [
'order_status' => STATUS_INCOMPLETED_ORDER,
];
} elseif ($mode === 'success') {
$pp_response = [
'order_status' => 'P',
'transaction_id' => $_REQUEST['transaction_id'],
];
} else {
die('Access denied');
}
fn_finish_payment($_REQUEST['order_id'], $pp_response);
fn_order_placement_routines('route', $_REQUEST['order_id']);
}
/**
- Perform a payment.
*/
$processor = new PaymentGateMobile();
$processor->setOrderInfo($order_info);
$processor->setAuthInfo(Tygh::$app[‘session’][‘auth’]);
$processor->setPaymentInfo($processor_data);
fn_create_payment_form(
$processor->getPaymentUrl(),
$processor->getPaymentRequest(),
‘Mobile App Demo Payment: PaymentGateMobile’,
false,
$processor::PAYMENT_GATEWAY_REQUEST_METHOD
);