개요

Refundable One Time Payment Code

Overview

Google Standard Payments supports cash-based FOPs (forms of payment) like convenience store purchases (such as a 7-Eleven). At a high level, a user who wants to pay for goods generates a reference number through the Payment integrator. The user then takes this reference number to a convenience store, kiosk, or bank and pays the reference number.

Add payment
1) The user adds a payment method
Choose where to pay
2) Then they choose where to pay
Payment instructions
3) Finally, they are given payment instructions

Concepts and terminology

e

기호 및 규정

이러한 문서의 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY' 및 'OPTIONAL'은(는) RFC 2119에 설명된 대로 해석되어야 합니다.

타임스탬프

모든 타임스탬프는 Unix 에포크 (1970년 1월 1일) 이후 UTC 기준으로 표시됩니다.

예를 들면 다음과 같습니다.

  • 2019년 4월 23일, 오후 8:23:25 GMT = 1556051005000밀리초
  • 2018년 8월 16일, 오후 12:28:35 GMT = 1534422515000밀리초

금액

이 API의 금전적 값은 Google의 표준인 '마이크로'라는 형식으로 되어 있습니다. 마이크로는 정수 기반의 고정 정밀도 형식입니다. 마이크로 단위로 금액을 나타내려면 표준 통화 값에 1,000,000을 곱합니다.

예를 들면 다음과 같습니다.

  • 1.23달러 = 1230,000마이크로달러
  • 미화 0.01달러 = 10,000마이크로 미화

멱등성

이 API 내의 모든 메서드 호출에는 멱등성이 있는 동작이 있어야 합니다. Google은 양측의 트랜잭션이 동일한 상태인지 확인하기 위해 간헐적으로 요청을 재시도합니다. 통합업체는 이미 성공적으로 처리된 요청을 다시 처리하려고 시도해서는 안 됩니다. 대신 성공적인 처리에 대한 응답이 보고되어야 합니다. 모든 메서드에는 requestId가 포함된 공통 RequestHeader가 있습니다. 이 requestId는 모든 호출에 대한 멱등성 키입니다.

비 터미널 응답 (HTTP 200 성공 아님)은 멱등적으로 처리되어서는 안 됩니다. 따라서 이전에 400 (잘못된 요청/실패한 전제조건)을 받은 요청은 두 번째 호출 시 멱등적으로 400을 반환해서는 안 되며 다시 평가해야 합니다. 재평가 시 400이 반환되거나 성공적으로 처리될 수 있습니다.

멱등성에 관한 자세한 내용은 이 상세 가이드를 참고하세요.

통합자

비즈니스를 위해 Google의 결제 플랫폼을 사용하는 회사입니다. YouTube나 애드워즈와 같은 내부 (1P)일 수도 있고, Google의 생태계와 작동하도록 서비스를 통합하려는 외부 (3P) 비즈니스일 수도 있습니다.

결제 방법

결제 수단. 악기보다 더 일반적입니다. Visa, MasterCard, PayPal은 모두 결제 수단입니다.

결제수단

특정 고객에 의한 특정 결제 수단 인스턴스입니다. 사용자의 신용카드나 PayPal 계정을 예로 들 수 있습니다. 특정 고객에 대한 토큰화된 FOP는 Google 시스템에 안전하게 저장된 고객의 결제 수단 인스턴스이므로 결제 수단이기도 합니다.

토큰

Google 시스템에서 특정 사용자의 결제 수단을 나타냅니다. 토큰은 구매에 필요한 모든 정보를 담고 있으므로 도구이기도 합니다. 여기에는 사용자가 통합업체에 가지고 있는 계좌 번호와 같은 정보가 포함될 수 있습니다.

Key flows

Google uses two key flows to create and pay these reference numbers:

  1. Generate Reference Number Flow.
  2. Pay Reference Number Flow.

Later, reconciliation and settlement from resulting purchases are handled by the remittance flow.

The diagram below illustrates each of these flows.

Cash FOP overview

Cash FOP high-level overview

The first two flows are described in more detail in the following sections. See the Remittance flow page if you want to know more about that flow.

Generate reference number

The purpose of the generate reference number flow is to create and exchange an identifier (reference number) that both Google and the integrator can use to identify a purchase. The user can then use this reference number at a convenience store, kiosk, or bank to complete the purchase. This identifier is generated by the integrator at Google's request by calling the generateReferenceNumber method. The request for generation of the reference number includes an amount and a transaction description.

The following diagram illustrates how a reference number is generated and sent to the customer with instructions.

Generate reference number flow

Cash Generate Reference Number

Here is a list of the objects and what they represent:

  • User: This is the person who wants to pay for something using this form of payment.
  • Google UI: This is the interface where the User makes their purchase. It could be through the web or through an app.
  • Google Server: The backend server at Google that requests the generation of the reference number and creates payment instructions for the user.
  • Payment Integrator Server: The backend server of the Payment Integrator that keeps track of the payment details and generates the reference number.

This flow begins with the user who wants to use this cash form of payment.

  1. The User accesses the Google UI which sends sends a request for a reference number.
  2. The Google UI sends a message to the Google Server that it needs a reference number (getReferenceNumber).
  3. The Google Server asks the Payment Integrator Server to generate a reference number (generateReferenceNumber).
  4. The Payment Integrator Server generates and sends the reference number to the Google Server.
  5. The Google Server creates payment instructions to go along with the reference number. Then it sends this information to the Google UI.
  6. The Google UI sends these instructions and reference number to the User.
Notes on reference numbers

Reference numbers can only be paid once, and they can be cancelled through the cancel reference number flow. Also, reference numbers must be alphanumeric, and it must support multiple display formats.

In addition to displaying the reference number, Google's UIs can optionally represent the reference number in the Code 128 format (a barcode format). Other barcode formats can be supported by request.

Pay Reference Number

The user will use this reference number at a convenience store, kiosk, or bank to identify the purchase the user wants to pay for. The integrator should have the user confirm the purchase being paid by displaying the purchase amount, date, and transaction description prior to paying.

Once the user chooses to pay, they must pay in full, and only pay once. This API does not support over or under payments on a single reference number. Multiple payments to a single reference number is also not supported.

Once the user pays, the integrator must immediately notify Google that this reference number has been paid via the referenceNumberPaidNotification method. By calling this method within seconds of the user physically paying, the integrator allows the user to quickly receive their goods. (This call can be added to a queue if the network is down.)

Once paid, the reference number and amount will be included in the remittance statement sent on T+2 days.

Here is a sequence diagram that illustrates the payment of a reference number.

Pay reference number flow

Pay reference number flow

The objects in the diagram represent the following:

  • User: This is the person who wants to pay for something using this form of payment.
  • Convenience Store: The location where the user makes their payment using the reference number and instructions given, such as a convenience store.
  • Payment Integrator Server: The backend server of the Payment Integrator that keeps track of the payment details.
  • Google Server: The backend server at Google that requests the generation of the reference number and creates payment instructions for the user.

This flow begins with the user who goes to a convenience store in order to make a payment according to the instructions given to them.

  1. The User goes to a Convenience Store to make a payment.
  2. After the transaction is complete, the convenience store notifies the payment integrator of payment.
  3. The Payment Integrator Server sends a success message to the Convenience Store.
  4. The Convenience Store conveys that the transaction was a success to the User, and the goods will be delivered to the User soon.
  5. The Payment Integrator Server sends a message to Google’s Server that the reference number has been paid (referenceNumberPaidNotification). This step must not block step 4.
  6. The Google Server responds with a message of success to the Payment Integrator Server.

Cancel reference number

Reference numbers can be cancelled by Google. If Google cancels a reference number, the cancelReferenceNumber method will be called. Upon successful return of this call, it is invalid to pay that reference number, and the integrator must refuse payment for this number. Upon success of this call, all future calls to the referenceNumberPaidNotification will fail.

If the payment process has already started, for example if the user has entered their reference number into a kiosk but has not yet paid, the integrator should return a HTTP 423 response code with ErrorResponse containing [USER_ACTION_IN_PROGRESS][google.standardpayments.v1.ErrorResponse].

Refund

Paid reference numbers can be refunded by Google using the request ID of the original generateReferenceNumber call (note that refunds will NOT use the reference number). If Google refunds a reference number, the refund method will be called. This method can be called multiple times with amounts totalling less than or equal to the original paid amount.

Next: Remittance flow