現金付款方式

總覽

Google Standard Payments 支援現金交易付款方式 (例如付款方式),例如在便利商店 (例如 7-Eleven) 消費。整體來說,想支付商品費用的使用者會透過付款整合商產生參考編號。接著,使用者將這個參考編號帶往便利商店、資訊站或銀行,並支付該參考號碼。

新增付款方式
1) 使用者新增付款方式
選擇付款地點
2) 接著選擇付款地點
付款操作說明
3) 最後,他們會提供付款操作說明

概念與術語

{setvar <顏色> 付款結果。付款詳情

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 和整合商用於識別購買交易。如此一來,使用者可以在便利商店、資訊站或銀行中使用這組參考編號完成交易。整合者必須呼叫 generateReferenceNumber 方法,才能依 Google 的要求產生這組 ID。產生參考號碼的要求會包含金額和交易說明。

下圖說明系統如何產生並傳送參考號碼給客戶。

產生參考編號流程

現金產生參考編號

以下列出這些物件及其代表的意義:

  • 使用者:這是指想透過這個付款方式付費的使用者。
  • Google UI:使用者進行購買交易的介面。可能透過網頁或應用程式。
  • Google 伺服器:Google 的後端伺服器,會要求產生參考號碼,並為使用者建立付款操作說明。
  • 付款整合商伺服器:付款整合商的後端伺服器,用於追蹤付款詳情並產生參考號碼。

此流程由想要使用此現金付款方式的使用者開始。

  1. 使用者存取 Google 使用者介面,以傳送參考號碼的要求。
  2. Google UI 傳送訊息給 Google 伺服器,需要參考編號 (getReferenceNumber)。
  3. Google 伺服器要求付款整合商伺服器產生參考號碼 (generateReferenceNumber)。
  4. 付款整合商伺服器會產生參考編號,並傳送至 Google 伺服器。
  5. Google 伺服器會建立付款指示及參考編號。然後將這些資訊傳送到 Google 使用者介面。
  6. Google 使用者介面會將這些指示和參考編號傳送給使用者。

參考編號的附註

參考號碼只能支付一次,而且可以透過取消參考號碼流程取消。此外,參考編號必須為英數字元,且必須支援多種顯示格式。

除了顯示參考號碼之外,Google 的使用者介面也可選擇呈現編號 128 格式 (條碼格式) 的參考編號。可要求支援其他條碼格式。

付款參考號碼

使用者可在便利商店、資訊站或銀行中使用這組參考編號,識別使用者要支付的購買交易費用。整合商應讓使用者在付款前顯示購買金額、日期和交易說明,藉此確認購買交易是否已經支付。

使用者選擇付款後,必須付清款項,而且只需付款一次。此 API 不支援以單一參考號碼支付或支付的款項。也無法對單一參考號碼進行多次付款。

使用者付款後,整合商必須立即向 Google 通知 Google 已透過 referenceNumberPaidNotification 方法支付這個參考編號。透過在使用者實際付款後的幾秒內呼叫這個方法,整合商可讓使用者快速收到商品。(如果網路停止運作,這個呼叫可加入佇列)。

付款後,參考編號和金額會列於 T+2 日寄出的匯款對帳單。

以下是參考編號付款的序列圖表。

付款參考編號流程

付款參考編號流程

圖中的物件代表以下內容:

  • 使用者:這是指想透過這個付款方式付費的使用者。
  • 便利商店:使用者以參考編號和提供的操作說明 (例如便利商店) 付款。
  • 付款整合商伺服器:付款整合商的後端伺服器,用於追蹤付款詳情。
  • Google 伺服器:Google 的後端伺服器,會要求產生參考號碼,並為使用者建立付款操作說明。

此流程由使用者前往便利商店,以便根據他們提供的指示付款。

  1. 使用者前往便利商店付款。
  2. 交易完成後,便利商店會通知付款整合商。
  3. 付款整合商伺服器傳送成功訊息至便利商店。
  4. 便利商店表示交易成功給使用者,商品很快就會送達使用者。
  5. 付款整合商伺服器傳送訊息給 Google 的伺服器,告知已付款參考編號 (referenceNumberPaidNotification)。這個步驟不得封鎖步驟 4。
  6. Google 伺服器會回應「付款整合商伺服器」成功訊息。

取消參考編號

Google 可取消參考號碼。如果 Google 取消參考編號,系統會呼叫 cancelReferenceNumber 方法。成功傳回該號碼後,無法支付該參考號碼的款項,整合商也必須拒絕支付該號碼的款項。呼叫成功後,日後對 referenceNumberPaidNotification 的所有呼叫都會失敗。

如果付款程序已開始,例如使用者已在資訊站中輸入參考號碼,但尚未付款,整合商應傳回包含 USER_ACTION_IN_PROGRESS 的 ErrorResponse 回應代碼。

下一步:匯款流程