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.
... View more