Paypal transfer money from one account to another - php

I am aware of this recommendation How to send money to any paypal account but what I've tried so far seems unsatisfiable to me...
I am working on a social networking site on which I want to allow users to pay for services via paypal account. The actual payment should transfer money from a user's paypal account to my paypal account.
Here is what I came up so far. I tried to use adaptive api and PAY option and it works if I use my account and my credentials to send money to some other user. I have biz account and this is known as implicit approval. If some other user wants to pay me in this way he has to have business account and to allow my app to save his credentials like his paypal userid, password and signature which is not good.
Next thing I tried is to use permissions api for that purpose. As far as I understand this should work similar to generating token that allows my app to post on facebook on behalf of user. I've managed to create a signature as specified in the permissions api documentation for the following permissions:
$permissions = array('DIRECT_PAYMENT', 'MASS_PAY', 'TRANSACTION_DETAILS');
And now I don't know how to use this signature to transfer money to my paypal account from the paypal account that granted my app the above mentioned permissions.
Any suggestion on what I am doing wrong or better way to do this?

Um, correct me if I'm wrong here, but what you propose is a fairly regular checkout flow with one buyer and one seller (recipient).
You can use PayPal Express Checkout for this and simply set NOSHIPPING=2, which will turn shipping address collection off.
Alternatively, if you have a US PayPal account, sign up for PayPal Express Checkout for Digital Goods at https://www.paypal.com/digitalgoods and you'll be able to use a fancy JavaScript-based LightBox checkout experience (also referred to as 'inline checkout').
Express Checkout is fairly in that it only requires a minimum of two API calls; SetExpressCheckout and DoExpressCheckoutPayment.
SEND: SetExpressCheckout and supply a RETURNURL, CANCELURL, AMT (amount to be charged) and your API credentials.
RECEIVE: You'll receive a TOKEN back from PayPal. Append this token to the following link: https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-XXXXXX (where EC-XXXXX is your token).
Once the buyer agrees to the payment, he'll be redirected back to your RETURNURL, after which you can either automatically, or after showing a purchase summary, call DoExpressCheckoutPayment. Supply the TOKEN again and include the PayerID (returned in GET appended to RETURNURL, or available by calling GetExpressCheckoutDetails with the TOKEN).
Once DoExpressCheckoutPayment acknowledges with ACK=Success, the funds will have been transferred from the buyerÅ› PayPal account balance and/or card.
Take a look at https://www.x.com/ > Dev Tools as well for further documentation, sample code and their SDK's

Related

Paypal getting option payment through credit card(PHP)

Hi i am getting two options while integrating the paypal with my PHP code
1. Pay via paypal
2. Create a paypal account
Whereas i Need an option Of
Payment through Debit/Credit Card
How can i get that,,
i reffer to thisThis Link But unable to find the paypal profile and more options option, Can anyone help me
The only way to force Guest Checkout (which is what PayPal calls it when somebody uses a credit card from their checkout pages without signing in to a PayPal account) is to use the Express Checkout APIs.
This will allow you to set parameters that provide the Guest Checkout experience in all instances where it's available. Keep in mind that even with this configured correctly, Guest Checkout is simply not available for all buyers in all countries, so you still won't get it for 100% of your customers if you're selling world wide.
Guest Checkout is available in PayPal Standard Payments, too, but it's cookie based, so it's very unreliable. If the browser in use has ever had anybody sign in to a PayPal account then it will assume the current user will be signing in, too, and it will not prominently display the Guest Checkout option. This is what you are able to avoid by using the Express Checkout APIs.
This PayPal PHP SDK will make the Express Checkout calls very quick and easy for you. Specifically, you'll be working with:
SetExpressCheckout
GetExpressCheckoutDetails
DoExpressCheckoutPayment
In your SetExpressCheckout request you'll make sure to include the follow parameters:
SOLUTIONTYPE=Sole
LANDINGPAGE=Billing
USERSELECTEDFUNDINGSOURCE=CreditCard
This will ensure that the user sees the Guest Checkout experience.
Direct processing of Credit Cards is deprecated.
But people can pay without PayPal account - it's called guest payments.
Use the PayPal API and allow the optimal checkout to YES and then customers can pay either through credit card / paypal account.
https://developer.paypal.com/docs/integration/direct/payments/guest-payments/#

Which paypal SDK/API to use to send credit card payments to email address?

Is there anyway to do the following using the Paypal APIs in PHP? I can't seem to find exactly what I need.
We are a merchant - we have several businesses who list their goods on our website.
Customers will need to pay for these goods using a credit/debit card. We don't want to force Paypal use/registration - in fact, we don't really want the customer to interact with Paypal at all.
We'd like to create a payment form where they enter their credit card details - we would then use the API to pay this directly to the business' Paypal account using their email address.
Using the REST API I've been able to do this to an extent - the only problem with this is that it doesn't seem dynamic i.e. I can't set the Payee email address to receive the payment - it's linked to my account via the ClientID and ClientSecret. Obviously this is not what I need - I want to pay into the account of the owner of the goods, not mine.
I've seen 'Guest Payments' mentioned but that seems to require the user being redirected to Paypal - something I'd rather avoid.
Thanks in advance.
I don't think the REST API is quite ready for what you're doing. The Classic API will handle it with no problem, though.
If you don't want any interaction with PayPal at all then you'll need to use Payments Pro, which allows you to tie credit card payments directly into your own forms via HTTP request/response with PayPal (no redirect or iframe).
Each business would need to be signed up with their own Payments Pro account, and then they would Grant API Permissions through their PayPal account profile for your app to make API calls on their behalf. Once they've done that, you just pass their email address or PayPal merchant ID into the SUBJECT parameter of API requests and it will use their account accordingly even though you're still using your own API credentials.
The Permissions API allows you to automate this and tie the grant permissions step directly into your app so business owners can do that quickly and easily from within their profile or during signup with your site. This works with auth tokens, though, as opposed to email addresses and merchant ID's.

A way to verify PayPal Account Status is Verfied using PHP

Basically I want my users to associate PayPal account in their accounts for identify verification purposes. I am developing a marketplace site and wanted to integrate paypal as my identity verification procedure.
Is there a way to verify email address, first name and last name using PHP like using $_GET variables or $_POST variables? If there is can you show me how?
I tried search and I get Adaptive Accounts GetVerifiedStatus API. But that totally new to me, I don't know where and how to start.
Your best bet here is to make them start, but not complete, an Express Checkout. A normal Express Checkout (referencing Classic but REST works the same way) looks like this
SetExpressCheckout - Tell PayPal you want to authorize $1.00 and have them log in and authorize the payment
GetExpressCheckoutDetails - Take the token from step 1 and get their PayPal account details. Included in this is PAYERSTATUS, which will tell you if their PayPal account is verified or not
DoExpressCheckout - You won't do this, but this is where you finish the process and get funds. Since the data you want is in Step 2, just ignore it and the session will expire.
You could implement GetVerifiedStatus API to determine whether the specified Paypal account's status is verified or unverified.
To use that API, you need to submit the application request to Paypal for approval first. Submission portal link here.
Then use the GetVerifiedStatus API call directly, refer to API request fields,link.
Sample SDK download link.

PHP: PayPal Integration

im building a site where 2 user groups exist: sellers and buyers. The buyers buy stuff and should pay to the sellers via PayPal.
So, its not a kind of a web shop where users are paying directly to me ( as a website owner/online shop), BUT TO THE OTHER USERS (sellers). So i need to forward a PayPal transaction from one user on my site (buyer) to the other one (seller).
I read some PayPal API Descriptions, but its assumed there that i want to process the PayPal Payments to my PayPal account, what's not my case.
An idea would be that sellers pay to me, and i then pay to buyers, but that's not what i want to do.
So , what I want is: the buyer should process the PayPal payment directly to the seller's PayPal account, and i should then receive the payment confirmation and inform the seller about it.
Does anyone have an idea, expirience or suggestion with this stuff? Thanks in advance!
You have a lot of options for how you can handle that.
One, you could use the Express Checkout API to build the checkout system, and you'd use the Permissions API (optional) so that users can easily grant your application permissions to make API calls on their behalf. Note that users could also do this manually through their PayPal profile until you get the Permissions part integrated.
To get your payments, you could have your users create a preapproval profile using the Preapproval API. This will allow you to submit payments on their behalf automatically at any time. As such, you could use the preapproval key within Pay calls directly in the checkout flow or within IPN (which is what I would recommend) to submit payments to yourself from the user's account.
Another option is to use a parallel payment within Express Checkout. This would handle splitting the payment for you automatically between the seller and yourself, but the buyer would see that split during checkout.
Another option would be to use the Pay API for the checkout which would allow you to create a chained payment. This is the same as a parallel payment except that it hides the split from the buyer, and you could actually delay the payment to secondary receivers if you need to for any reason.
Hope that helps.
if you have a buy now button or similar, use the sellers' email address as below
<input type="hidden" name="business" value="sellers#email.com">
and it will pay the user with that email address. If that's not their paypal address, it will prompt them to either sign up for paypal to receive or add it to a current account.
Then use PHP mail() or your CMS/Admin system to notify you when the successful payment page has been loaded after a referral back from Paypal.

Paypal integration on website

My need: I want users to click on button and goes to paypal, where they can login or add the credit card details and payment should be get done. In short, I don't want to store credit card info on my website.
I found 'Express Checkout' is a suitable paypal method for the same. Am I right?
Does this method requires return urls on https only or can work with simple urls?
Can anyone help me with tutorial or something for the same?
Thanks for all of your support.
Here is an excellent PHP Class for PayPal IPN I've used countless times, which doesn't require user registration: http://www.micahcarrick.com/php-paypal-ipn-integration-class.html
Incidentally, IPN lets you set a return URL via PayPal, though with that class you can send a return URL to IPN before the user pays.
If you want a tutorial or more help though you'll need to tell us which language you're using.
The easiest and most flexible solution that comes without a monthly fee, and is available globally, is PayPal Express Checkout. Express Checkout does not require a https return/cancel URL.
Here is how it works:
Express Checkout is based on three API calls; SetExpressCheckout, GetExpressCheckoutDetails and DoExpressCheckoutPayment.
SetExpressCheckout sets up the payment and returns a token.
You redirect the buyer to https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=TOKEN-HERE, where TOKEN-HERE is the token you received earlier
After the buyer has agreed to the payment, he is returned back to your site.
You can call GetExpressCheckoutDetails and supply the token as a parameter to get the PAYERID of the buyer.
Call DoExpressCheckoutPayment with the token and PAYERID supplied to finalize the payment
Note: If you want to force the 'card details' screen to be displayed initially, and allow buyers to pay without having a PayPal account, ensure you're setting SOLUTIONTYPE to 'Sole' and LANDINGPAGE to 'Billing' in your SetExpressCheckout API request.
In addition, the 'PayPal Account Optional' setting must be switched to 'On' inside the Payment Receiving Preferences of your PayPal Profile.
You can find additional documentation for Express Checkout at https://www.x.com/community/ppx/documentation#ec as well as the SDK's and sample code at https://www.x.com/community/ppx/sdks#NVP

Categories