Shopify checkout webhook - 如何在shopify checkout webhook响应中获取客户电子邮件ID?

时间:2015-01-20 05:35:51

标签: php json shopify webhooks

我正在尝试在shopify中创建一个使用chekcout webhook的应用程序,一切正常,我希望我无法在webhook的响应中获取电子邮件ID。

$checkout_information   = json_decode(file_get_contents('php://input'));

和json respone就像

{

"buyer_accepts_marketing":false,
"cart_token":"0b1b8b379b7ce41617162522804d8198",
"closed_at":null,
"completed_at":null,
"created_at":"2015-01-19T23:43:33-05:00",
"currency":"PHP",
**"email":"",**
"gateway":null,
"id":426722529,
"landing_site":"/",
"note":null,
"referring_site":"",
"shipping_lines":[
],
"source_identifier":null,
"source_name":"checkout_next",
"source_url":null,
"subtotal_price":"40000.00",
"taxes_included":false,
"token":"7f337c74911a7cfc636a40472820b31a",
"total_discounts":"0.00",
"total_line_items_price":"40000.00",
"total_price":"40000.00",
"total_tax":"0.00",
"total_weight":0,
"updated_at":"2015-01-19T23:43:33-05:00",
"line_items":[
    {
        "applied_discounts":[
        ],
        "compare_at_price":null,
        "fulfillment_service":"manual",
        "gift_card":false,
        "grams":0,
        "line_price":"40000.00",
        "price":"40000.00",
        "product_id":384871021,
        "properties":null,
        "quantity":1,
        "requires_shipping":true,
        "sku":"",
        "tax_lines":[
        ],
        "taxable":true,
        "title":"bike",
        "variant_id":1002599593,
        "variant_title":"",
        "vendor":"yamaha"
    }
],
"name":"#426722529",
"note_attributes":[
],
"source":"checkout_next",
"discount_codes":[
],
"abandoned_checkout_url":"https://checkout.shopify.com/7171333/checkouts/7f337c74911a7cfc636a40472820b31a/recover",
"tax_lines":[
]
}

如何在此回复中获取有效的电子邮件ID

1 个答案:

答案 0 :(得分:0)

这似乎是与订单本身或您正在使用的商店类型(测试商店)相关的问题。在真正的生产商店试试这个。