【发布时间】:2018-05-23 19:14:34
【问题描述】:
我是在 PHP 中使用 JSON 的新手。我想帮助一位朋友使用 PHP 开发的软件。有支付集成,interswitch 需要 URL,他们可以在每次成功支付时发布 JSON 参数,以帮助他跟踪支付活动。参数如下
PaymentLogId String
CustReference String
Amount Numeric
PaymentReference String
IsReversal Boolean
PaymentDate DateTime
BankName String
CustomerName String
ItemName String
CustomerAddress String
支付网关坚持他应该编写可以捕获上述JSON参数并更新他的数据库的代码。
我有:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://');
$result = curl_exec($ch);
curl_close($ch);
$obj = json_decode($result);
echo $obj->firstname;
?>
但似乎应该有地址来获取信息,他们拒绝提供任何地址。
【问题讨论】:
标签: javascript php arrays json