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.
Related
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.
Can I get notification with data at specific url when users who connected PayPal to my app throught Oauth2 will get payment? I know it possible with IPN, but then each user need to add my url in their account settings. Is any another way?
Update: Or can I manually get information about last user transactions(completed outside my app)?
There are a number of ways to accomplish what you're trying to do, I think.
You mentioned IPN, and that would be the best way. You can specify the NotifyURL in your standard button code or API requests (depending on how you're setting up the payments) so that IPNs for those payments will be sent to your IPN URL. That way you don't have to have users set that up in their own account.
Alternatively (or in conjunction with), you could use the Permissions API to allow users to authenticate your app to make API calls on their behalf. Then you can use the TransactionSearch and GetTransactionDetails APIs to pull any info you need about their account transaction history.
On the introduction of PayPal Invoicing API documentation it states that.
PayPal sends IPN messages for invoice payments and for invoices
cancelled by the buyer.
But I've found this is not the case. IPN for invoice payment, cancel or other operation never get sent from PayPal (I have checked and confirmed it from IPN history page).
Worth Mentioning
Invoices are being created via Invoicing API successfully without any warning.
I am working on Sandbox and Creating for Third Party Merchant.
I do understand that paypal doesn't send IPN for api operation changes.
The IPN listener is working fine and I have successful implementation for subscription api with IPN.
Update
Today I tried the whole process with Live PayPal account other than sandbox account and I still not getting any IPN. So, I guess I am doing something wrong or Invoicing API is broken (which I highly doubt).
Which also makes me wonder about some additional questions:
I (merchant #1) has the permission information form merchant #2 for sending invoice to their behalf.
I have setup IPN to my IPN listener URL.
merchant #2 do not have IPN setup to my listener URL.
So, when Invoice that I created for merchant #2, Do I get IPN?
OR, merchant #2 also needs to setup their IPN url pointing to my listener URL?
IPN is get send from the account that receiving payment as #effone mentioned in comment. So, it seems I was confused from paypal documentation.
Answer: The IPN url from merchant #2 will need to setup in order to get notification about invoice payment. merchant #1 account who sending the invoice behalf of merchant #2 will not send any IPN as the payment isn't involves merchant #1
Way I see it, this is not a proper solution to create an invoice management system. As if I have 1000's of user they all need to set their IPN url to mine in order to get the application work correctly (aka, setting invoices as paid when they gets paid)
Your question reads strangely, because you say the IPN is working fine, then in your update, you say you're trying it in your live PayPal account. It sounds like it's working on the Sandbox, but not in production?
If this is the case:
Did you activate the IPN under your Production (Live) Paypal account?
Do you have the IPN URL for this?
Are you seeing the IPN being logged under the Production (Live) PayPal site?
If No -> it's been a while since I've worked with this, but there used to be an interface where you could send an IPN test- have you tried that?
If Yes -> make a bare bones listener- just a page that logs that it was hit, then add logic to it.
hth
A user clicks on a buy now button on my website which takes them to PayPal where they can purchase my item. I then receive the relevant information through my IPN listener. This all works fine with sandbox accounts.
To implement this with my live business account, am I right in thinking I don't need to worry about creating live API certificates etc? I understand this is needed when making API calls to live accounts but I'm assuming a simple buy now button doesn't need this stuff setup.
Correct. You only need API credentials when you will make an API call. IPN is a push notice, so PayPal is sending the data to you instead. All you need to do is post the data back to PayPal to verify it and then process the POST data.
I need to track user payments on my site, but there is nothing in an IPN that I have been able to link to my original payment.
Some people suggested using the "custom" field (http://stackoverflow.com/questions/11251109/paypal-button-sending-custom-variable-through-ipn), but that doesn't seem to be an option through the Adaptive Payments API.
So are there any fields I can attach to my Pay API call or my SetPaymentOptions API call that will a) be invisible to the user, and b) come back in the IPN so I can track the payment?
My only other options are to either track with the paykey (but that seems wrong since it is public and expires and a given transaction can have several paykeys), or to send the ipn notification to a tracked url such as www.example.com/payments/ipn/{transaction_id}
I'm just fairly shocked if there's no legitimate way for me to track a payment.
I think this could be of use to you:
https://www.x.com/developers/paypal/forums/mobile/how-fetch-invoice-data-using-adaptive-payments-api