PHP-在数组中设置一个数组,然后在json(IPN文件)中获取该数组的值

PHP-在数组中设置一个数组,然后在json(IPN文件)中获取该数组的值,php,arrays,json,paypal-ipn,Php,Arrays,Json,Paypal Ipn,这是我为Selly提供的IPN代码 Selly在其webhook上的回复显示: {27 items "id":"9657d3ae-aad3-449f-9b5a-1accd9919698" "product_id":"upgrade" "email":"benzahdd55@outlook.com" "ip_address":"127.0.0.1" "country_code":"US" "product_title":"Selly Pro 1 Month" "user_agent":"Mozil

这是我为Selly提供的IPN代码

Selly在其webhook上的回复显示:

{27 items
"id":"9657d3ae-aad3-449f-9b5a-1accd9919698"
"product_id":"upgrade"
"email":"benzahdd55@outlook.com"
"ip_address":"127.0.0.1"
"country_code":"US"
"product_title":"Selly Pro 1 Month"
"user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWeb..."
"value":"1.0"
"quantity":1
"currency":"USD"
"gateway":"PayPal"
"risk_level":0
"status":100
"delivered":NULL
"crypto_value":NULL
"crypto_address":NULL
"crypto_channel":NULL
"crypto_received":0
"crypto_confirmations":0
"referral":NULL
"usd_value":"1.0"
"exchange_rate":"1.0"
"coupon_id":NULL
"custom":{}0 items
"created_at":"2019-12-05T13:25:39.000+00:00"
"updated_at":"2019-12-05T13:25:39.000+00:00"
"webhook_type":1
}
如您所见,它显示了
“custom”:{}0项

在shop页面中,我设置如下数据:

                                        $custom_array = array(
                                            'custom_id' => $product_id
                                        );

                                        $data = array(
                                            "title" => $productName,
                                            "gateway" => "PayPal",
                                            "email" => $clientEmail,
                                            "value" => $after_coupon_value,
                                            "currency" => "USD",
                                            "custom" => $custom_array,
                                          'return_url' => 'https://acchub.org/shop?product='.$productName,
                                          'webhook_url' => 'https://acchub.org/sellywh?secret='.$secret
                                        );                                          
                                        $data_curl = json_encode($data);
在我的IPN页面中,我这样做是为了获得自定义字段:

                    $data = json_decode($webhookContent);
                    $productName = $data->product_title;
                    $orderId = $data->id;
                    $amount = $data->value;
                    $email = $data->email;
                    $status = $data->status;
                    $gateway = $data->gateway;
                    parse_str($data->custom, $_CUSTOM);
                    $custom_id = $CUSTOM['custom_id'];

                    mail('admin@site.com', 'worked fine', $custom_id);
上述代码适用于其他参数,如网关、状态、电子邮件等。 但是我收到的电子邮件中的$custom_id字段是空的。
询问更多代码的问题,但这是主要概念,因此Selly目前不支持API中的自定义输入

他们让我分配它,就像我在商店(头版)上分配秘密一样


所以它应该是
example.com/ipn?secret=blabla&custom=51

缺少下划线
\uu
<代码>$\u自定义在
parse\u str($data->CUSTOM,$\u CUSTOM)中
$CUSTOM
中的
$CUSTOM\u id=$CUSTOM['CUSTOM\u id']相比