Super simple example of using Stripe 3d secure API
In this example we have 3 types of cards:
- Cards that only work with 3ds
- Cards that can work with or without 3ds (optional)
- Cards that don't support 3ds
Super simple example using Stripe 3d secure API
Home Page: https://bmvantunes.github.io/stripe-3d-secure/
License: MIT License
This is my custom script :
function onClick() {
var name = document.getElementById('holder').value;
var address_line1 = document.getElementById('address').value;
var address_city = document.getElementById('town').value;
var address_state = document.getElementById('county').value;
var address_zip = document.getElementById('postcode').value;
var address_country = document.getElementById('country').value;
var cardNumber = document.getElementById('ccno').value;
var input = document.getElementById('ccexp').value;
var fields = input.split('/');
var expMonth = fields[0];
var expYear = '20'+fields[1];
var cvc = document.getElementById('secode').value;
const paymentRequest = {
name: name,
address_line1: address_line1,
address_city: address_city,
address_state: address_state,
address_zip: address_zip,
address_country: address_country,
cardNumber: cardNumber,
expMonth: expMonth,
expYear: expYear,
cvc: cvc,
currency: 'usd',
amount: 100,
nativeElement: document.querySelector('#iframe-payment')
};
paymentRequest.nativeElement.innerHTML = 'Loading... Please wait...';
doPayment(paymentRequest).then((result) => {
paymentRequest.nativeElement.innerHTML = 'Success!!!! Your details are correct!!!';
window.location.replace = window.location.protocol + '//' + window.location.hostname + '/success';
}).catch((error) => {
console.error(error);
paymentRequest.nativeElement.innerHTML = 'Ups! We can\t validate your details...';
alert('Your credit card was declined. Please enter another credit card or check your info');
});
}
how to make work this script, I'm ready to set my pk_live.But i got error.Only Loading... Please wait... after that show bank page without any redirect .
Thank you.
Europe (3DSecure) not working.
Where i can set privkey?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.