Using a different PayPal IPN URL per transaction - php

I have seen and know how to use IPN for paypal payments but I am having a small issue. With IPN you need to enter an IPN address to your PayPal File so it knows you got sent the payment (Instant Activation of Product). If I have multiple sites, I can't do this as It only allows one.
I have seen the WHMCS system manage to do this using Website Payments Standard (Does not require any IPN Settings) where the user's invoice is marked as paid after the payment is sent. The user does not need to be redirected to another page and as a seller, the only info you need to put in is your paypal email for things to start working.
Does anyone know how this works and where to learn this?
Thank you for your help

You can specify a per-transaction IPN URL by passing in notify_url along with the other data in the form.
E.g. <input type="hidden" name="notify_url" value="http://....">
This will override whatever you have set up within your PayPal Profile.

Related

Recurring payments paypal IPN

I am working on client's project for paid memberships.
clients want to do recurring payments and i am stumped upon IPN settings for recurring payments.
As Paypal say, if notify_url is specified in html form it will override Paypal's default notify_url if specified. That's fine for one time payment.
But what for recuring payments ? which Settings paypal use for sending IPN notifications to clients server. Is that the notify url which user specified for first time in HTML form or Paypal's default ipn settings ?
what if user hasnot specified paypal default ipn setting ? but had specified it in html form when user was subscribing for the first time.
Any help will be appreciable.
Thanks.
What I have is that notify_url only works for the initial transaction but for the recurring payment, IPN url is being used.
I am also trying to get some answers to verify if this is how it works as there are people with different opinion and offical doc doesn't seem to have this info in detail.

Confirmation of a donation made to an external PayPal account

I have a website that allows my users to donate to charities via PayPal. I want to track the donations that a user makes, but I don't have direct access to the charities' PayPal accounts.
This is kind of a follow-up to this question, which provides a good explanation of IPN tracking, but I think it relates to tracking payments made to an account which I own.
Is it possible to send confirmation of a donation to a third party back to my website so that I can track it?
P.S. I really hope this isn't the wrong way to post a follow-up question, and that it doesn't count as a duplicate...
If you use notify_url / NotifyURL in your Payments Standard code or API requests you can override the PayPal account profile and have it send the IPN to whatever URL you specify in that parameter.

I want to use paypal payment for package sales, which paypal method woud be best?

I want package sales, when user click on purchase want to send user on paypal site, after success payment back to my site, I will update payment status if payed other wise will not update the payment status. 2nd question how will i know user payed?
PayPal IPN allows the PayPal servers to interact with yours, telling them statuses about if they've paid, missed payment or it failed etc.
https://www.paypal.com/ipn
For example, if you're using the Website Payments Standard (https://www.paypal-business.co.uk/accept-online-payments-with-paypal/index.htm) you send them to the PayPal site by sending hidden information in a form, they do their thing on PayPal and then get sent back. PayPal will then notify the server using the IPN details that were either sent or are in the account, letting the server know if it was successful or if anything else happened. Then your application that picks up the IPN, does its security checks, and then does the appropriate action (e.g. allows the item to be sent or them to login etc).
However - if you're doing subscriptions, I highly recommend not using PayPal. They suck for subscriptions.
visit the following link
http://www.evoluted.net/thinktank/web-development/paypal-php-integration
and follow the step by step guide.
If not work then ask question here.

Paypal direct payment HTML button together with IPN

I'm using an HTML PayPal button together with IPN to achieve a direct payment on my PHP website. The IPN URL is correctly pinged but I need a way to identify the transaction, because I need to update it on my local database during the IPN call.
So my question is : is there a simple way to send a token / identifier from the HTML button and get it back on the IPN call, so that I retrieve the transaction?
If no, I guess I'll have to use the API but the code samples I found on the PayPal website confused me. I need the payment to offer both Paypal / Credit Card options to the user once he lands on the PayPal payment page. This is what they call a "Direct Payment" but is there any clear Direct Payment code samples I can use somewhere?
Thanks!
I used the simple form to redirect customers to paypal. In this form i have a hidden input <input type="hidden" name="invoice" value="myCustomInvoiceId" />.
After the customer finished his payment, paypal will do the IPN call including invoice=myCustomInvoiceId. So yes. There are plenty of variables more that paypal can include in their IPN call. See this link for further reading.
if i remember correctly, you can chose which variables to include in the IPN call in your merchant paypal account.

How to secure paypal integration for website

I have been using paypal in the past for selling stuff through my website ( e.g. memberships ) but I always had to verify through paypal whether the user really bought the membership (for example) before I could assign it to his/her account. Now I was wondering if there's a way that I can put a paypal purchase button onto my webpage to ( for example ) purchase a membership and then once the user paid, he'll automaticly be assigned the membership on my website ( e.g. there's a page purchase_result.php which assigns the membership, but ONLY if the user really bought it through paypal ). How can I make sure the user actually bought the item through paypal on the return page on my website?
Thanks in advance,
Skyfe.
btw, I hope my question can be understood
You would PayPal Instant Payment Notifications to receive a server-to-server notification from PayPal which you can subsequently verify and use to update your database.
IPN works as follows:
You create the PayPal and incude a "notify_url". The value for this parameter will be the full URL to a script on your server, called the 'IPN script' or 'IPN handler'.
You can specify an IPN handler as follows for Website Payments Standard
<input type="hidden" name="notify_url" value="http://blah.com/ipn.php
For Express Checkout or Website Payments Pro, simply include the following in your SetExpressCheckout/DoExpressCheckoutPayment or DoDirectPayment API call respectively.
NOTIFYURL=http://blah.com/ipn.php
A buyer completes a transaction via PayPal
Once the buyer completes the transaction, he/she may close the browser, or return to your website
Once the transaction is accepted and processed by PayPal, PayPal will send out a notification to http://blah.com/ipn.php
You need to take all POST data that was sent to this script, and POST it back to https://www.paypal.com/cgi-bin/webscr?cmd=_notify-validate
If the data you send back matches the data PayPal sent you, a 'VERIFIED' response is returned.
If the response is VERIFIED, it's at this point that you would look up the matching transaction/buyer on your end, and update your database appropriately.
Some sample code and documentation for PayPal IPN is available at https://www.paypal.com/ipn/
In addition, some tips on making a secure IPN script are available at https://www.x.com/developers/community/blogs/ppmtsrobertg/securing-your-instant-payment-notification-ipn-script
Note: If you want to include any custom data along with the transaction which you can read out later, use 'custom'.
<input type="hidden" name="custom" value="xxxxx">
This will also be returned in the IPN POST data sent from PayPal.

Categories