Example Mobile Payment Processor

Example Mobile Payment Processor

Hello, are there any payment processors available that can work in the mobile application?

It will take a lot of time to write an application payment processor as there are no examples.

Anyone have this information?

Example of payment processor that supports 3D secure.

Hello

We have added payments to the Polish market (PayU, Przelewy24, Paynow) to the mobile application and they work. It is not easy and requires several steps (changes to the mobile file and in the addon payment processor)

Best regards

Robert

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
);

Hello

You have to implement payment Class which implements IRedirectionPayment.

See how it is done in other payment methods.

Best regards

Robert

This payment system is like that. But after payment, the connection with the application is lost.

https://github.com/cscart/addon-mobile-app-payments

Hello

I also implement according with this scheme and works. Goes back to the application.

Best regards

Robert

After the payment is made;

Webview Screen (LOG)

{"payload": {"data": {"cancel_url": "http://dev.website.com/index.php?dispatch=payment_notification.cancel&order_id=2400306&payment=redirect", "method": "POST", "payment_url": "http://dev.website.com/index.php?dispatch=mobile_app_payments.gateway&order_id=2400306&payment=redirect", "query_parameters": [Object], "return_url": "http://dev.website.com/index.php?dispatch=payment_notification.success&order_id=2400306&payment=redirect"}, "messages": []}, "type": "SETTLEMENTS_SUCCESS"} 

Cancel and return to the app

or

Finish payment

When I click on these, it does not return to the application.

Is there something missing?

How can I take action on the web view screen and return to the application screen.

https://github.com/cscart/addon-mobile-app-payments

https://i.hizliresim.com/48gaxk8.png

Can you help me? I have no idea where the mistake is.

cs-cart's mobile application payment system is really bad, it completes the payment by listening to the successful and incorrect url in an iframe. If there is an error during the payment, it is impossible to reflect it to the user.

kısaca mobil ödemeyi baştan sona sıfırdan yazman gerekiyor :)

Android 8.1 (working properly)

Android 11, 12 (not working)

The reason for not to the application screen is the returning version difference.

The main obstacle can really be overcome if you have a rational and secure authorization process. The only authorization-related advice I can give is to make sure you never have a dangling authorization, such as one for which you don’t have an order record. Therefore, be sure you have a procedure in place to ensure that you haven’t lost track of any authorizations, either due to missing information on your end or because you did after you handed the user’s post off to the payment gateway and lost sight of the auth.

Regarding the additional interactions, remember that authorizations expire, so be careful to take that into consideration when trying to capture or do anything else…