当我收到JSON通知时如何发送响应

时间:2019-05-02 21:55:16

标签: php json guzzle

我建立了一个用于付款的网站,并使用API​​使用另一个网站,在付款成功后的一部分中,另一个网站将这样的POST发送给我的控制器,比如data_1:

{
    "status": "OK",
    "amount": "1500100.00",
    "payment_type": "30_days",
    "transaction_status": "pending",
    "order_id": "KD125262",
    "message": "Transaction status is pending",
    "shipping_address": {
        "city": "Jakarta Selatan",
        "first_name": "Darana 2",
        "last_name": "Pratama",
        "countrycode": "IDN",
        "creation_date": "2017-08-04T18:28:14",
        "phone": "0217248724",
        "state": "",
        "transaction": 1505866,
        "postcode": "12120",
        "location_details": "Jl. Kerinci IX No. 5-A"
    },
    "transaction_time": 1501846094,
    "transaction_id": "fadee4e5-99a2-48d6-952d-007f3fa508e8",
    "signature_key": "o5KZPDcxgEA9QutAVcIQwE3suQRkTEIA1VXcoHp7KaWJnpHx0uuHETBVpxfYLbaPyS8RJg34uVxTUX64cfUTzVVhCrSif%2FUg92J2WyLs%2FhQ%3D"
}

但是我必须发送一个带有JSON数据的响应,以确认另一个网站以确保我已接收到该数据,我必须像这样发送响应

{
     "status":"OK",
     "message":"Message from merchant if any"
}

问题是当我收到data_1时如何直接发送响应?

我在Codeigniter中使用口齿不清的api

0 个答案:

没有答案