How to Integrate PayPal to a website?

For PayPal integration, you can use a standard button made in your PayPal account. By pushing the button, a user links to the PayPal website automatically to finish the payment. In most cases, adding the button is enough. Although, this option doesn’t guarantee that a user makes a payment. You can track the operation result only by a PayPal account. It is absolutely inconvenient.
 
Payment buttons let you securely accept credit card, debit card, and PayPal payments on your website from any mobile device, tablet, or PC. Simply log in to the PayPal website to create, and optionally customize, a payment button. Then copy and paste the payment button's HTML code snippet to your website.
 
I believe you would need to store the details before sending the user to PayPal to make their payment, so you have a record of 'intent' to purchase goods from your store. That record should contain details of who the customer is, what they are buying, and how much it costs.

Then, your customer is redirected from your site to PayPal to make the payment itself. At this point, they can either click 'cancel' if they change their mind (or just close the window down). Or they can make payment. After making payment, they can and should click the 'Return to site' button to go to your store and its confirmation page. Alternatively, at this point again, they COULD close down the window altogether. Having stored the purchase intent beforehand means you still have access to the data in the transaction.

So the following can happen:

The user presses the 'cancel' button. You can return to your site and remove the database record as this purchase will never be completed. If the customer still has their cart and buys later, a new record will be created.

The user closes down the window before making payment. You still have the database record which can be used later. After a certain period of time, when its assumed that the user isn't feasibly coming back to complete this particular order (a few days? a week?) you can delete the 'intent to purchase' record.

The user makes a payment but does NOT return to your store immediately using the 'return to site' button on PayPal. You still have the transaction details, and PayPal will still trigger your IPN script to verify that the payment went ahead and whether it completed or there were problems. You can compare details such as cart contents and total amount with your 'intent to purchase' record to ensure that everything is valid. You can then move this record to a 'completed purchases' table.

The user makes a payment and returns to your store. You can display a 'thank you / order confirmation' page to your user, tell them they have made a payment. PayPal will trigger your IPN script to that the payment went ahead (or what happened to it). As in the above step, you can compare your IPN information with the intent record to ensure its valid and real.

I believe this takes care of all eventualities, doesn't require an uninterrupted session because you're using a database - so the buyer doesn't have to return to your site following payment. Likewise, you won't have a cluttered up sales table that contains all of the people who were about to check out, but for some reason didn't proceed to make a payment. These records will be in 'intent to purchase' and you can periodically clear out old ones (or analyse the data to find out why people are dropping out of the process).

--

I hope this helps. I'm having the same problem today, and I think by actually having to write this answer out has helped me clarify it better for myself.
 
I believe you would need to store the details before sending the user to PayPal to make their payment, so you have a record of 'intent' to purchase goods from your store. That record should contain details of who the customer is, what they are buying, and how much it costs.

Then, your customer is redirected from your site to PayPal to make the payment itself. At this point, they can either click 'cancel' if they change their mind (or just close the window down). Or they can make payment. After making payment, they can and should click the 'Return to site' button to go to your store and its confirmation page. Alternatively, at this point again, they COULD close down the window altogether. Having stored the purchase intent beforehand means you still have access to the data in the transaction.

So the following can happen:

The user presses the 'cancel' button. You can return to your site and remove the database record as this purchase will never be completed. If the customer still has their cart and buys later, a new record will be created.

The user closes down the window before making payment. You still have the database record which can be used later. After a certain period of time, when its assumed that the user isn't feasibly coming back to complete this particular order (a few days? a week?) you can delete the 'intent to purchase' record.

The user makes a payment but does NOT return to your store immediately using the 'return to site' button on PayPal. You still have the transaction details, and PayPal will still trigger your IPN script to verify that the payment went ahead and whether it completed or there were problems. You can compare details such as cart contents and total amount with your 'intent to purchase' record to ensure that everything is valid. You can then move this record to a 'completed purchases' table.

The user makes a payment and returns to your store. You can display a 'thank you / order confirmation' page to your user, tell them they have made a payment. PayPal will trigger your IPN script to that the payment went ahead (or what happened to it). As in the above step, you can compare your IPN information with the intent record to ensure its valid and real.

I believe this takes care of all eventualities, doesn't require an uninterrupted session because you're using a database - so the buyer doesn't have to return to your site following payment. Likewise, you won't have a cluttered up sales table that contains all of the people who were about to check out, but for some reason didn't proceed to make a payment. These records will be in 'intent to purchase' and you can periodically clear out old ones (or analyse the data to find out why people are dropping out of the process).

--

I hope this helps. I'm having the same problem today, and I think by actually having to write this answer out has helped me clarify it better for myself.

It is very clear explanation on how to integrate paypal account to any web page, Even we have tried the same procedure
 
Back
Top