Trouble closing mini-browser in Chrome on mobile devices

pennywise79
Contributor
Contributor

I am using the PayPal mini-browser to complete chained payments.  I have this up and running in desktop Chrome, Opera, IE11, Firefox, Edge, and Safari mobile using the minibrowser. My problem remains with Chrome in a mobile browser (only tested on iOS). Mainly, after completing payment, I get a returning message but the loader just spins and the minibrowser never closes. When cancelling payment, I get a message saying "Just a moment-this window will close automatically." Then the window never closes. What can I do?

Login to Me Too
3 REPLIES 3

pp_aaron
Contributor
Contributor

Hello Pennywise,

 

Can you provide the iOS Chrome version you are using?

 

Also, if you can send us over the API full call and response with Debug ID/PayKey, etc (while deleting credentials and any important info)

 

Let's try reproducing this problem. 🙂

 

 

Login to Me Too

MTS_Aaron
Moderator
Moderator

Hello pennywise79,

 

Mind sharing the API call with us and the specific Chrome version for iOS you are testing with?

 

We will try replicating.

 

Cheers

Aaron

Login to Me Too

pennywise79
Contributor
Contributor

Things seem to be working in Chrome, but not in Google Apps and Firefox Mobile version 6.0. 

 

Here is my API call:

 

<form action="https://www.sandbox.paypal.com/webapps/adaptivepayment/flow/pay" target="PPDGFrame" id="payment" class="standard">
    @Html.AntiForgeryToken()
    @Html.HiddenFor(model => model.ID)
    <input type="image" id="submitBtn" value="Pay with PayPal" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif">
    <input id="type" type="hidden" name="expType" value="mini">
    <input id="paykey" type="hidden" name="paykey" value=@ViewData["paykey"]>
</form>

    <script src="https://www.paypalobjects.com/js/external/apdg.js">
    </script>

    <script>
        var returnFromPayPal = function () {
            getDetails();
            function getDetails() {
                var formdata = new FormData();
                var other_data = $('#payment').serializeArray();
                $.each(other_data, function (key, input) {
                    formdata.append(input.name, input.value);
                });
                $.ajax({
                    type: 'POST',
                    dataType: 'json',
                    cache: false,
                    url: "/ServiceRequests/getDetails",
                    processData: false,
                    contentType: false,
                    data: formdata,
                    success: function (response, textStatus, jqXHR) {
                        if (response.success == "go") {
                            
                            window.location.href = "@Url.Action("PayPalSuccess", "ServiceRequests")" + "?id=" + response.id;
                        }
                        if (response.success == "stay") {
                            console.log("payment attempt cancelled")
                        }
                        if (response.success == "fail") {
                            window.location.href = "@Url.Action("PaymentFailure", "ServiceRequests")" + "?id=" + response.id;
                        }
                    },
                    error: function (jqXHR, textStatus, errorThrown) {
                        alert('Error - ' + errorThrown);
                    },
                })
            }
       
        }
        var dgFlowMini = new PAYPAL.apps.DGFlowMini({ trigger: 'submitBtn', expType: 'mini', callbackFunction: 'returnFromPayPal' });
    </script>

The payment does go through, but in Firefox mobile I get returned to a blank page and my callback function never gets called.  It looks like it is calling something twice, brining up a blank page.  I am not sure how to get the error details from the page source on Firefox mobile.  Please click on the link below to see a short video of the issue: 

 

https://www.youtube.com/watch?v=-NeKdA0b3JA

 

For the transaction in the video, I did receive a successful IPN, so the problem seems to be with the javascript.

 

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.