Shopify Api 与 PHP 合作
Shopify Api working with PHP
我正在使用 Shopify Webhook 来完成订单(在 PHP 中),现在我想要 "Information from the gateway" 的付款详细信息,这些详细信息在 shopify 后台可用,但未显示在 Webhook 详细信息中,因此任何人都可以请为此提供任何解决方案。以下是我想要整理的细节截图。
以下是确认任何新订单时我想要的详细信息:
1) 授权密钥
2) 信用卡上的姓名
3) 到期月份
4) 过期年份
details which i want to get in order
对于此信息,您需要使用以下 shopify 方法
GET /admin/orders/#{id}/transactions.json
您得到以下回复:
HTTP/1.1 200 OK
{
"transactions": [
{
"id": 179259969,
"order_id": 450789469,
"amount": "209.00",
"kind": "refund",
"gateway": "bogus",
"status": "success",
"message": null,
"created_at": "2005-08-05T12:59:12-04:00",
"test": false,
"authorization": "authorization-key",
"currency": "USD",
"location_id": null,
"user_id": null,
"parent_id": null,
"device_id": null,
"receipt": {},
"error_code": null,
"source_name": "web"
},
{
"id": 389404469,
"order_id": 450789469,
"amount": "409.94",
"kind": "authorization",
"gateway": "bogus",
"status": "success",
"message": null,
"created_at": "2005-08-01T11:57:11-04:00",
"test": false,
"authorization": "authorization-key",
"currency": "USD",
"location_id": null,
"user_id": null,
"parent_id": null,
"device_id": null,
"receipt": {
"testcase": true,
"authorization": "123456"
},
"error_code": null,
"source_name": "web",
"payment_details": {
"credit_card_bin": null,
"avs_result_code": null,
"cvv_result_code": null,
"credit_card_number": "•••• •••• •••• 4242",
"credit_card_company": "Visa"
}
},
{
"id": 801038806,
"order_id": 450789469,
"amount": "250.94",
"kind": "capture",
"gateway": "bogus",
"status": "success",
"message": null,
"created_at": "2005-08-05T10:22:51-04:00",
"test": false,
"authorization": "authorization-key",
"currency": "USD",
"location_id": null,
"user_id": null,
"parent_id": null,
"device_id": null,
"receipt": {},
"error_code": null,
"source_name": "web"
}
]
}
想了解更多详情请参考下面link:
https://help.shopify.com/api/reference/transaction
我正在使用 Shopify Webhook 来完成订单(在 PHP 中),现在我想要 "Information from the gateway" 的付款详细信息,这些详细信息在 shopify 后台可用,但未显示在 Webhook 详细信息中,因此任何人都可以请为此提供任何解决方案。以下是我想要整理的细节截图。
以下是确认任何新订单时我想要的详细信息:
1) 授权密钥
2) 信用卡上的姓名
3) 到期月份
4) 过期年份
details which i want to get in order
对于此信息,您需要使用以下 shopify 方法
GET /admin/orders/#{id}/transactions.json
您得到以下回复:
HTTP/1.1 200 OK
{
"transactions": [
{
"id": 179259969,
"order_id": 450789469,
"amount": "209.00",
"kind": "refund",
"gateway": "bogus",
"status": "success",
"message": null,
"created_at": "2005-08-05T12:59:12-04:00",
"test": false,
"authorization": "authorization-key",
"currency": "USD",
"location_id": null,
"user_id": null,
"parent_id": null,
"device_id": null,
"receipt": {},
"error_code": null,
"source_name": "web"
},
{
"id": 389404469,
"order_id": 450789469,
"amount": "409.94",
"kind": "authorization",
"gateway": "bogus",
"status": "success",
"message": null,
"created_at": "2005-08-01T11:57:11-04:00",
"test": false,
"authorization": "authorization-key",
"currency": "USD",
"location_id": null,
"user_id": null,
"parent_id": null,
"device_id": null,
"receipt": {
"testcase": true,
"authorization": "123456"
},
"error_code": null,
"source_name": "web",
"payment_details": {
"credit_card_bin": null,
"avs_result_code": null,
"cvv_result_code": null,
"credit_card_number": "•••• •••• •••• 4242",
"credit_card_company": "Visa"
}
},
{
"id": 801038806,
"order_id": 450789469,
"amount": "250.94",
"kind": "capture",
"gateway": "bogus",
"status": "success",
"message": null,
"created_at": "2005-08-05T10:22:51-04:00",
"test": false,
"authorization": "authorization-key",
"currency": "USD",
"location_id": null,
"user_id": null,
"parent_id": null,
"device_id": null,
"receipt": {},
"error_code": null,
"source_name": "web"
}
]
}
想了解更多详情请参考下面link:
https://help.shopify.com/api/reference/transaction