使用支付 api 获取 razorpay 上的所有支付细节

时间:2021-05-10 09:00:46

标签: php 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) }}

我无法访问此数组响应中的各个下标。

你能帮忙吗。

0 个答案:

没有答案