Tôi đang sử dụng thư viện http://www.binpress.com/app/paypal-adaptive-payments-pro-codeigniter-library/140 này và tôi đang sử dụng thư viện này làm trình nghe IPn cho dự án viết mã - http://pastebin.com/pMb7Zhz3.Số phát hành IPN Paypal với thanh toán song song
Về cơ bản tôi đang thực hiện giao dịch song song bằng thư viện paypal ở trên để khi người dùng thực hiện thanh toán/tặng, nó sẽ gửi tiền tới 2 tài khoản khác nhau. Sau khi giao dịch hoàn tất, paypal gửi dữ liệu đến người nghe ipn của tôi và nó phân tích thông tin cho 1 khách hàng tốt nếu tôi để lại mã này 'IPNNotificationURL' => ''
trong mã của tôi và đi vào paypal và đặt url ipn.
Tôi đang cố gắng lấy thông tin IPN cho cả hai tài khoản, mà không cần phải có cả hai tài khoản đặt url ipn trong cài đặt paypal của họ. Khi tôi đặt 'IPNNotificationURL' => 'http://example.com/paypal_ipn'
, tôi vẫn nhận được thông tin ipn cho 1 tài khoản, nhưng tôi nhận được cảnh báo này Array to string conversion on line 11
của người nghe của tôi. Làm thế nào tôi có thể sửa lỗi này và nếu tôi làm, tôi sẽ nhận được thông tin ipn từ cả hai tài khoản?
Dưới đây là các phương pháp thanh toán từ thư viện trên mà tôi đang sử dụng cho các khoản thanh toán song song
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);
}
}
và dòng 11 là này từ pastebin trên - $value = urlencode(stripslashes($value));
Bạn có thể cung cấp dòng đó và các phần có liên quan khác của mã không? – Josh
Tôi hy vọng điều này sẽ giúp: http://stackoverflow.com/questions/8456218/paypal-parallel-payment-ipn – Josh
Tôi đã xem bài đăng đó một vài lần. Tôi vẫn còn gặp rắc rối. – Catfish