【发布时间】:2021-11-27 15:13:40
【问题描述】:
var stripe = Stripe('pk_test_51JaZneFymkOlJfbtifS7RjJeFPZTchtlvU5iiVmemkU76vOFWWPZOW9GwBDb9518RCoOfkvUQkGV92TyEMaXqYgh00eb6kLKZj');
var session = "<?php echo $checkout_session['id']; ?>";
stripe.redirectToCheckout({ sessionId: session })
.then(function(result) {
// If `redirectToCheckout` fails due to a browser or network
// error, you should display the localized error message to your
// customer using `error.message`.
if (result.error) {
alert(result.error.message);
}
})
.catch(function(error) {
console.error('Error:', error);
});
由于某种原因,我无法访问 >> .then(function(result)
【问题讨论】:
-
documentation 仅此而已。不知道为什么不能在
if (result.error)上设置断点进行调查。我猜页面在成功时被重定向。
标签: javascript json api stripe-payments payment-gateway