【发布时间】:2021-01-08 12:48:44
【问题描述】:
我目前正在我的 Angular 应用程序中开发一种条纹支付方式。默认情况下,条带表单具有“电子邮件”类型的“电子邮件”输入字段。我想将该输入字段更改为“名称”,类型为“文本”。我尝试了不同的方法,但没有一个真正有效有人可以在这方面帮助我吗?任何帮助将不胜感激。谢谢。
我正在附上一张条纹表格图片以获得进一步的帮助。
MY Stripe 方法实现
loadStripe() {
console.log('loadStripe');
if (!window.document.getElementById('stripe-script')) {
let s = window.document.createElement('script');
s.id = 'stripe-script';
s.type = 'text/javascript';
s.src = 'https://checkout.stripe.com/checkout.js';
s.onload = () => {
console.log('token');
this.handler = (window as any).StripeCheckout.configure({
key: this.stripKey,
locale: 'auto',
token(token: any) {
// You can access the token ID with `token.id`.
// Get the token ID to your server-side code for use.
console.log('token', token);
alert('Payment Success!!');
}
});
};
window.document.body.appendChild(s);
}
}
【问题讨论】:
标签: javascript angular typescript stripe-payments payment-gateway