On button click I am calling a function which makes a $.ajax call to get the relevant data from third party url.
It is working fine in every device and browser except ios.
Here is my button:
Here is my js function:
function validateCardDetails() {
var todaysPaymentOption, paymentOption, nameOnCard, ccExpYear, ccExpMonth, cardNumber, cardCVVCd, cardType, accHolderName, accType, accNumber, routingNumber, paymentAmount, repetitiveDrawDate, repPaymentOption, billingFrequency, futurePaymentAmount, rep_nameOnCard, rep_ccExpYear, rep_ccExpMonth, rep_cardNumber, rep_cardType, rep_accHolderName, rep_accNumber, rep_routingNumber, rep_accType, enableAutopay, policyNumber;
var applicationId = $("#ppApplicationId").val();
todaysPaymentOption = $("#paymentMethod input[type=radio]:checked").val();
paymentOption = $("#selectedPaymentOption").val();
nameOnCard = $("#tdyFname").val();
ccExpYear = $("#ttdyexpyYear").val();
ccExpMonth = $("#ttdyexpyMonth").val();
cardNumber = $("#tdyCardnum").val();
cardCVVCd = $("#tdyCardvv").val();
var cardTypeTemp = $("#cardType input[type=radio]:checked").val();
cardType = $("#cardType").val();
accHolderName = $("#tdyAccountHolderName").val();
accType = $("#accountType option[selected]").val() ? $("#accountType option[selected]").val() : '02';
accNumber = $("#tdyBankAccount").val();
routingNumber = $("#tdyRoutingNumber").val();
paymentAmount = $("#todaysPayment").val();
// $("#refNo").text(sfs);
repetitiveDrawDate = "";
repPaymentOption = "";
billingFrequency = "";
futurePaymentAmount = "";
rep_nameOnCard = "";
rep_ccExpYear = "";
rep_ccExpMonth = "";
rep_cardNumber = "";
rep_cardTypeTemp = "";
rep_cardType = "";
rep_accHolderName = "";
rep_accNumber = "";
rep_routingNumber = "";
rep_accType = "";
enableAutopay = "false";
policyNumber = $("#policyNumber").val();
var contentObject = {
applicationID : applicationId,
todaysPaymentOption : todaysPaymentOption,
paymentOption : paymentOption,
nameOnCard : nameOnCard,
ccExpYear : ccExpYear,
ccExpMonth : ccExpMonth,
cardNumber : cardNumber,
cardCVVCd : cardCVVCd,
cardType : cardType,
accHolderName : accHolderName,
accType : accType,
accNumber : accNumber,
routingNumber : routingNumber,
paymentAmount : paymentAmount,
repetitiveDrawDate : repetitiveDrawDate,
repPaymentOption : repPaymentOption,
billingFrequency : billingFrequency,
futurePaymentAmount : futurePaymentAmount,
rep_nameOnCard : rep_nameOnCard,
rep_ccExpYear : rep_ccExpYear,
rep_ccExpMonth : rep_ccExpMonth,
rep_cardNumber : rep_cardNumber,
rep_cardType : rep_cardType,
rep_accHolderName : rep_accHolderName,
rep_accNumber : rep_accNumber,
rep_routingNumber : rep_routingNumber,
rep_accType : rep_accType,
enableAutopay : 'false',
policyNumber : policyNumber
};
// covert to query string format
var parameters = $.param(contentObject);
var paymentProcessorURL = $('#userDetailsValidatorUrl').val();
$.ajax({
type : "POST",
url : paymentProcessorURL,
crossDomain:true,
cache:false,
timeout: 15000,
data : parameters,
dataType: 'jsonp',
success : function(response) {
//response = parseJsonResponse(response);
processAjaxBillingResponse(response,todaysPaymentOption);
},
error : function(){
// if ajax call fails then handle error and display message on screen
var errorData = {"paymentAmount": paymentAmount};
var errorMessage = getPaymentErrorMessage("systemError",errorData);
showPaymentOptionsPage();
setGlobalErrorMessage("#globalValidation",errorMessage);
}
});
}