如何解决使用支付 api 获取 razorpay 上的所有支付细节
我正在尝试使用付款 API 从 razorpay 帐户中获取所有付款详细信息。我可以通过提供如下的付款 ID 来为个人付款这样做
<?php
include "razorpay-php\Razorpay.php";
use Razorpay\Api\Api;
$api = new Api('rzp_live_xxxxxxxxxxxxx','xxxxxxxxxxxxxxxxxx');
$payment = $api->payment->fetch('pay_xxxxxxxxxxxxx');
echo $payment->amount;
echo $payment->currency;
?>
但是当我做一个
<?php
$payments = $api->payment->all();
?>
我收到这样的回复
[6]=>
对象(Razorpay\Api\Payment)#24 (1) {
["attributes":protected]=>
数组(29){
["id"]=>
string(18) "pay_xxxxxxxxxx"
["entity"]=>
字符串(7)“付款”
["amount"]=>
int(1000)
["currency"]=>
字符串(3)“INR”
["status"]=>
字符串(8)“捕获”
["order_id"]=>
string(20) "order_xxxxxxxx"
["invoice_id"]=>
空
["international"]=>
布尔(假)
["method"]=>
字符串(4)“卡片”
["amount_refunded"]=>
整数(0)
["refund_status"]=>
空
["captured"]=>
布尔(真)
["description"]=>
空
["card_id"]=>
字符串(19)“card_xxxxxxxxxx”
["bank"]=>
空
["wallet"]=>
空
["vpa"]=>
空
["email"]=>
string(22) "xxx@xxx.com"
["contact"]=>
字符串(13)“+xxxxxxxxx”
["notes"]=>
对象(Razorpay\Api\Payment)#25 (1) {
["attributes":protected]=>
数组(4){
["title"]=>
字符串(2)“xx”
["institution_or_individual_name"]=>
字符串(12)“xxxxxxx”
["phone"]=>
字符串(10)“xxxxxxxxxx”
["email"]=>
字符串(22)“xxxx@xxx.com”
}
}
["fee"]=>
int(20)
["tax"]=>
整数(0)
["error_code"]=>
空
["error_description"]=>
空
["error_source"]=>
空
["error_step"]=>
空
["error_reason"]=>
空
["acquirer_data"]=>
对象(Razorpay\Api\Payment)#26 (1) {
["attributes":protected]=>
数组(1){
["auth_code"]=>
字符串(6)“xxxxx”
}
}
["created_at"]=>
int(1599750807)
}
}
我无法访问此数组响应中的各个下标。
你能帮忙吗。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。