- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我的 Stripe 付款显示在我的仪表板上,但其状态为“未完成”,并且将鼠标悬停在上面会显示提示“客户尚未输入付款方式”。我认为我在 session.create() 方法中考虑了付款方式。
我的 Angular 组件创建一个 StripeCheckout 并将 session 数据发送到我的 API。然后API将其包含在对浏览器的响应中(我的第一次尝试是使用这个sessionId来重定向到结账,但我选择了这个,因为它更流畅)。
Angular/TS StripeCheckout 和处理程序:
let headers = new Headers();
headers.append("Content-Type", "application/json");
headers.append(
"authentication",
`Bearer ${this.authServ.getAuthenticatedUserToken()}`
);
this.handler = StripeCheckout.configure({
key: environment.stripe_public_key,
locale: "auto",
source: async source => {
this.isLoading = true;
this.amount = this.amount * 100;
this.sessionURL = `${this.stringValServ.getCheckoutSessionStripeURL}/${this.activeUser.id}/${this.amount}`;
const session = this.http
.get(this.sessionURL, {
headers: new HttpHeaders({
"Content-Type": "application/json",
authentication: `Bearer ${this.authServ.getAuthenticatedUserToken()}`
})
})
.subscribe(res => {
console.log(res);
});
}
});
//so that the charge is depicted correctly on the front end
this.amount = this.amount / 100;
}
async checkout(e) {
this.stripeAmountEvent.emit(this.amount);
this.handler.open({
name: "[REDACTED]",
amount: this.amount * 100,
description: this.description,
email: this.activeUser.email
});
e.preventDefault();
}
NodeJS API 接受它
exports.getCheckoutSession = catchAsync(async (req, res, next) => {
const currentUserId = req.params.userId;
const paymentAmount = req.params.amount;
const user = await User.findById(currentUserId);
const session = await stripe.checkout.sessions.create({
payment_method_types: ['card'],
success_url: `${process.env.CLIENT_URL}`,
cancel_url: `${process.env.CLIENT_URL}`,
customer_email: user.email,
client_reference_id: user.userId,
line_items: [
{
name: `Donation from ${user.userName}`,
description: '[REDACTED]',
amount: paymentAmount,
currency: 'usd',
quantity: 1,
customer: user.userId
}
]
});
const newPayment = await Payment.create({
amount: paymentAmount,
createdAt: Date.now(),
createdById: user._id
});
res.status(200).send({
status: 'success',
session
});
});
付款在我的数据库中创建,付款显示在我的 Stripe 仪表板上。当我期望它从卡中扣款时,付款显示为“未完成”。
提前致谢。
最佳答案
最新版本Checkout让您可以直接在 Stripe 托管的支付页面上接受付款。这包括收集银行卡详细信息、显示您购物车中的商品以及确保客户在重定向到您的网站之前付款。
但目前,您的代码错误地将多种产品混合在一处。您的客户端代码使用 Legacy Checkout 。这是 Stripe 产品的旧版本,您可以使用它来安全地收集卡详细信息。这不是你应该再使用的东西。
然后在服务器端,您正在使用较新版本的 Checkout通过创建一个 session
。这部分是正确的,但您似乎从未使用过它。
相反,您需要在服务器端创建 session ,然后在客户端,您只需使用 redirectToCheckout
重定向到 Stripe,如文档 here 所示。 .
关于node.js - 为什么 Stripe 付款不完整?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58757239/
我有一个包含交易的简单表格,我想了解每个月有多少消费者进行的交易总额大于 0,并且他们的第一笔交易不在该月。首次交易是指客户在当月首次购买。 我试图得到的结果是以下形式: +--------+----
这是一个网站,点击“Dodaję”(在波兰语中意为“添加”)后,商品进入购物篮 30 分钟:https://remix.pl/ 当元素在购物篮中时,其他人无法购买该元素。我检查了他们的 basked:
我想知道,您是否编写了一个使用 Paypal 付款作为付款方式的网站(您被重定向到他们的网站进行付款的付款方式,而不是网络付款专业版)。 我可以存储什么样的详细信息?是否只有他们的 Paypal 电子
我一直在开发需要实现触碰付款的应用程序。我能够将 HCE 服务与 NFC 终端连接。 现在我的问题是接下来的步骤是什么,用它进行实际付款? 我到处搜索,但找不到合适的文件。请帮我。 下面是我编写的将
我正在为我在学校的最终项目开发一个网站,在我的网站上您可以购买硬币来打开礼物,但我想自动付款。当客户完成付款后,他会被重定向到 success.php,我如何安排他在付款成功后自动在他的帐户中获得 X
我正在使用 Stripe 在我的应用程序中付款。我成功获得了 token 。我想知道如何收费,因为我的 Stripe 仪表板中没有反射(reflect)任何变化。我正在使用我的 Stripe 帐户 T
我的网站是用 Python 编码的,我想提供通过 paypal 在我的网站上接受付款的功能。我想使用免费的 paypal 服务(无月费)来执行此操作,用户将被重定向到 paypals 站点以登录并付款
我们正在开发一个 iOS 应用程序,它提供一些可以在应用程序内使用的积分(付费)。我们对此几乎没有疑问 - 我们能否使用第三方支付网关,如 paypal 或类似的网关,或者我们需要为此实现 IAP?
我想从我的账户处理向 PayPal 用户的 PayPal 付款。我使用 PHP 脚本从我的服务器获取表单详细信息,但是,我无法仅使用 PHP 脚本处理付款(我想 PayPal 网站要求用户在客户端使用
我正在尝试实现以下场景: 用户批准针对选定包大小的定期每周付款(订阅) 用户每周都可以:A。取消特定周的交货并避免支付本周的费用b.修改包裹尺寸,只为这次少付/多付C。除了每周套餐之外,添加其他项目并
我尝试用信用卡创建付款并从 paypal 得到回复成功 ACK 但在 IPN 中我的目标是获得和等待响应,为什么我在尝试使用此付款时收到此错误 METHOD=DoDirectPayment &VERS
您能否以某种方式要求用户批准付款并在稍后处理这笔付款?具体来说,我有一个市场,用户 A 可以在其中向其他用户 B 索取一些产品。我想在用户 A 收到他的产品时收费,但我希望用户 B 确保不会白白创造他
我正在创建一个 phonegap 应用程序,它有 2 个变量用于在 paypal.js 文件中设置 PayPalEnvironmentProduction 和 PayPalEnvironmentSan
我的问题可能看起来非常基础并且依赖于 View ,但我希望了解它的各个方面。我创建了一个移动应用程序,用户需要在其中注册才能使用该应用程序,但我的客户希望拥有网站形式的管理面板,用户可以通过 payp
已关闭。此问题旨在寻求有关书籍、工具、软件库等的建议。不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,
我在我的网站上付款,您可以在网站上赚钱。因此,用户可以选择他想向他的网站账户转账多少钱。 我希望可以选择当用户的资金少于例如 20 美元时自动启动从他的帐户转账到我的帐户并在我的网站上充值他的信用额度
我想创建一个市场,用户可以在其中列出商品并让买家直接通过 Paypal 付款。有没有办法在我们这边跟踪这些付款,以便我可以对数据进行操作(例如将订单标记为已完成)?我在想我可以让卖家将他们的 payp
我目前在我工作的网站上使用 Paypal 作为支付系统,到目前为止一切正常...除了一件事。付款完成后,Paypal 调用我提供的 IPN 页面,一切正常。但是,如果此人取消付款,我不确定我应该如何知
我有两个网站,两个网站都通过 PayPal 付款销售相同的产品。但现在我需要确定特定交易是从哪个网站进行的。我的意思是这次购买是从哪个网站进行的。那么有什么方法可以识别吗?? 非常感谢。 最佳答案 您
我想在paypal支付页面获取多个产品。我现在只得到一个单一的第一个产品。有人可以帮我解决我错的地方吗?下面是我的代码..我搜索谷歌,发现还有两件事要改变。即 _xclick 到 _cart 和一个
我是一名优秀的程序员,十分优秀!