Alipay, China's leading third-party online payment solutionAlipay, China's leading third-party online payment solution

How can we help?

BACK

How to set the timeout parameter of"create_forex_trade"?

Question:

How to control the transaction valid time of PC payment (create_forex_trade)?

Answer:

There are two ways to control the valid time of "create_forex_trade".

  1. 1. Use parameter "order_gmt_create" and "order_valid_time"
  2. 2. Use parameter "timeout_rule"

NOTE:

  • order_gmt_create should be GMT+8 time.
  • order_valid_time > 60
  • timeout_rule should be one of "5m 10m 15m 30m 1h 2h 3h 5h 10h 12h 1d 3d 7d 15d", by default it's only support 12h, to set other valua please contact overseas_support@service.alibaba.com to config at first, or the request will return INVALID_PARAMETER error.

该接口有2个参数可控制超时timeout_rule和(order_gmt_create&order_valid_time),具体区别如下:

1)order_gmt_create、order_valid_time:订单创建时间和订单过期时间成对存在,当timeout_rule也有值的情况下,以商户传递的开始和过期时间为准;

1-1)单独使用timeout_rule:

该参数控制两次时间,第一次是用户登录前,一次是用户登录后,虽然该参数有误差,但是不大:

1-1-a) 不登录支付宝,控制跳转到登录的时间;

1-1-b) 登录后,该参数控制 创建订单到支付完成的时间。

1-2) 使用order_gmt_create&order_valid_time:

1-2-a)order_valid_time 不是从用户登录后重新计时的,是从order_gmt_create 开始计时;

1-2-b)order_valid_time的值不能设置成60,需要遵循逻辑:商户发起请求到请求支付宝的时间点 order_gmt_create记为A,用户成功登录支付宝账号的时间点记为B,“order_valid_time 设置的秒数-(B-A)<1分钟” 就会报错

2)timeout_rule的值,默认只支持12h,其他值需要联系overseas_support@service.alibaba.com进行配置,否则直接请求该参数会报错 "INVALID_PARAMETER"

NEED HELP?

NEED HELP?