因此,我正在使用PayPal IPN进行商店项目中的支付网关。用户可以创建商店并添加只存储其PayPal电子邮件的Paypal网关。
我该如何侦听该笔付款的退款,以便随后采取行动。请注意,我显然无权访问这些贝宝帐户,因此我无法在其贝宝中设置侦听器。
当我创建付款时,我正在构建查询,然后将其发送到该URL,该查询中的notify_url将在有人对付款产生争议时再次使用。我试图引起争议,但是我的数据库似乎什么都没发生(通知URL的作用)。
任何帮助都会很棒。 这是我正在使用的codeigniter库:
[CODE] 贝宝类{
var $config = Array();
var $production_url = 'https://www.paypal.com/cgi-bin/webscr?';
var $sandbox_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?';
var $item = 1;
/**
* Constructor
*
* @param string
* @return void
*/
public function __construct($props = array())
{
$this->__initialize($props);
log_message('debug', "Paypal Class Initialized");
}
// --------------------------------------------------------------------
/**
* initialize Paypal preferences
*
* @access public
* @param array
* @return bool
*/
function __initialize($props = array())
{
$config["business"] = ''; //Your PayPal account
$config["cmd"] = '_cart'; //Do not modify
$config["production"] = FALSE;
#Custom variable here we send the billing code-->
$config["custom"] = '';
$config["invoice"] = '';
#API Configuration-->
$config["upload"] = '1'; //Do not modify
$config["currency_code"] = 'GBP';
$config["disp_tot"] = 'Y';
#Page Layout -->
$config["cpp_header_image"] = ''; //Image header url [750 pixels wide by 90 pixels high]
$config["cpp_cart_border_color"] = '000'; //The HTML hex code for your principal identifying color
$config["no_note"] = 1; //[0,1] 0 show, 1 hide
#Payment Page Information -->
$config["return"] = ''; //The URL to which PayPal redirects buyers’ browser after they complete their payments.
$config["cancel_return"] = ''; //Specify a URL on your website that displays a “Payment Canceled” page.
$config["notify_url"] = ''; //The URL to which PayPal posts information about the payment
$config["rm"] = '2'; //Leave this to get payment information
$config["lc"] = 'EN'; //Languaje [EN,ES]
#Shipping and Misc Information -->
$config["shipping"] = '';
$config["shipping2"] = '';
$config["handling"] = '';
$config["tax"] = '';
$config["discount_amount_cart"] = ''; //Discount amount [9.99]
$config["discount_rate_cart"] = ''; //Discount percentage [15]
#Customer Information -->
$config["first_name"] = '';
$config["last_name"] = '';
$config["address1"] = '';
$config["address2"] = '';
$config["city"] = '';
$config["state"] = '';
$config["zip"] = '';
$config["email"] = '';
$config["night_phone_a"] = '';
$config["night_phone_b"] = '';
$config["night_phone_c"] = '';
/*
* Convert array elements into class variables
*/
if (count($props) > 0)
{
foreach ($props as $key => $val)
{
$config[$key] = $val;
}
}
$this->config = $config;
}
// --------------------------------------------------------------------
/**
* Perform payment process
*
* @access public
* @param array
* @return void
*/
function pay(){
#Convert the array to url encode variables
$vars = http_build_query($this->config);
if($this->config['production'] == TRUE){
header('LOCATION:'.$this->production_url.$vars);
}else{
header('LOCATION:'.$this->sandbox_url.$vars);
}
}
// --------------------------------------------------------------------
/**
* Add a product to the list
*
* @access public
* @param array
* @return void
*/
function add($item_name = '',$item_amount = NULL,$item_qty = NULL,$item_number = NULL){
$this->config['item_name_'.$this->item] = $item_name;
$this->config['amount_'.$this->item] = $item_amount;
$this->config['quantity_'.$this->item] = $item_qty;
$this->config['item_number_'.$this->item] = $item_number;
$this->item++;
}
} //结束Paypal课程
/ *文件结尾Paypal.php / / 位置:./ application / libraries / Paypal.php * /
[/ CODE]