Adaptive Payments without modal box or popups?

后端 未结 1 625
春和景丽
春和景丽 2021-01-02 23:36

Is it possible to launch the payflow entirely inline (a la Express Checkout)? How?

We\'re using chained payments and everything works on non-iOS-mobile devices (and

1条回答
  •  心在旅途
    2021-01-03 00:11

    Here's what I'm doing to use PayPal's mobile web flow. I'm testing on Android and it's working well. The only hang up is the callbackFunction is not firing in mobile browsers and works fine in desktop browsers. (I'm still working on this part. Let me know if you solve it.) Here's an example on how to do it using expType=mini to launch the PayPal mini browser experience.

    First include the Javascript for the Mini flow:

    
    

    Then a link to launch the redirect:

    Complete PayPal Payment
    

    And some Javascript to initiate the Mini Flow process and the callbackFunction:

            var returnFromPayPal = function () {
               alert("Returned from PayPal");
               var div = document.getElementById('resultDiv');
               div.innerHTML = "Returned from PayPal!";
               // Here you would need to pass on the payKey to your server side handle to call the PaymentDetails API to make sure Payment has been successful or not
               // based on the payment status- redirect to your success or cancel/failed urls
           }
           var dgFlowMini = new PAYPAL.apps.DGFlowMini({ trigger: 'payPalRedirect', expType: 'mini', callbackFunction: 'returnFromPayPal' });
    

    More insights and solution options to this issue can be found here:

    Paypal Embedded Flow not using returnUrl or cancelUrl

    0 讨论(0)
提交回复
热议问题