hello this my code is not working internet explorer plz give me solution - /**
-
* When we click on a card
-
*/
-
$('#btnpay').click(function(){
-
const paymentRequest = {
-
cardNumber: $('#cartno').val(),
-
expYear: $('#expYear').val(),
-
expMonth: $('#expMonth').val(),
-
cvc: $('#cvcno').val(),
-
currency: 'GBP',
-
amount: $('#amount').val(),
-
nativeElement: document.querySelector('#iframe-payment')
-
};
-
-
paymentRequest.nativeElement.innerHTML = 'Loading... Please wait... while you are redirecting payment getway ';
-
$('.frm').hide()
-
doPayment(paymentRequest).then((result) => {
-
$('#formpay').append('<input type="hidden" name="stripeSource" value="'+result.id+'" />');
-
$('#formpay').submit()
-
-
}).catch((error) => {
-
-
paymentRequest.nativeElement.innerHTML = 'Ups! We can\t validate your details...';
-
-
setTimeout(function() {
-
location.reload();
-
}, 3000);
-
});
-
})
-
-
-
-
function isNumberKey(evt){
-
-
var charCode = (evt.which) ? evt.which : event.keyCode
-
if (charCode > 31 && (charCode < 48 || charCode > 57))
-
return false;
-
-
-
-
}
-
-
-
$('#cartno').keyup(function() {
-
var length = $(this).val().length;
-
-
if(length==16){
-
-
$('#expMonth').focus()
-
}
-
-
});
-
-
$('#expMonth').keyup(function() {
-
var length = $(this).val().length;
-
var firstChar = $(this).val().substr(0, 1);
-
if(firstChar>1){
-
$(this).val(0)}
-
if(length==2){
-
$('#expYear').focus()
-
}
-
-
-
-
-
});
-
-
-
$('#expYear').keyup(function() {
-
var length = $(this).val().length;
-
-
if(length==2){
-
$('#cvcno').focus()
-
}
-
-
});
-
-
-
$('#cvcno').keyup(function() {
-
var length = $(this).val().length;
-
-
if(length==3){
-
$('#btnpay').focus()
-
}
-
-
});
9 1446 gits 5,390
Expert Mod 4TB
what exactly is not working?
trigger is not working on internet explorer
error on this line doPayment(paymentRequest).then((result) => {
plz giving me right solution
gits 5,390
Expert Mod 4TB
which version of IE is it? i suspect that it doesnt support promises so you would need to include some code to polyfill the promise-construct or u can use babel to transpile the code.
this code not working on IE 11 version please give me any solution
gits 5,390
Expert Mod 4TB
i gave you 2 possible hints to solve that issue - u can use babel for transpiling or use something like this: https://github.com/taylorhakes/promise-polyfill
note: this is just an example - there are many more such implementations that can be used.
i used babel but i get other error 'Promise' is undefined in api file
this file - /**
-
* This is the main function - The only one that we should call from outside this file
-
*/
-
function doPayment(paymentRequest) {
-
return new Promise((resolve, reject) => {
-
const onCreateCardCallback = create3DSecure(paymentRequest, resolve, reject);
-
return Stripe.source.create({
-
type: 'card',
-
card: {
-
number: paymentRequest.cardNumber,
-
cvc: paymentRequest.cvc,
-
exp_month: paymentRequest.expMonth,
-
exp_year: paymentRequest.expYear
-
}
-
}, onCreateCardCallback);
-
});
-
}
-
-
function create3DSecure(paymentRequest, resolve, reject) {
-
return (status, cardResponse) => {
-
-
-
if (status !== 200 || cardResponse.error) { // problem
-
reject(cardResponse.error);
-
} else if (cardResponse.card.three_d_secure === 'not_supported' && cardResponse.status === 'chargeable') {
-
resolve(cardResponse);
-
} else if(cardResponse.card.three_d_secure === 'optional' || cardResponse.card.three_d_secure === 'required') {
-
const onCreate3DSecureCallback = createIframe(paymentRequest, resolve, reject);
-
-
Stripe.source.create({
-
type: 'three_d_secure',
-
amount: paymentRequest.amount,
-
currency: paymentRequest.currency,
-
three_d_secure: { card: cardResponse.id },
-
redirect: { return_url:'demo.com'}
-
}, onCreate3DSecureCallback);
-
}
-
else {
-
reject(cardResponse);
-
}
-
};
-
}
-
-
function createIframe(paymentRequest, resolve, reject) {
-
return (status, stripe3dsResponse) => {
-
-
if (status !== 200 || stripe3dsResponse.error) { // problem
-
reject(stripe3dsResponse.error);
-
} else {
-
paymentRequest.nativeElement.innerHTML =
-
'<iframe style="width:100%; height:622px;" frameborder="0" src="' + stripe3dsResponse.redirect.url + '"></iframe>';
-
-
const onPollCallbackReal = onPollCallback(paymentRequest, resolve, reject);
-
Stripe.source.poll(stripe3dsResponse.id, stripe3dsResponse.client_secret, onPollCallbackReal);
-
}
-
};
-
}
-
-
function onPollCallback(paymentRequest, resolve, reject) {
-
return (status, source) => {
-
-
-
if (status !== 200 || source.error) {
-
-
reject(source.error);
-
} else if (source.status === 'canceled' || source.status === 'consumed' || source.status === 'failed') {
-
-
reject(source.status);
-
} else if (source.three_d_secure.authenticated && source.status === 'chargeable') {
-
-
-
resolve(source);
-
}
-
};
-
}
gits 5,390
Expert Mod 4TB
this most likely means that the Browser doesnt know of a Promise object
what i do on this error please give me any solution thank you for helping to me
gits 5,390
Expert Mod 4TB
there is a call:
obviously that Object is not defined anywhere - so the browser doesnt know that object and u need some polyfill - either the babel one or another. for babel u can start checking here: https://babeljs.io/docs/plugins/transform-runtime/ Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tim Stevens |
last post by:
Hello,
This is the first time I have had to resort to posting on here, as Ive
always been able to find a solution to my problems in the past by
browsing postings by others. So, to start with I...
|
by: David |
last post by:
Hello.
Can anybody tell me do I open any web page from my code in Internet
Explorer?
Or how can I just run any program from my code?
|
by: pradeep_TP |
last post by:
I am facing a strange problem with my web site. Afer reinstalling the web
application on the web server, I am getting a dialog box for each page. The
dialog box has the following information.
...
|
by: Test |
last post by:
Hi everyone,
is there a possibility to get the html source code of an Internet Explorer
window that I have only the name/title of? In my case it's not possible to
use the...
|
by: Etayki |
last post by:
Hi!
I am new to VB.net and I am using the Visual Basic 2005 Express
Edition
I have two questions:
1. I am trying to write an application that will automate Internet
Explorer and store data...
|
by: bharat dhaneshwari |
last post by:
hi,
I want to know that if in our application we have one textbox and one button then when we write any website's name ,how will it should opened in the Internet explorer.
give me some well...
|
by: jlackyashdya |
last post by:
hi,
i m developing a xml based image gallery. i wrote code for generating thumbnails using loader component.
its working fine locally. but when i upload it , In Mozilla firefox browser its working...
|
by: swethak |
last post by:
Hi,
I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error...
|
by: xavierp |
last post by:
I just created a website which works fine on Firefox, Opera and Safari but some reason it just has a white tag when i try to open it up in Internet Explorer.
I'm only in year 8 so it probably my...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |