我正在使用这http://www.binpress.com/app/paypal-adaptive-payments-pro-codeigniter-library/140库,我用这个作为我的ipn监听器代码项目 - http://pastebin.com/pMb7Zhz3。PayPal并行支付IPN问题
基本上我正在做一个并行交易使用上面的贝宝图书馆,以便当用户进行支付/捐赠时,它将钱发送到2个不同的帐户。一旦交易完成,贝宝发送数据到我的ipn监听器,它解析1个客户的信息就好了,如果我离开这个'IPNNotificationURL' => ''
在我的代码,并进入贝宝,并设置IPN网址。
我试图让这两个帐户的IPN信息,而不必让两个帐户在其paypal设置中设置ipn网址。当我设置'IPNNotificationURL' => 'http://example.com/paypal_ipn'
时,我仍然可以获得1帐户的ipn信息,但是我收到了听众的警告Array to string conversion on line 11
。我怎样才能解决这个问题,如果我这样做,我会从这两个账户获得ipn信息吗?
下面是从图书馆的薪酬方法上面,我使用了并行支付
function Pay()
{
// Prepare request arrays
$PayRequestFields = array(
'ActionType' => 'PAY', // Required. Whether the request pays the receiver or whether the request is set up to create a payment request, but not fulfill the payment until the ExecutePayment is called. Values are: PAY, CREATE, PAY_PRIMARY
'CancelURL' => '', // Required. The URL to which the sender's browser is redirected if the sender cancels the approval for the payment after logging in to paypal.com. 1024 char max.
'CurrencyCode' => 'USD', // Required. 3 character currency code.
'FeesPayer' => 'SENDER', // The payer of the fees. Values are: SENDER, PRIMARYRECEIVER, EACHRECEIVER, SECONDARYONLY
'IPNNotificationURL' => '', // The URL to which you want all IPN messages for this payment to be sent. 1024 char max.
'Memo' => '', // A note associated with the payment (text, not HTML). 1000 char max
'Pin' => '', // The sener's personal id number, which was specified when the sender signed up for the preapproval
'PreapprovalKey' => '', // The key associated with a preapproval for this payment. The preapproval is required if this is a preapproved payment.
'ReturnURL' => '', // Required. The URL to which the sener's browser is redirected after approvaing a payment on paypal.com. 1024 char max.
'ReverseAllParallelPaymentsOnError' => '', // Whether to reverse paralel payments if an error occurs with a payment. Values are: TRUE, FALSE
'SenderEmail' => '', // Sender's email address. 127 char max.
'TrackingID' => '' // Unique ID that you specify to track the payment. 127 char max.
);
$ClientDetailsFields = array(
'CustomerID' => '', // Your ID for the sender 127 char max.
'CustomerType' => '', // Your ID of the type of customer. 127 char max.
'GeoLocation' => '', // Sender's geographic location
'Model' => '', // A sub-identification of the application. 127 char max.
'PartnerName' => '' // Your organization's name or ID
);
$FundingTypes = array('ECHECK', 'BALANCE', 'CREDITCARD');
$Receivers = array();
$Receiver = array(
'Amount' => '', // Required. Amount to be paid to the receiver.
'Email' => '', // Receiver's email address. 127 char max.
'InvoiceID' => '', // The invoice number for the payment. 127 char max.
'PaymentType' => '', // Transaction type. Values are: GOODS, SERVICE, PERSONAL, CASHADVANCE, DIGITALGOODS
'PaymentSubType' => '', // The transaction subtype for the payment.
'Phone' => array('CountryCode' => '', 'PhoneNumber' => '', 'Extension' => ''), // Receiver's phone number. Numbers only.
'Primary' => '' // Whether this receiver is the primary receiver. Values are: TRUE, FALSE
);
array_push($Receivers,$Receiver);
$SenderIdentifierFields = array(
'UseCredentials' => '' // If TRUE, use credentials to identify the sender. Default is false.
);
$AccountIdentifierFields = array(
'Email' => '', // Sender's email address. 127 char max.
'Phone' => array('CountryCode' => '', 'PhoneNumber' => '', 'Extension' => '') // Sender's phone number. Numbers only.
);
$PayPalRequestData = array(
'PayRequestFields' => $PayRequestFields,
'ClientDetailsFields' => $ClientDetailsFields,
'FundingTypes' => $FundingTypes,
'Receivers' => $Receivers,
'SenderIdentifierFields' => $SenderIdentifierFields,
'AccountIdentifierFields' => $AccountIdentifierFields
);
$PayPalResult = $this->paypal_adaptive->Pay($PayPalRequestData);
if(!$this->paypal_adaptive->APICallSuccessful($PayPalResult['Ack']))
{
$errors = array('Errors'=>$PayPalResult['Errors']);
$this->load->view('paypal_error',$errors);
}
else
{
$data['result'] = $PayPalResult;
$this->load->view('success', $data);
}
}
和第11行是这样的,从上面的引擎收录 - $value = urlencode(stripslashes($value));
你能提供代码的那一行和其他相关部分吗? – Josh 2012-01-28 21:17:04
我希望这可以帮助:http://stackoverflow.com/questions/8456218/paypal-parallel-payment-ipn – Josh 2012-01-30 02:57:06
我也看过那篇文章。我仍然有麻烦。 – Catfish 2012-01-30 20:43:29