For the complete documentation index, see llms.txt. This page is also available as Markdown.

获取扣款数据

用于查询特定扣款的详细信息。

前置条件

在接入 Codapay 的 API 时,请确保遵循以下规范:

  • 使用 HTTPS 协议

  • 使用 TLS 1.2 或更高版本

参考信息

接口:

GET {基本网址}/direct/charges/{charge_id}

当前环境可用性:

环境
是否可用

沙盒环境

正式环境

Codapay 的 API 支持 REST 网页服务。默认情况下,显示的端点均为 RESTful 格式。

请求参数说明

参数名称
数据类型
描述
限制条件
必填 (?)

charge_id

String

扣款的唯一标识符

必须为有效的 charge ID

响应参数说明

响应返回的是 charge 对象,包含扣款详情。

参数名称
数据类型
描述

id

String

Coda 为该笔扣款生成的唯一标识符

created_at

String

扣款创建时间戳

status_code

String

error_code

String

扣款失败的错误码,详见 Direct Card API 扣款错误码

error_description

String

扣款失败的错误描述,详见 Direct Card API 扣款错误码

finalized_at

String

扣款完成时间戳

item_code

String

商品代码

item_name

String

商品名称

amount_value

String

扣款金额总值

amount_currency

String

扣款币种

partner_reference

String

商户自定义的扣款唯一标识符

shopper_agent

JSON 对象

包含用户浏览器详情的对象

setting

JSON 对象

包含设置信息的对象(例如:partner_webhook_url)

payment_method

JSON 对象

包含支付方式详情的对象

shopper_action

JSON 对象

包含用户下一步操作的对象(如需 3DS 验证时返回)

shopper_agent

参数名称
数据类型
描述

ip_address

String

用户的 IP 地址

user_agent

String

用户的浏览器 User-Agent

timezone

String

用户的时区

screen_height

String

用户设备的屏幕高度

screen_width

String

用户设备的屏幕宽度

colour_depth

String

用户设备的颜色深度

accept_header

String

用户发送的 Accept 请求头

setting

参数名称
数据类型
描述

default_language

String

首选语言

partner_webhook_url

String

用于接收扣款通知(授权与扣款)的 URL

card

JSON 对象

包含卡片设置详情的对象(例如 3DS 验证、扣款确认等)

setting → card

参数名称
数据类型
描述

pre_capture_ack_url

String

用于发送扣款确认请求的 URL

capture_grace_period

Integer

扣款请求的延迟时间(秒),默认值为 0

3ds_challenge_window_size

String

3D Secure 验证挑战窗口的尺寸

payment_method

参数名称
数据类型
描述

id

String

支付方式的 ID

created_at

String

支付方式创建的时间戳

type

String

支付方式类型

card

JSON 对象

卡片详细信息

shopper

JSON 对象

包含用户信息的对象

payment_method → shopper

参数名称
数据类型
描述

id

String

用户的唯一标识符

created_at

String

用户创建的时间戳

status_code

JSON 对象

用户的状态

email

String

用户的电子邮件地址

zip_code

String

用户的邮政编码

payment_method → card

参数名称
数据类型
描述

id

String

卡片的唯一标识符

created_at

String

卡片创建的时间戳

country_code

String

必须为有效的 ISO 3166-1 alpha-2 国家代码

holder_name

String

持卡人姓名

last_four

String

卡号的最后 4 位数字

expiration_month

String

卡片的到期月份

expiration_year

String

卡片的到期年份

shopper_action

参数名称
数据类型
描述

id

String

shopper action 的唯一标识符

type

String

用户需执行的操作类型

form

JSON 对象

包含表单详情的对象

shopper_action → form

参数名称
数据类型
描述

id

String

表单的唯一标识符

method

String

提交所需的 HTTP 方法

action

String

商户需要提交的 URL

inputs

List of Input

表单所需填写的字段详情

shopper_action → form → inputs → item

参数名称
数据类型
描述

name

String

表单字段的名称

value

String

字段的值

type

String

字段的类型

最后更新于

这有帮助吗?