Tarka
Tarka

Reputation: 4033

What PayPal method should I use for dynamic receivers?

I'll admit, aside from using it to buy stuff, I'm very inexperienced with using PayPal for anything. However, the project I'm working on needs a means of payment, and it appears to be the best way for us to do it.

However, seeing PayPal IPN, Express, Adaptive Payment, etc. it's getting a bit confusing as to which to use.

The desired process:

  1. User selects what they need to pay a deposit on, and how much
  2. User clicks a SEND PAYMENT button
  3. User logs in to PayPal and submits their payment
  4. User is returned to our site

One caveat is that the payment will be sent to one of several accounts. Several clients will be using this system to process new tenants, and would want to get the payment into their own account.

What PayPal method would be the best for use in this situation? What documentation is there for it?

Upvotes: 0

Views: 248

Answers (2)

Robert
Robert

Reputation: 19356

IPN is an additional feature that you can use to track your transactions by means of a POST with transaction data being sent to you by the PayPal side, however, it's not a PayPal payment solution in itself. More information is over at https://www.paypal.com/ipn/

What you want is fairly easy to accomplish, just swap out the value for 'business' in any Website Payments Standard HTML button. E.g.

<?php
// Var, or a row from a db result
$business-receiver = "[email protected]";
$amt=1;
$name= "Test Holidays";
?>

<form method="post" action="https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="business" value="<?=$business-receiver;?>">
<input type="hidden" name="amount" value="<?=$amt;?>">
<input type="hidden" name="item_name" value="Rental agreement for <?=$name;?>">
<input type="submit" name="submit" value="Go to PayPal">

Note: If you want to use IPN in combination with the above, simply add 'notify_url' to your button. You don't have to set it up in your account, which means you can dynamically alter this as well.

Upvotes: 1

BradBrening
BradBrening

Reputation: 5518

I may be biased, but I would go with IPN because that's what I'm used to.

Since the payment would be made to different accounts, each account would have to specify the IPN location in their settings, all pointing to a script that you've specified. PayPal supports the concept of "pass-through variables" using the "custom" parameter, which you can assign any value you like. I would imagine that you could populate the "custom" parameter with an Account ID variable (i.e. &custom=1234), which you could then examine in the callback to take the appropriate action.

https://www.paypal.com/ipn

Upvotes: 0

Related Questions