php - 使用支付 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]=>
object(Razorpay\Api\Payment)#24 (1) {
["attributes":protected]=>
array(29) {
["id"]=>
string(18) "pay_xxxxxxxxxx"
["entity"]=>
string(7) "payment"
["amount"]=>
int(1000)
["currency"]=>
string(3) "INR"
["status"]=>
string(8) "captured "
["order_id"]=>
string(20) "order_xxxxxxxx"
["invoice_id"]=>
NULL
["international"]=>
bool(false)
["method"]=>
string(4) "card"
["amount_refunded"]=>
int(0)
["refund_status"]=>
NULL
["captured"]=>
bool(true)
["description"]=>
NULL
["card_id"]=>
string(19) "card_xxxxxxxxxx"
["bank"]=>
NULL
["wallet"]=>
NULL
["vpa"]=>
NULL
["email"]=>
string(22) "xxx@xxx.com "
["contact"]=>
字符串(13) "+xxxxxxxxx"
["notes"]=>
对象(Razorpay\Api\Payment)#25 (1) {
["attributes":protected]=>
array(4) {
["title"]=>
string(2) "xx"
["institution_or_individual_name"]=>
string(12) "xxxxxxx"
["phone"]=>
string(10) "xxxxxxxxx"
["email"]=>
string(22) "xxxx@xxx.com"
}
}
["fee"]=>
int(20)
["tax"]=>
int(0)
["error_code"]=>
NULL
["error_description"]=>
NULL
["error_source"]=>
NULL
["error_step"]=>
NULL
["error_reason"]=>
NULL
["acquirer_data"]=>
对象(Razorpay\Api\Payment)#26 ( 1){
["attributes":protected]=>
数组(1){
["auth_code"]=>
字符串(6)“xxxxx”
}
}
["created_at"]=>
int(1599750807)
}
}
我无法访问此数组响应中的各个下标。
你能帮我吗。
解决方案
推荐阅读
- kubernetes-helm - helm get 获取发布图表的语法
- javascript - 将 props 传递给 Children of Children(嵌套组件树)
- python - 来自时间戳和国家/地区的 pyspark 时区转换
- microsoft-graph-api - 如何获取特定时间段内收件箱文件夹(包括子文件夹)中的邮件计数
- javascript - nuxt 中 Vuetify 的 DatePicker 的语言环境错误
- jquery - 带有多个关键字的 jQuery 过滤器 + 引导程序
- r - 使用列名称为列内容添加前缀/后缀
- amazon-web-services - DynamoDB - AWS CLI - batch-write-item 只插入一行
- java - 如何在 AndroidStudio 中使用 EasyImage 将矩形叠加层添加到相机屏幕
- dart - FutureBuilder 没有建设