现金 FOP

概览

Google Standard Payments 支持便利店购物(如 7-Eleven)等现金付款方式(付款方式)。概括来讲,想要购买商品的用户会通过付款集成商生成参考编号。然后,用户会将该参考号带到便利店、自助服务终端或银行,并支付该参考号。

添加付款方式
1) 用户添加付款方式
选择支付地点
2) 然后,他们会选择付款方式
付款说明
3) 最后,他们会看到付款说明

概念与术语

"时-成功。

Symbols & Conventions

The key words "MUST," "MUST NOT," "REQUIRED," "SHALL," "SHALL NOT," "SHOULD," "SHOULD NOT," "RECOMMENDED," "MAY," and "OPTIONAL" in these documents are to be interpreted as described in RFC 2119.

Timestamps

All timestamps are represented as milliseconds since the Unix epoch (Jan 1, 1970) in UTC.

For example:

  • April 23, 2019 8:23:25 PM GMT = 1556051005000 milliseconds
  • August 16, 2018 12:28:35 PM GMT = 1534422515000 milliseconds

Amounts

Monetary values in this API are in a format called "micros," a standard at Google. Micros are an integer based, fixed precision format. To represent a monetary value in micros, multiply the standard currency value by 1,000,000.

For example:

  • USD$1.23 = 1230000 micro USD
  • USD$0.01 = 10000 micro USD

Idempotency

All method calls within this API must have idempotent behavior. Google will sporadically retry requests to ensure that transactions are in the same state on both sides. Integrators should not attempt to reprocess any request already successfully processed. The response for the successful processing should be reported instead. All methods have a common RequestHeader which contains a requestId. This requestId is the idempotency key for all calls.

Any non terminal response (a non HTTP 200-success), must not be idempotently processed. So a request that previously got a 400 (bad request/failed precondition), when called a second time, must not idempotently return 400, it must be re-evaluated. At re-evaluation, it could return a 400 or be processed successfully.

For more information on idempotency see this detailed guide.

Integrator

A company who uses Google’s Payment Platform for their business. It could be internal (1P), such as Youtube or AdWords, It can also be an external (3P) business wanting to integrate their service to work with Google’s ecosystem.

FOP

Form of Payment. This is more general than an instrument. Visa, MasterCard, and PayPal are all FOPs.

Instrument

A particular instance of a form of payment by a specific customer. For instance, a user’s credit card, or their PayPal account. A tokenized FOP for a particular customer is also an instrument, because it is an instance of a form of payment for that customer, securely stored on our system.

Token

A representation, on Google’s system, of a specific user’s payment method. Since it contains all the information needed to make a purchase, a token is also an instrument. This may include such information as an account number a user has with their integrator.

主要流程

Google 使用两个关键流程来创建和支付这些参考号:

  1. 生成参考编号流。
  2. 支付参考编号流程。

之后,所产生购买交易的对帐和结算将由汇款流程处理。

下图展示了其中的每个流程。

现金 FOP 概览

现金 FOP 简要概览

以下各部分更详细地介绍了前两个流程。如果您想详细了解该流程,请参阅汇款流程页面。

生成参考号

生成参考编号流程的目的是创建并交换 Google 和集成商都可用于识别购买交易的标识符(参考编号)。然后,用户可以在便利店、自助服务终端或银行使用此参考号来完成购买交易。此标识符由集成商应 Google 的请求通过调用 generateReferenceNumber 方法生成。生成参考号的请求包括金额和交易说明。

下图说明了如何生成参考编号,并将其随说明发送给客户。

生成参考编号流程

现金生成参考编号

下面列出了这些对象及其所代表的含义:

  • 用户:希望使用此付款方式为商品付款的人。
  • Google 界面:这是用户进行购买的界面。可以通过网络或应用找到。
  • Google 服务器:Google 的后端服务器,用于请求生成参考号,并为用户创建付款说明。
  • 付款集成商服务器:付款集成商的后端服务器,用于跟踪付款明细并生成参考编号。

该流程从想要使用此现金付款方式的用户开始。

  1. 用户访问 Google 界面,该界面会发送一个请求参考编号。
  2. Google 界面会向 Google 服务器发送一条消息,告知它需要参考编号 (getReferenceNumber)。
  3. Google 服务器要求付款集成商服务器生成参考编号 (generateReferenceNumber)。
  4. 付款集成商服务器生成参考号,并将其发送给 Google 服务器。
  5. Google 服务器会创建付款说明以及参考号。然后,它会将这些信息发送到 Google 界面。
  6. Google 界面会将这些说明和参考编号发送给用户。

有关参考编号的注意事项

参考号只能支付一次,可以通过取消参考号流程将其取消。此外,参考编号必须是字母数字,并且必须支持多种显示格式。

除了显示参考编号之外,Google 的界面还可以选择以 Code 128 格式(条形码格式)显示参考编号。还可应要求支持其他条形码格式。

支付参考编号

用户将在便利店、自助服务终端或银行使用此参考号来识别用户想要付款的购买交易。集成商应在付款前显示交易金额、日期和交易说明,让用户确认购买交易是否已支付。

用户选择付款后,必须全额付款,并且只需付款一次。此 API 不支持基于单个参考号的多付或少付款。也不支持向单个参考号进行多次付款。

用户付款后,集成商必须立即通知 Google,告知 Google 此参考编号已通过 referenceNumberPaidNotification 方法付款。集成商可以在用户进行实际付款后的几秒内调用此方法,以便用户可以快速收到其商品。(如果网络中断,可以将此通话添加到队列中。)

付款后,参考编号和金额将包含在 T+2 天发送的汇款对账单中。

以下序列图说明了参考号的支付。

付款参考编号流程

付款参考编号流程

图中的对象表示以下内容:

  • 用户:希望使用此付款方式为商品付款的人。
  • 便利店:用户使用参考编号和提供的说明进行付款的营业地点,例如便利店。
  • 付款集成商服务器:付款集成商跟踪付款明细的后端服务器。
  • Google 服务器:Google 的后端服务器,用于请求生成参考号,并为用户创建付款说明。

该流程从用户按照提供的说明前往便利店付款。

  1. 用户前往便利店进行付款。
  2. 交易完成后,便利店会通知付款集成商付款事宜。
  3. 付款集成商服务器向便利店发送一条成功消息。
  4. 便利店通知用户交易成功,商品很快就会送达用户。
  5. 付款集成商服务器向 Google 的服务器发送消息,告知参考编号已支付 (referenceNumberPaidNotification)。此步骤不得阻止第 4 步。
  6. Google 服务器将向付款集成商服务器发送一条成功消息。

取消参考号

Google 可能会取消参考号。如果 Google 取消某个参考号,系统会调用 cancelReferenceNumber 方法。成功返回此调用后,支付该参考号码将无效,集成商必须拒绝为此号码付款。此调用成功后,未来对 referenceNumberPaidNotification 的所有调用都将失败。

如果付款流程已开始(例如,如果用户在自助服务终端中输入了参考号,但尚未付款),集成商应返回 HTTP 423 响应代码,其中的 ErrorResponse 包含 USER_ACTION_IN_PROGRESS

下一步:汇款流程