I'm working on a website where a user can pay for products to another user, the user that is getting paid has his API Signature set and the payment is accomplished using ExpressCheckout (NVP) (the payer just gets redirected to a PayPal page where he logs in if necessary and just clicks a button to pay).
The problem is I tried using webhooks to track refunds for these payments, so I can later insert the refund data into my database via callback URL (php function), but the URL I've set doesn't get called at all(I've previously simulated an event on the same URL and everything was fine).
I am trying to get this to work by setting my API Signature and a friend of mine paying me some cents(via DoExpressCheckoutPayment) after which I refund them to him (no calls, only using the PayPal website).
Also nothing appears on the Sandbox Webhooks Events page or the Live one. I've tried registering other events like "Payment capture completed" or "Payment sale completed" to my webhook but with the same result.
Do I have to change some settings in my account? I've created a REST API app in order to use webhooks, but I've seen there's an option for NVP/SOAP API apps. I have considered IPN if webhooks don't work.
"Webhooks" are used with the REST API. Express Checkout uses IPN.
You'll need to setup a separate listener for IPN similar to what you've done with webhooks on the REST API.
Related
I am building the system to listen to the Payment changes in PayPal for that I research and recommended using Webhooks over the IPN.
As of now, I can able to create an app and add webhooks with event subscribers. Also, with the webhook simulator I am getting notified correctly but with the actual Payment made in the sandbox does not trigger anything to the listener.
I have verified the correct business account linked with credentials as well.
Everything is working perfectly except the Webhooks triggering from PayPal.
Also, as noting is triggering I do not have debug id as well.
If you have not registered any webhook listeners for any of your REST Apps (either sandbox or live), PayPal will not send any webhooks because it does not know which ones to send events for, or where to send them.
To register webhooks for an app, either:
Find the app for the correct sandbox account in My Apps and Credentials (or create one), and Add Webhook
Do so via using thewebhooks API, with the correct REST App client id and secret for authentication
Until you register a listener URL for event(s), no webhooks will be sent.
I am currently working on developing a plugin for subscription in WordPress.
I have integrated PayPal with the plugin but the problem is that how can I get the payment status from PayPal?
I have set return parameter to my subscription page but it does not receive payment status and other parameters from PayPal.
You'll need to use IPN for that. It will POST data to your application about every transaction that hits the account so you can process them accordingly, automatically and in real-time.
You can use PayPal IPN for WordPress to get up and running quickly. It comes with lots of different hooks to trigger your own stuff based on different transaction types or payment status (note: these links are to my own website).
I have been working paypal integration to an existing system of ours and successfully done tests on sandbox by using rest api and express checkouts.
Although documentation is detailed, I couldnt see anything about chargeback (i.e reverse transactions) and cancellations on rest api documentation page http://developer.paypal.com/docs/api/
So in case a user buys something successfully and the payment status becomes "completed", then there is a reverse transaction like chargeback, paypal will send a request to the return and cancel urls which are predefined while creating the related payment, or the client application has to check the payment statuses manually by rest calls? Or are there any other configs that I need to send while triggering the very first payment request?
You'll need to setup Instant Payment Notification (IPN) to handle that sort of thing.
IPN will automatically POST data about all transactions that hit your PayPal account to a URL you specify. This URL (a script) can receive the data and update your database, generate email notifications, or anything else you might want to automate based on the transactions.
You can handle all sorts of things with IPN. For chargebacks specifically, you would receive an IPN with the following params...
txn_type=new_case
case_type=chargeback
Of course, you'll get a bunch more parameters, too, but those would be how you can pick out the chargebacks and processing them accordingly.
Using the PayPal permissions API can you receive notifications from payments made after a customer clicks on a payment button, proceeds to PayPal, and then pays?
I notice they have IPN, but will this work with the permissions API?
Thanks!
You can include NotifyURL in your API requests to set a URL for IPN to POST data to. It's not something that technically "works with the permissions API" but any transaction that is made would indeed trigger the IPN.
If you're building an app for 3rd parties to use, though, and you're passing NotifyURL in your API requests, that will override any IPN configuration each individual merchant using your tool might have setup on their own. This can cause frustration for such users because then their own IPN solution doesn't get hit when they take payments through your app.
If you're going to do that I recommend setting up a way for your users to enter their own IPN URL in your app settings, and then if they have a value, forward the POSTed data to their URL when PayPal sends it to yours. That way both IPN scripts will get hit and process the data accordingly.
my ipn works perfectly its setup under our business PayPal account. our asp.net website is being used by multiple customers with their own members, unique by their login. as of now the cart writes to our database with the orders and sets a status code that gets changed to 'completed' via the ipn call/authentication from PayPal using our PayPal email. now, a couple want to use their own PayPal accounts, non-for profits, so in order for this to work as previously described what changes in the post variables?
ex of what i need: a member of our customer logs in to our website, adds items to their cart and chooses PayPal payment option. it writes to our database as an 'in-process' order. it opens our customer PayPal account to complete the payments then once complete it calls our ipn setup under our PayPal account and redirects back to the custom page.
again, everything is already working great just want to call their own PayPal account instead of ours w/o needing to have them setup the ipn settings under their account, but use the ipn setup under our PayPal account. members see their own customer PayPal account billing theme and the money is in their account not ours. is this possible?
do we send the ipn location url and our customer PayPal account info in the post variables?
thanks for any help
As far as processing the payment on their PayPal account, you can go about this 2 different ways. You can either use their API credentials and pass those over in the API call and the payment will be processed on their account. Second option would be to have them grant 3rd party API permissions to your API to be able to process transactions on their account. Then you would just pass over your API credentials in your API call and also pass over their email address of their PayPal account in the variable "SUBJECT". This will then process the payment on their account.
As for still haveing the IPN POST sent to your script, you will just need to pass over the IPN URL in the API call. When pass it over in the API call, it will override whatever is set in the account. For example, if you are using NVP the variable would be "NOTIFYURL".