Which api calls to make to enable a specific type of payment on Paypal

I have integrated a php-based application with paypal.
I have the following functions enabled:

- Do Direct Payment
- Set Express Checkout
- Create Recurring Payments Profile
- Manage Recurring Payments Profile Status

This means I have figured out four things:
- Take a payment
- setup automatic payments
- receive status of automatic payments
- cancel account.

I have one task left: pay for something adhoc.  Unlike "Do Direct Payments", I do not want to take credit cards each time.  Here's the scenerio:

I have two users.  User A wants to connect to User B.  Think like facebook "friending".  If User A clicks "connect", a warning appears that says this:

"to connect with this individual will cost you 3 dollars now, and 1 dollar if they accept, do you agree?"

If they say yes, I take 3 dollars from them.  Later on, User B agrees, and I take another dollar from User A.

what are the paypal procedures to allow for this?  I have been talked to about "reference transactions", but it appears like the payment can only happen once.  Do I authorize a reference transaction every time user A wants to connect?

What calls do I make to enable this?  
Evan CutlerVolunteer Chief Information OfficerAsked:
Who is Participating?
Andrew AngellConnect With a Mentor Co-Owner / DeveloperCommented:
Reference transactions would technically work, but PayPal released the Adaptive Payments API to sort of replace that need.

For this what I would recommend is setting up Preapproval Profiles for your users. This allow you to submit payments (or take money) on their behalf at any time without further approval so long as the payment falls in the profile terms, which can be configured with the API request, and you can setup options for your users accordingly.  

You'll use the Preapproval API to create the profiles for people, and then you'll use the Pay API to submit payments using that preapproval key.

If you're working with PHP you might want to check out my class library for PayPal.  It makes all of this very easy for you.

If you're working with low dollar amounts like that you'll want to make sure and get setup with a Digital Goods account, too, so that you can get the micropayment rates and save money on fees.
Ray PaseurConnect With a Mentor Commented:
I don't think you can cause PayPal to just "take money" without a deliberate client action. Think about what that could mean for anyone with a PayPal account.  There might be some way to send User A a message when User B accepts, then User A can make an additional payment.  Or you might be able to fudge something in the recurring payments or subscription process.  But this sounds like a very unusual business arrangement, and I'd be surprised if PayPal had any easy-to-use support for this.
GaryConnect With a Mentor Commented:
You can use reference transactions i.e. unknown amount whenever (kinda like a direct debit) but PayPal has to enable it for you - which means are you turning over hundreds of thousands of dollars+++ and are a well known brand name?
Else as Cd& said it will be individually authorised payments.
I said Cd& - I must have been obsessing over him at the time - I meant Ray
Evan CutlerVolunteer Chief Information OfficerAuthor Commented:
Thanks guys,....this helps alot....I'm negotiating with my client on how to proceed.  Thanks much.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.