2017-07-12 27 views

回答

0

您可以將自定義變量的方式如下:

option_name1 = 「MyVariableName」 option_selection1 = 「你想要的任何值」

option_name2 = 「MyVariableName2」 option_selection2 = 「無論價值你想2」

被警告,因爲今天 PayPal將_1添加到返回的IPN參數鍵。 所以IPN響應將是這樣的:option_name1_1 =「MyVariableName」和option_selection1_1 我只是有這個非常的問題,必須解決EM這樣的:

$pattern =[ 
     "/^(option_(?:name|selection)\d)_\d$/", 
     "/^(item_name)\d$/", 
     "/^(item_number)\d$/", 
    ]; 
foreach ($ipn_post_data as $key=>$value){ 
    $ipn_post_data[preg_replace($pattern, "\\1", $key, -1)] = $value; 
} 

在這裏閱讀更多:https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/#id091EAB0105Z