howlingeverett / mastercard-hosted-session Goto Github PK
View Code? Open in Web Editor NEWWrapper around Mastercard Hosted Session, allowing you to treat it as a modern Promise-based Javascript API.
Wrapper around Mastercard Hosted Session, allowing you to treat it as a modern Promise-based Javascript API.
Getting the error when installed and trying to use it.
Module not found: Can't resolve 'core-js/modules/es.array.concat' in '/XXX/node_modules/mastercard-hosted-session/lib'
Is there any version issue with core-js?
I want to build a react native application with payment integration. Can we use the mastercard-hosted-session in the react native app.
I am trying to implement the code in ReactJS and somewhat stuck in configuration set up.
i have installed the package and imported it
import HostedSession from 'mastercard-hosted-session';
Then when the pay button is clicked I am calling the function
HostedSession({
fields: {
card: {
number: '#card-number',
securityCode: '#security-code',
expiryMonth: '#expiry-month',
expiryYear: '#expiry-year'
}
},
frameEmbeddingMitigation: ["javascript"],
interaction: {
displayControl: {
formatCard: 'EMBOSSED',
invalidFieldCharacters: 'ALLOW'
}
}
}).then(hostedSession => {
// hostedSession is a facade that has one public function: sezzionize
return hostedSession.sessionize()
}).then((result) => {
console.log(result.status) // e.g. 'ok' or 'fields_in_error'
console.log(result.session.id) // e.g. SESSION001212312123123123
console.log(result.sourceOfFunds.provided.card.brand) // e.g 'MASTERCARD'
}).catch(error => {
// The facade rejects with HostedSessionError
// if the script fails to append, or fails to sessionise.
console.error(error)
})
But it gives error
Invalid configuration field frameEmbeddingMitigation. Expected an array with at least one element.
Need to know where is the problem
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.