stripe支付_如何在Stripe上设计支付逻辑(并将其应用)

stripe支付

Payment logic is central to any product that deals with money. After all, a well-designed payment architecture, if properly tested, saves tons of time in the future.

付款逻辑对于任何涉及金钱的产品都是至关重要的。 毕竟,精心设计的付款架构(如果经过正确测试)可以在未来节省大量时间。

But it may take too long to master the top level of working with popular payment gateways.

但是,掌握顶级与流行的支付网关的合作关系可能需要花费太长时间。

To help you out, I wrote this guide on designing payment logic on Stripe. It includes use cases, project examples, and a bit of theory with code samples.

为了帮助您,我编写了有关在Stripe上设计支付逻辑的指南。 它包括用例,项目示例以及一些带有代码示例的理论。

This guide is mostly for QA engineers as it helps to understand how to test payment logic based on Stripe. But don't come off, PMs and developers. We have lots of interesting details for you too.

本指南主要面向质量检查工程师,因为它有助于了解如何测试基于Stripe的支付逻辑。 但是,PM和开发人员请不要失望。 我们也为您提供许多有趣的细节。

条纹如何工作 (How Stripe Works)

Let’s start with the basics and review the Stripe payment scheme.

让我们从基础开始,回顾一下Stripe付款方案。

This scheme works for users that buy content on websites or through mobile apps. Visitors don't need to register and add link credit cards to their profiles – Stripe allows paying for the content seamlessly.

该方案适用于在网站上或通过移动应用程序购买内容的用户。 访客无需注册链接信用卡并将其添加到他们的个人资料中-Stripe允许无缝地为内容付费。

All they need to do is enter credit card details, and the magic happens:

他们所需要做的就是输入信用卡详细信息,神奇的事情发生了:

  1. Credentials are sent to Stripe.

    凭据将发送到Stripe。
  2. Stripe tokenizes the data and returns a token to the back-end.

    Stripe对数据进行令牌化,然后将令牌返回到后端。
  3. Back-end creates a charge.

    后端产生费用。
  4. The data is sent to Stripe again, and it shares the details with payment systems.

    数据再次发送到Stripe,并与付款系统共享详细信息。
  5. Payment systems respond to Stripe and state whether everything alright. Or report about issues.

    支付系统对Stripe做出响应,并说明一切是否正常。 或报告有关问题。
  6. Stripe responds to the server about the state of the transaction.

    Stripe响应服务器有关事务状态的信息。

If everything goes smoothly, the user gets content. If not, an error message.

如果一切顺利,则用户可以获得内容。 如果不是,则显示错误消息。

Besides, there are two necessary conditions to use Stripe:

此外,使用Stripe有两个必要条件:

  • you have a bank account

    你有一个银行帐户
  • you are a resident of one of the 25 supported countries

    您是25个受支持国家之一的居民

将卡连接到Stripe (Connecting a card to Stripe)

Linking your product user with Stripe customer goes on the server-side. And it looks like this:

将您的产品用户与Stripe客户链接起来是在服务器端。 它看起来像这样:

  1. Credit card credentials go to Stripe (from app or website);

    信用卡凭证转到Stripe(从应用程序或网站);
  2. Stripe returns a token, then it goes to the back-end;

    Stripe返回一个令牌,然后转到后端;
  3. Back-end sends it back to Stripe;

    后端将其发送回Stripe;
  4. Stripe checks whether the customer exists (if yes, the card is added, not – it creates a new customer and adds the card).

    Stripe检查客户是否存在(如果是,则添加卡,否-创建新客户并添加卡)。

The first card added is the default payment method. Stripe will use it to make the transaction.

添加的第一张卡是默认付款方式。 Stripe将使用它进行交易。

与Stripe帐户连接 (Connecting with a Stripe account)

If you’re building an on-demand app like Uber and want users to get paid in it (like Uber drivers), ask them to create an account first.

如果您要构建像Uber这样的按需应用程序,并希望用户从中获得报酬(例如Uber驱动程序),请先要求他们创建一个帐户。

There are three types of Stripe accounts:

条带化帐户有三种类型:

  • Standard. An already existing account with the required credentials. Registered by the user, validated by Stripe and a bank.

    标准 。 具有所需凭据的现有帐户。 由用户注册,由Stripe和一家银行验证。

  • Express. Enables easy on-boarding: you create an account on your own, and the user fills it with details. Works within the US.

    快递 。 启用简单的入职流程:您可以自己创建一个帐户,然后用户在其中填写详细信息。 在美国境内工作。

  • Custom. Comes with the highest level of flexibility and allows you to modify multiple parameters. In turn, the platform is responsible for every interaction with users.

    自定义 。 具有最高的灵活性,并允许您修改多个参数。 反过来,该平台负责与用户的每次交互。

条纹核心功能 (Stripe Core Features)

Still on the subject of how Stripe works, I suggest taking a look at its features.

仍然关于Stripe的工作原理,我建议看看它的功能。

收费标准 (Charges)

Stripe makes two kinds of charges – direct and destination.

条纹产生两种费用- 直接费用和目的地费用。

Direct charge

直接充电

Let's get back to the Uber model. The platform charges a certain amount from riders, and that money goes directly to the linked accounts, to drivers. Direct charge implies that drivers pay all the fees. Plus, Uber also charges a fixed percentage.

让我们回到Uber模型。 该平台向骑车人收取一定的费用,而这笔钱将直接进入关联帐户,并转给驾驶员。 直接收费意味着驾驶员要支付所有费用。 此外,Uber还收取固定百分比的费用。

Destination charge

目的地收费

In this case, the platform pays all the fees, and you get the net worth. First, the amount goes to the Stripe account of your platform, and then there’s an automatic transfer to the partner (drivers).

在这种情况下,平台将支付所有费用,您将获得净资产。 首先,金额转到您平台的Stripe帐户,然后自动转移到合作伙伴(驱动程序)。

授权和捕获
(Authorize and capture)

Stripe supports two-step payments that enable users to authorize a charge first and capture it later. Card issuers guarantee that auth payments and the required amount gets frozen on the customer's card.

Stripe支持两步支付,使用户能够先授权费用然后再收取费用。 发卡机构保证将授权付款和所需的金额冻结在客户的卡上。

If the charge isn't captured for this period, authorization is canceled.

如果在此期间未收取费用,则取消授权。

Here's how it works in Uber: a rider sees an approximate cost of the trip while booking the ride. If they agree to it, this amount gets frozen on their cards until they finish their trip.

这是Uber的运作方式:车手在预订车票时会看到大概的行程费用。 如果他们同意,这笔款项将冻结在他们的信用卡中,直到他们完成旅行。

When they finish the ride, Uber calculates the final price and charges it from the card.

当他们完成行程后,Uber会计算最终价格并从卡中收取费用。

Th

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值