我从支付网关 (JSON) 收到以下响应:
{
"response": {
"token": "ch_lfUYEBK14zotCTykezJkfg",
"success": true,
"amount": 400,
"currency": null,
"description": "test charge",
"email": "user@user.com",
"ip_address": "203.192.1.172",
"created_at": "2012-06-20T03:10:49Z",
"status_message": "Success!",
"error_message": null,
"card": {
"token": "card_nytGw7koRg23EEp9NTmz9w",
"display_number": "XXXX-XXXX-XXXX-0000",
"scheme": "master",
"address_line1": "42 Sevenoaks St",
"address_line2": null,
"address_city": "Lathlain",
"address_postcode": "6454",
"address_state": "WA",
"address_country": "Australia"
},
"transfer": null
}
}
我正在尝试success => true
在 if 语句中获取部分,如下所示:
<?php
if($response['success'] == true) {
// continue transaction
}
?>
没有任何运气,所以我正在寻求有关如何实现这一目标的帮助。能够提取其他键值也会很有用。
谢谢