本參考資料以卡片付款方式結構定義為基礎,說明結帳完成後,Google Pay 付款處理常式在 payment.instruments 陣列中傳回的付款方式物件。
{
"id": string,
"handler_id": string,
"type": string,
"selected": boolean,
"display": {
"brand": string,
"last_digits": string,
"description": string,
"card_art": string
},
"billing_address": {
"first_name": string,
"last_name": string,
"street_address": string,
"extended_address": string,
"address_locality": string,
"address_region": string,
"postal_code": string,
"address_country": string,
"phone_number": string
},
"credential": {
"type": "PAYMENT_GATEWAY" | "DIRECT",
"token": string
}
}
屬性
| 屬性 | 類型 | 是否一律會顯示? | 說明 |
|---|---|---|---|
id |
字串 | 是 | 平台指派的付款方式執行個體專屬 ID。 |
handler_id |
字串 | 是 | 產生這項工具的處理常式執行個體專屬 ID。對應於付款處理常式設定中的 id 欄位。 |
type |
字串 | 是 | 付款方式類型,例如 card。 |
selected |
布林值 | 否 | 指出使用者是否選取這項樂器。 |
display |
物件 | 是 | 顯示付款方式資訊。 |
display.brand |
字串 | 是 | 卡片品牌/發卡機構 (例如「VISA」)。 |
display.last_digits |
字串 | 是 | 卡號末 4 碼。 |
display.description |
字串 | 否 | 向使用者顯示的資訊卡說明。 |
display.card_art |
字串 | 否 | 代表資訊卡的圖片 URI。 |
billing_address |
物件 | 否 |
與卡片相關聯的帳單地址。
只有在設定中將 billing_address_required 設為 true 時,才會傳回這個值。
|
billing_address.first_name |
字串 | 否 | 與地址相關聯的聯絡人名字。 |
billing_address.last_name |
字串 | 否 | 與地址相關聯的聯絡人姓氏。 |
billing_address.street_address |
字串 | 否 | 街道地址。 |
billing_address.extended_address |
字串 | 否 | 地址延伸資訊 (例如公寓或套房號碼)。 |
billing_address.address_locality |
字串 | 否 | 地區 (例如城市)。 |
billing_address.address_region |
字串 | 否 | 區域 (例如州或省)。 |
billing_address.postal_code |
字串 | 否 | 郵遞區號。 |
billing_address.address_country |
字串 | 否 | 國家/地區代碼 (包含兩個英文字母的 ISO 3166-1 alpha-2 格式)。 |
billing_address.phone_number |
字串 | 否 |
電話號碼。
只有在設定中將 phone_number_required 設為 true 時,才會傳回這個值。
|
credential |
物件 | 否 | Google Pay 傳回的安全代碼化資料。 |
credential.type |
字串 | 是 |
代碼化類型。與設定的類型相符。
|
credential.token |
字串 | 是 |
加密的付款憑證權杖,以 JSON 序列化字串的形式呈現。
對於 PAYMENT_GATEWAY,這包含要傳送至閘道的加密酬載。
如果是 DIRECT,則包含已加密的卡片資料 (需要使用私密金鑰解密)。如要進一步瞭解格式和解密程序,請參閱「付款資料密碼編譯」指南。
|