IPN works for "guest" payments but not paypal account holders - php

I have a subscription payment set up for my website. When a user clicks to subscribe, they are taken to a Paypal page with the option to log in and pay through their Paypal account or to continue basically as a "guest" and enter their credit card information. When a payment is made, it is supposed to open extra features on the user's account.
When making test payments, payments made as a "guest" would go through and be relayed to my site to open the extra features for that user. However, any time I log in to my personal Paypal account to pay, the payment itself will go through but it is not being recognized by the website to unlock the additional features.
We have looked for settings that may need to be changed, such as enabling PDT, but that did not help. The website is receiving all the proper information from "guests" but I don't understand why someone logging into their Paypal account would be any different and cause this problem. I don't want people to be paying money and not getting what they are expecting. Any ideas how to fix this?

When unlocking the extra features, is the redirection URL included in the code? I would suggest to use IPN to assist with this feature.
https://developer.paypal.com/docs/classic/products/instant-payment-notification/
Do note that for subscription payment, it might take a few hours for the profile to be active on the PayPal site.

Related

accept payment form paypal without going to paypal site

I have a site which have a two type of login member and provider.member request an appointment with provider and provide paypal account detail. when provider login and confirm appointment then amount has been debited (deducted) from his/her paypal account without going to paypal site. that type of payment accept I want to implement on my site .
it is possible ,if yes can you please suggest me tutorial for that.
you can suggest me for php/cakephp.
This might be helpful for you:
Process Credit Cards with PayPal Payments Pro

Confirm Express Checkout on PayPal via PHP

This question asked before but didn't got any answer.Maybe things have been changed.
When you click the Express Checkout PayPal button on any webshop, it redirects you to a specific paypal login link, for paying the order.
I have been searching high and low for 3 weeks for a simple paypal php curl script that logs you in from this step, and confirms the payment, but have not been able to find anything.
I found out it is not possible to use the API for this, so its gotta be done by CURL.
I'm asking for this because I run a dropshipping website, and would like to automate certain steps, like placing and paying orders. A working code for this would help not just me, but all looking to automate buying in some form.
Thank's!
You can't log the buyer into PayPal when you redirect them to the site. The buyer has to enter their own account credentials themselves.
If you wanted to bill a buyer without requiring they log into PayPal each time you would need to use billing agreements (reference transactions) through Express Checkout. If you set up a billing agreement with a buyer you can charge a previously successful sale to bill them again for a different amount.
You cannot do what you want with Express Checkout, especially since nobody will ever enter the paypal details on your website (that is the entire point of paypal).
You can use either preapproved payments (buyers preappove payments being taken out of their account up to a certain ceiling), or reference transactions (you reference a new transaction to an older transaction. PayPal will then use the billing details of this earlier transaction to bill the user).
Preapproved payments is part of Adaptive Payments. Documentation is at https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/integration-guide/APIntro/
You can find more details about Reference Transactions at https://cms.paypal.com/uk/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECReferenceTxns
Note: Reference Transactions needs to be enabled on your account. This API call is not open to everyone due to the potential for abuse, so you may want to look into whether you're eligible for it before you start working on a full integation with it.
You can find more info here :https://www.paypal-community.com/t5/Merchant-services-Archive/Does-Paypal-have-a-quot-Token-Payments-quot-concept/td-p/325794
Also google "token payments" as that is what you need and most payment gateways usually support them.

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 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! ;)

How do I get data back from Paypal so I can alter my MySQL database accordingly?

I'm just starting out with Paypal, so this is a newbie question.
I've been going through the instructions for setting up Paypal subscription service, but I think I'm looking at the wrong thing.
What I want to acheive is to get back some kind of response from Paypal so that I can update the database on my web site to mark a registered user as having paid. Basically I have a flag in the database that says if the user is subscribed or not. I want to ensure that the user is marked as paid so long as their Paypal subscription is maintained.
While the instructions linked above do say how to set up a button to receive a payment, there's nothing there about getting any data back from Paypal.
I know there are terms like IPN and sandbox that are related to what I'm trying to do, but I can't find clear instructions for how to get started on this process. I'm just circling around and not getting anywhere.
Where do I start on setting this up? Where is there a clear beginner's tutorial?
Also, I'm using PHP/Javascript/MySQL on my website.
PayPal's IPN service is what you want to use. I've used it myself to do just what you're looking to do.
Instant Payment Notification (IPN) is PayPal's message service that
sends a notification when a transaction is affected. Once IPN is
integrated, sellers can automate their back office so they don’t have
to wait for payments to come in to trigger order fulfillment. IPN can
send notifications for these transactions:
Instant payments, including Express Checkout and direct credit card payments
eCheck payments and pending, completed, or denied status payments
Pending payments
Recurring payments and subscriptions
Authorizations
Disputes, chargebacks, reversals, and refunds
You can also view notifications on PayPal’s IPN History page and
resend them if you need to. As PayPal’s interface for handling
purchase confirmation and server-to-server communications, IPN can
also be used to manage and customize a variety of APIs and
communications, including:
Customize your website's response to customer purchases in seconds
Track customers via IPN "pass-through" variables
Notify sellers who deal mostly in software downloads and other digital, online goods
Track affiliate sales and commissions
Store transaction information in your own database
For more about IPN:
Technical Overview (link to new html version of docs on developer central)
Instant Payment Notification Guide (PDF)
Code Samples
I'm not sure if its the same thing, but I just setup my friends website with Express Checkout, and I wanted to add all paid orders to an orders table in my database.
After I call SetExpressCheckout, and the user is returned to my site after going through the purchase flow on Paypal's side,
I used the information from GetExpressCheckoutDetails.
Then, if DoExpressCheckoutPayment
is successful (also called from the "callback" page) I then do the appropriate work in my database as far as logging the order details. For you in this case, it could be updating a record for the user in the database.
Hope that helps a little.

Categories