2015-12-29 70 views

回答

2

當您發佈數據,貝寶與回調URL指定這個領域

<input type="text" name="notify_url" value="http://paypal.mysite.com" /> 

當用戶支付,貝寶做POST到這個網址與交易信息 一些信息是

public string payer_email { get; set; } 
public string payer_firstname { get; set; } 
public string payer_lastname { get; set; } 
public string payer_address { get; set; } 
public string payer_city { get; set; } 
public string payer_country { get; set; } 
public string payment_status { get; set; } 
public string pending_reason { get; set; } 
public string payment_date { get; set; } 
public double mc_gross { get; set; } 
public double mc_fee { get; set; } 
public string address_country { get; set; } 
public string address_city { get; set; } 
public string first_name { get; set; } 
public string last_name { get; set; } 
public string address_street { get; set; } 
public string verify_sign { get; set; } 

例如,如果你正在使用PHP,你可以這樣做來知道所有返回的值

foreach(array_keys($_POST) as $key) 
{ 
    $value .= $key .": " . $_POST[$key]."<br/>"; 
} 
mysql_query("INSERT INTO test (message, date) VALUES ('$value', NOW()) ");