0

就我而言:我处理了付款并且付款成功,但不知何故,我的内部 API 在我存储付款详细信息或分类帐的地方失败了。现在我想退款给客户。所以我发现了这个端点“pts/v2/payments/{id}/refunds”,我在查询参数中传递了paymentId,并在正文中传递了订单信息。但回应是

{"submitTimeUtc":"2020-08-18T07:26:18Z","status":"INVALID_REQUEST","reason":"INVALID_DATA","message":"Declined - One or more fields in the request contains invalid data"}

我也从这里尝试过https://developer.cybersource.com/api-reference-assets/index.html#payments_refund 同样的事情。

我还查看了示例 java 代码https://github.com/Cyber ​​Source/cybersource-rest-samples-java/blob/master/src/main/java/samples/Payments/Refund/RefundPayment.java

它做了一些奇怪的事情,它首先创建付款,然后退款。请帮我弄清楚这个 API 的流程和需要做什么。

4

1 回答 1

0

不确定您使用的是什么语言,也没有看到您的代码,但我自己也遇到了同样的问题。我没有使用该SimpleAuthorizationInternet()函数来检索付款的详细信息,而是根据需要传入 ID。

所以,而不是:

SimpleAuthorizationInternet.userCapture = true;
PtsV2PaymentsPost201Response paymentResponse = SimpleAuthorizationInternet.run();
String id = paymentResponse.getId();

...不要调用该函数并删除以下行:

SimpleAuthorizationInternet.userCapture = true;
PtsV2PaymentsPost201Response paymentResponse = SimpleAuthorizationInternet.run();

..如果你有支付ID,直接在函数中使用它:

String id = '123456789321654987'

更好的是,将它传递给函数调用并使用该 var 而不是上面的硬编码字符串。

于 2020-08-25T16:13:52.143 回答