How To Know if a paypal transaction is succeed? - api

I am creating a website where user can buy digital stuff. Its not downloadable material or something like, just a sensitive data.
I used paypal payment button and integrated it to my website. I tested it using paypal sandbox. So, i would like to perform a certain action once the user purchase the item and roll back to the site. So please tell me how it is possible?

For any post-transaction processing you want to do you should use Instant Payment Notification (IPN).
Instant Payment Notification (IPN) is a message service that automatically notifies merchants of events related to PayPal transactions. Merchants can use it to automate back-office and administrative functions, like automatically fulfilling orders and providing customers with order status.
For PHP PayPal provides a basic IPN script to get you started. Alternatively, you could take a look at this IPN template solution I put together many years ago. It has an installer that sets up a MySQL database for you, and then it automatically saves all of the IPN into the database and emails you notifications. You could start with that and then easily customize it to suit your needs.

Related

How does one associate a website user with a Paypal subscription?

I am implementing subscriptions to a premium service on a website using Paypal as the payment service. I have successfully created a Catalog Product and Billing Plan through the API, and I am able to get to the payment page on Paypal, but it's not clear how I'm supposed to persist a user identifier through the purchase process.
I assumed it would be something along the lines of passing a user id somewhere, but there's nothing in the Paypal documentation about this. I need to be able to let the user make a purchase and have the Paypal webhook send the confirmation to an endpoint on my site, and that's where I'd expect to get their user id to toggle the subscription on their account on my end.
Is there something I'm missing? There has to be a way to do this cause I'd imagine it's a pretty common use case. If anyone has information or has done this before, I'd love to hear. Thanks.
The only truly secure way I've found when using javascript SDK, is to securely generate a unique custom_id on your server side associated with the user.
Then when you create the buttons, the 'createSubscription' function takes custom_id as a parameter.
Then use a webhook to receive events from your subscription and the custom_id will be present in the body of all BILLING.SUBSCRIPTION events under resource.custom_id.
I am able to get to the payment page on PayPal,
You are vague about what you are doing here. There are multiple ways (and some ways have multiple versions) of accepting subscriptions via PayPal, so it is important that you provide full details about the method you are using.
The time to associate a created subscription ID with a user ID is when it is approved, in the onApprove function if you are using a Smart Payment Button: https://developer.paypal.com/docs/subscriptions/integrate/#4-create-a-subscription

Get transaction details in real time, Paypal

I am creating a website and instead of using a fully featured shopping cart I want to use the Paypal API to "automate" some functionality.
By that, the user clicks on the "buy now" button goes and makes payment to paypal, and I want them to be redirected back to my site so I can process some info for my database. I looked into IPN but it seems like an overkill. Is there any simpler way of doing it?
You should look at either IPN or Express Checkout.
If you are using web standard payments it is important to note that a customer does not have to return to your page, once they hit pay on the Paypal site - the transaction is complete. Hence relying on them to return to your page to do a database update is a bad idea. This is where IPN comes into play.
Express Checkout gets around this by allowing the customer to authorize on Paypal and complete a transaction on your site. Passing the data directly to your site once the transaction is complete.

eCommerce website - taking payments and Stripe

I'm considering setting up a eCommerce website and was wondering about the payment side of things.
After some searching I came across Stripe, which seems very similar to PayPal and Google Checkout.
I have a few questions about Stripe and eCommerce in general.
What do I need to take payments on my website? Presume that I have the shop set up, and the buy button in place. Do I need an SSL certificate, I've read something about being PCI complaint? What is and why would I need a merchant account.
Stripe appears to handle a number of things for me, and it stores the users card details. How would this work with things such as logging in to a website. Would I store the users email and password and then when they wanted to buy something Stripe would just handle the credit card side of things or would the entire user details be stored on Stripe.
Can you build and style your own payment form that then connects to Stripe or do you have to use their form on your page?
Do you have to upload all of your products to Stripe or can you store these in your own database and just pass the value of goods purchased to Stripe for payment?
What are the advantages/disadvantages of Stripe and is there any competitors that I should know about?
Thanks
Stripe requests that you should serve up payments pages over SSL. Anyone involved in payment processing must comply with PCI, if you use something like Stripe you will need to serve the payments page on SSL, but Strip will handle the payment info. Check out https://support.stripe.com/questions/do-i-need-to-be-pci-compliant-what-do-i-have-to-do for more details on what you'd need to do.
Not entirely sure on this front, perhaps someone else can comment?
You'll be able to style your page and use Stripe for the payment piece.
You can use Stripe's checkout or build your own (sounds like this is what you want to do) via Stripe.js.
Stripe is generally recognized as one of the most developer-friendly ways to accept payments online. They've worked hard to build a simple service that a developer can get up and running a matter of hours. Braintree is a competitor that may offer some valued added services and you might want to take a look at Balanced as well. I work at LevelUp, which has been used in conjunction with Stripe (as another payment method, similar to PayPal) and as a stand alone solution for apps processing online or mobile payments.

Payment confirmation using Authorize.net in VB.NET

I have a single authorize.net account, and I have 5 different e-commerce applications tied to that account. Some are posting from a public site and some are posting from managed access sites. I am using SIM and I have read about the Relay Response, but as far as I can tell I can only have one URL listed. That will not work for me as I need a different URL for each different point of entry into the e-commerce system.
My problem at the moment is that I need to update a datafield via a guid upon successful payment completion to confirm purchase of a digital item, but if I put in a relay response page it is getting sent to all my access points and throwing errors. Other parts of the e-commerce system need to send different emails upon completion etc, plus all the urls are different at the top level.
Is there some other way of accomplishing this task that I am overlooking?
Use Silent Post*. It's Authorize.Net's equivalent of Paypal's IPN. It will only post to one URL per account but it happens behind the scenes. This means you can send a custom flag along with each transaction identifying which site the purchase is for and then have it respond accordingly (e.g. send emails, update database, etc).
*I am the author of this content

Onsite Recurring Payments using Paypal Website Payments Pro API

I want to accept recurring payments on my site using paypal without having the user ever leave my site. Based on the paypal documentation it appears you have to send the user offsite to paypal (express checkout) first and then have them come back to your site.
Is their a different way of using the api so the user stays on site the entire time?
To Process payments not on PayPal's website, you need to use Website Payments Pro.
To use PayPal's recurring payment system, without programming your own:
Use Website Payments Pro Recurring Payments (direct payment recurring payments / DPRP)
Program your own recurring payment functionality:
Save cc info to a database and make DoDirectPayment API calls based on your criteria
Process an initial payment when someone signs up for your recurring service, save the transaction ID, and then call DoReferenceTransaction in the future (based on your criteria). Always use the newest transaction ID as they only last a year. Also, you need to call PayPal to apply for this feature ($0).