stripe-payments - 使用支付宝的 Stripe 订阅支付
问题描述
我有条带订阅付款按钮,以下是该按钮的代码:
var stripe = Stripe("<?php echo $stripe["public_key"]; ?>");
$(".btnStripeSubscribe").click(function () {
stripe.redirectToCheckout({
items: [{
plan: "<?php echo $planId; ?>",
quantity: 1
}],
customerEmail: "<?php echo $user["email"]; ?>",
successUrl: "http://example.com/success.php",
cancelUrl: "http://example.com/dashboard.php"
});
});
我添加了支付宝选项,以下是我使用的代码:
stripe.createSource({
type: 'alipay',
amount: '500',
currency: 'cny',
redirect: {
return_url: 'http://example.com/success.php'
},
}).then(function (response) {
if (response.error) {
alert(response.error.message);
} else {
window.location.href = source.redirect.url;
}
});
问题 1: 我不确定我做的是否正确。支付宝的代码看起来像一次性收费,不像订阅。因为在我的 Stripe Dashboard 中,它没有显示在订阅页面中。
问题2: 有没有办法使用plan ID使用支付宝进行收费?
谢谢!
解决方案
是的,但这里只说邀请。不确定我们是否需要联系 Stripe 来获得邀请或支付宝。
推荐阅读
- spring - 尝试设置 PSQL 并出现此错误:
- tsql - SQL Server - 与 Group By 一起选择 Raw_Number
- python - Python go.Indicator - 在图中将点更改为逗号
- c# - 使用 Rest API 版本 V50.0 上传到 Salesforce 后文件损坏
- javascript - 如何在 Javascript 中将字符串变量添加到 JSON 查询而不添加额外的转义
- powershell - mawk 脚本适用于 linux,但不适用于 windows
- wit.ai - Wit.ai 获取数字字符而不是纯文本数字
- python - 返回满足 3 个要求的数字列表长度的函数
- python - 无法捕获异常,系统只是关闭
- c# - 预期 CryptographicException '密钥不存在。