Send donations to external PayPal account php - php

My ideal process for this would be...
1) User selects a charity from a list
2) User selects amount to donate
3) pop-up, iframe or new window opens and takes them through paypal preocess
4) user is returned to my site with a callback.
My problem is I don't have access to the paypal acounts as they're charitys, Is this possible?

Yes, you can do this no problem. I actually just tested this in the sandbox yesterday.
You can use the Express Checkout API to process the payments, and set the SELLERPAYPALACCOUNTID to the email address of the charity account you want the money to go to.
Take a look at my PHP class library for PayPal, which will make the EC calls very simple for you. Specifically, you'll be working with SetExpressCheckout, GetExpressCheckoutDetails, and DoExpressCheckoutPayment.
The documentation says SELLERPAYPALACCOUNTID is used with Parallel payments, but it seems to work just fine with a single payment/receiver from the tests I can.

Related

PayPal API Pay Email Address Directly?

One of the features on my site allows users to pay via PayPal for items from other users. I'm using the standard REST API since I had already made the code for another project a while ago, which works fine.
https://developer.paypal.com/docs/api/#create-a-payment
Currently, the page sends a 'v1/payments/payment' request which I execute to receive the money in to my PayPal account which created the access token. Is there a way I can directly get the user to pay another PayPal email address?
If not, I guess the only way is to do another request to pay the owner of the content from my PayPal once I receive the money - although it means PayPal get to charge a fee twice.
Thanks.

Creating paypal checkout service for client

I want to create a paypal checkout enabled website for my client.
I tried searching for this but no luck ..
my actual plan is:
any visitor in the website asking for service service should be able to pay via paypal and the money should go to my client paypal account ..
I would recommend using the Express Checkout API for this. You can use the SELLERPAYPALACCOUNTID parameter to pass in a 3rd party PayPal account ID or email address and the money will go directly to that account without the need to mess with Permissions.
If you happen to be working with PHP I'd recommend taking a look at my class library for PayPal. It will make the Express Checkout Calls (SetExpressCheckout, GetExpressCheckoutDetails, and DoExpressCheckoutPayment) very quick and easy for you.

Paypal IPN needed?

I'm doing a project involving Paypal, more specifically with the NVP API in PHP. But I just can't seem to figure what to use the IPN feature for.
I mean, when the user has been redirected to Paypal to confirm the purchase, he is redirected back to my website's "Paypal-succes-page", when the transaction is complete. And just to be sure that he actually payed i could use the "PaymentDetails" operation.
Now where does IPN fit in this process? and what is the benefit of it?
Thanks
The integrate with PayPal's services you will notice there are three main channels (and IMO it's important to know this so you can decide the benefits for your application):
IPN: Instant Payment Notification
PDT: Payment Data Transfer
PayPal's API
To use PayPal's IPN you need to add a 'listener' script (example) and add the address to your PayPal account. Whenever an event occurs PayPal will send a message directly to your server via your listener and you then update your accounts appropriately. This is especially useful for running subscription services as events will occur in the background without user intervention and you can capture successful/failed recurring payments etc.
PayPal's PDT is a system for accepting data when a user is redirected back to your site from PayPal. For example, a user clicks 'Buy', they are directed to PayPal, enter information etc. Then, once the payment has been taken, they are redirected back to your site. PayPal can pass details about the transaction including whether it was successful or not so you can display the appropriate success/failed page from your site.
PayPal's API allows you to integrate more deeply with PayPal's services, and you would use this if you were managing payments directly from your site.
These services aren't mutually exclusive, so you can use any combination with your application.
I hope this helps
The IPN feature is a very useful feature which you should use to update your database in my opinion. Sure the user is redirected to your success-page after the purchase where you can validate the payment details.
But what if he closes (by accident or not) the browser before reaching your success page? You will never know the result of the transaction and you will never update your database or process his order accordingly.
When using the IPN you can be sure that the transaction result will always reach you because PayPal will keep on making an offline request to your IPN page until it has reached your servers.
Instant Payment Notification
The typical usage of the IPN is to validate the purchase and to let your script or management system know that the transaction is complete so your system can update any records you may have for your service.
But the most important part is that the transaction is validated.
IPN send all data about transaction to your server - price, items, contacts ... so you can check, if someone don't pay you only 1$ instead of 100$ and confirm your order. It prevets thiefs, cheaters, ... USE IT! ;)

Which payment method do I need to use for PHP PayPal API?

I need to setup a payment method on my website that allows a certain user to pay another via two email address'. So essentially, user1 comes to a page, downloads an invoice and has the option to pay that invoice using a link which redirects to paypal with the prefilled details i.e. payeremail, receiveremail, amt, currencycode. Does anyone know which API call I need to make to do this? All I can really see in the API is for other users to pay my account which I already have setup for another function. Thanks in advance.
You need PayPal IPN, after the payment goes through you will receive following information https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_IPNandPDTVariables
Here is PHP handler for the IPN, http://www.boolcast.com/development/joomla-custom-paypal-ipn
You can also look at other sample code example on PayPal site.

how can i use Paypal for premium section of my site and deal with premium vs normal users?

I want to achieve something like this
http://depositfiles.com/en/gold/payment.php
I have normal users signed up. I want them to upgrade to premium user. Once a person pays, how do I know which user he was signed in ? How do i force the user to login first before being able to click the paypal button and make payment ? Otherwise, I would receive money, but wouldn't know which user to mark as "PAID" in my database.
when you click on the paypal button, it redirects you to the paypal page where you can login and pay.
I also want to accept Visa and Mastercards, is it doable through paypal using the same method ?
Paypal's information can be found here:
Part 1
You can create a subscribe button for each type of subscription you want and use the HTML variables in Part 2 to enable you to know what type of product and what user is included in the invoice.
This needs a lot more details than you currently provide. What language have you written your website in? Static HTML? Ruby? PHP? How does PayPal's payment system work?
normally the way it will work is that your site will pass information to paypal (http://paypal.sourceforge.net/ is one toolkit that seems to be made for php, thought I've never used it so I can't really promise its not abandonware).
once the paypal transaction is completed successfully, control is passed back to your site. you can then set the user's flag in your database as a premium user.
as far as I can tell, you tell paypal to handle payments for you, and the user picks a funding source in paypal. if you want to have visa/mastercard separately handled from paypal you'll need another payment gateway to handle it, like mirapay or something else.

Categories