0
votes

I'm trying to adapt my standard IPN paypal payment to a Chained Payment to split the payment received into multiple receivers.Is it possible to create a Chained Payment by adding some hidden variables to the standard IPN form?

This is the code i have:

$form="<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">\n";    
$form.="<input type=\"hidden\" name=\"business\" value=\"".$this->order_info['account_name']."\"/>\n";
$form.="<input type=\"hidden\" name=\"cmd\" value=\"_xclick\"/>\n";
$form.="<input type=\"hidden\" name=\"amount\" value=\"".number_format($this->order_info['total_net_price'], 2)."\"/>\n";
$form.="<input type=\"hidden\" name=\"item_name\" value=\"".$this->order_info['transaction_name']."\"/>\n";
$form.="<input type=\"hidden\" name=\"item_number\" value=\"".$this->order_info['rooms_name']."\"/>\n";
$form.="<input type=\"hidden\" name=\"quantity\" value=\"1\"/>\n";
$form.="<input type=\"hidden\" name=\"tax\" value=\"".number_format($this->order_info['total_tax'], 2)."\"/>\n";
$form.="<input type=\"hidden\" name=\"shipping\" value=\"0.00\"/>\n";
$form.="<input type=\"hidden\" name=\"currency_code\" value=\"".$this->order_info['transaction_currency']."\"/>\n";
$form.="<input type=\"hidden\" name=\"no_shipping\" value=\"1\"/>\n";
$form.="<input type=\"hidden\" name=\"rm\" value=\"2\"/>\n";
$form.="<input type=\"hidden\" name=\"notify_url\" value=\"http://MY_DINAMIC_NOTIFY_URL\"/>\n";
$form.="<input type=\"hidden\" name=\"return\" value=\"http://MY_URL\"/>\n";
$form.="<input type=\"image\" src=\"https://www.paypal.com/en_US/i/btn/btn_paynow_SM.gif\" name=\"submit\" alt=\"PayPal - The safer, easier way to pay online!\">\n";
$form.="</form>\n";

From the IPN and PDT Variables page of Paypal (IPN and PDT Variables)

transaction[n].receiver
transaction[n].amount
transaction[n].is_primary_receiver

So I'm wondering if i can adapt my form with those values for splitting the payment or if i need to use the Preapproval system like the Paypal examples show.

Any hint would be appreciated.

2

2 Answers

0
votes

You wouldn't be able to adapt your form to use these addtional variables. You would have to use those variables with the actual Adaptive Payments (chained) API call. They wouldn't be able to be used for Website Payments Standard buttons.

0
votes

You can't directly get the response of a chained payment. You must use the IPN (Instant Payment Notification) to get the payment details. Check this www.paypal.com/ipn