在我的 react-native 项目中,我使用了 react-native-webview 和 stripe js ( https://js.stripe.com/v3 )
使用条纹 js 我正在创建卡片元素来收集卡片详细信息
var elements = stripe.elements()
var card = elements.create('card');
card.mount('#card-element');
Run Code Online (Sandbox Code Playgroud)
当用户按下提交按钮时,我正在调用 stripe.confirmPaymentIntent() 函数来完成付款。
但是当我使用 PRODUCTION PUBLIC_KEY 卡元素未显示时,我遇到了问题,用于测试 PUBLIC_KEY 卡元素是否正确显示。
任何解决方案?
我的项目详情是
xcode 版本 - 12.1 IOS 版本 - 14.1
function stripeCheckoutRedirectHTML(PUBLIC_KEY) {
return `<!DOCTYPE html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<html>
<body>
<!-- Load Stripe.js on your website. -->
<script src="https://js.stripe.com/v3"></script>
<h1 id="error-message"></h1>
<form method="post" id="payment-form">
<div class="form-row">
<label for="card-element">
Credit or debit card
</label>
<div …Run Code Online (Sandbox Code Playgroud) html javascript stripe-payments react-native react-native-webview