Charles
Charles

Reputation: 883

Paypal Integration with PHP

I'm looking to implement a very simple Paypal integration whereby I can enter a valid Paypal Email address (recipient) and a dollar amount, and click "Pay." Ideally, it would send the money from my paypal account automatically via my API key.

I currently have Mass Pay set up with PHP, and it's working fine, except that it charges me 2% on every payment, and doesn't pass back the Transaction ID. It also kinda seems unnecessary since I don't need to pay multiple people at once.

Since I only need to do one transaction at a time, I'm wondering if anyone knows of a simpler Paypal API for single outgoing transactions from my account.

I've been reading the documentation all day and I've yet to find what I'm looking for.

Any advice is greatly appreciated!

Upvotes: 0

Views: 1488

Answers (1)

Ali
Ali

Reputation: 12674

PayPal has sample codes for integrating various PayPal features on it's website. This includes PHP take a look at the list of features and I'm sure what you are looking for is there.

Also from the paypal site:

PayPal receives the MassPay request and returns a response indicating success or failure. If PayPal returns a successful response, then PayPal processes the payments and, if you have Instant Payment Notifications (IPN) enabled, PayPal sends a notification to the Notify URL specified in your account profile. If you do not have IPN enabled, you can view the details of the MassPay transaction in your PayPal account.

This implies that in the case of mass pay you need to provide a URL where paypal sends payment notifications. Your program can probably check this url to figure out whether a payment has been made or not, I would suspect this would be the case for all payment integration. That being said I would print_r the the response from paypal, I'm sure something like a transaction id will probably be in there. In the case of DoAuthorization it does return the transaction id

In the case of mass pay it does return the transaction id if IPN is enabled

Upvotes: 2

Related Questions