In my app I plan to use the pay pal buy now button to sell tickets.
My plan is to
When the user selects tickets to buy, create a reservation marker saying 1 ticket have been taken.
Give this reservation a time to live of lets say 15mins. If the user hasnt bought it, I will auto close the reservation and the ticket inventory goes up
The user clicks pay now buton, sends to pay pal. Lets say this takes 30mins
User completes transaction
Paypal calls back to my site
However at this point I would have closed the reservation and they would have paid but I have no ticket for them
How do I handle this pattern?
Using PayPal buy now button you will always have that problem because the payment itself happens in PayPal site and you don't know exactly when.
In your case is better to use an Express Checkout, where the last step of the payment process will occur in your site. This means that you can verify that there are possible reservations just before the payment is done.
If you look at the process flow from the following image, you can verify if reservations are open just before calling DoExpressCheckoutPayment:
Related
So I'm using an API to receive payment notifications,
I don't really care what's in the notification I just want paypal to notify the API when a payment has been made and execute my own code.
So first off is this even going to work?
I put the URL for the API in the Instant Payment Notification under my account settings. My account is still new because I sent a test payment and it didn't work, do held payments not notify the IPN?
If the payment is held within PayPal it will notify via IPN, yes. You will be able to see such held payments by logging into www.paypal.com and viewing the activity. There will also be a "pendingreason" value in the IPN, to notify you of why it is held.
Note that if at transaction time a "notify_url" is set by the integration (many older shopping carts do this), that URL will be used in place of whatever is set at the account level in www.paypal.com. Whatever was set at transaction time has precedence.
--
If an order is "on hold" by your shopping cart (pending payment), PayPal will not send any notification as nothing has taken place within its system (except maybe a checkout attempt that was clicked on but not finished for whatever reason)
I want to Implement these things in project please give me guidance how to implement
My clients requirement is:-1. Buyer authorizes the work by clicking “Order”.The system will create an authorization code, but doesn’t charge the buyer just yet. 2.The seller now receives a notification to proceed.3. Once the seller goes his profile page which shows his/her pending orders, there will be a button to click
once he/she is finished with the order. That button will alert the buyer that the order is complete. In the next 3 days, there are 3 possible scenarios:a) Buyer confirms that the order is complete and satisfactory. At this point,Paypal will send money to the seller and to Admin of website(commission).
b) Buyer does not approve and will discuss with the seller ways to fix the order. Buyer and seller have 3 days
to discuss and resolve. Buyer now has an option to request to cancel the order.
c) The buyer takes no action and once the 3 days are up, the seller will be paid and Admin gets our commission.
If Scenario B happens and the buyer does not click “request to cancel” within those 3 days, then payment
will automatically be made to seller. 6. Once the buyer clicks “request to cancel” the admins will go in and view the communication/messages
between the buyer and seller and determine who gets the final payment from paypal.
Can I implement these things in my project using Paypal. Which method can apply for this process.
This could be implemented by combination of PayPal's Adaptive Payments + your own business logic via API calls to PayPal servers.
I have an asp.net application
The User can purchase items and/or upgrade an existing service. I use PayPal to handle payments.
When the order is placed I put the order details into a table as a record. I also do this so that if the User revisits my page I check a flag in that table to tell them whether payment has been received.
If not received then I display a message on my web page telling them they have requested and upgrade and that we are currently waiting for payment.
I also disable any future purchases for that User so that they do not upgrade twice (or more).
Now, it occurs to me that when the User is redirected to PayPal to make that purchase that a payment could fail or they could close the web page.
In that case then the User would not be able to ever upgrade unless they send me a support email.
What is best practice? Wait for a time period to elapse and if no payment then allow User to try again or stick with the support email route?
If it is best to wait for a period of time what is an acceptable period of time to wait for?
I am using the post back of Form values method to imitate payment to PayPal:
https://www.paypal.com/cgi-bin/webscr
What you can do.
Each time the user is ready to leave your page and move to paypal to pay, you create
Clone of their order
A new unique ID connected with that cloned order.
So, if one order if fail, at any time the user come back is find a new set "Order"+"Unique ID". With that 2 elements can make a final payment.
You may end up with two or tree or more cloned orders, but from my experience because this is what I really do, is rare, and its safe for your customer and you.
Also please note that paypal is accept only one unique id for each order. If one ID is fail, then you must create a new one anyway.
The unique id you send to paypal go to the invoice parametre.
The manual for all parametres is this pdf - PayPal Payments Standard Intergration Guide... and there are more pdf for paypal...
With a paypal like system it's easy to track the transaction with the auto-return setting and ?utm_nooverride=1 parameter, since after the payment the user is redirected back to the site.
But what if we have a system with delayed payments?
User adds to cart, checkout, but he just pays for the transaction tomorrow.
Is it possible to track a transaction like this?
I'm able to store some vars and pass them to the callback function to later use.
just as a sidenote here, in your case, there is no need to use 'utm_nooverride=1', since usually it wont take more than 30 minutes to checkout on the paying service site, the visit will be maintained when the visitor returns to your site.
About your question, unfortunately there is no way to achieve this kind of transaction, because the transaction is a visit-related tracking, and when the user comes back tomorrow to pay, it will be a new visit.
Also, as probably the user doesn´t really have to go back to your site to finish his purchase, I don´t really see the possibility.
Augusto Roselli
Web Analytics - dp6
I have implemented 2 payment gateways in my app (paypal and datatrans). In both gateways payment happens on gateway site i.e. user is redirected to payment gateway site where he pays and then redirected back to our site.
I have identified some scenarios where there is some issue in entire payment flow. E.g.
lost internet connection after payment and so order is not placed but money got debited from user's account
PayPal sent response but application got exception and so user did not get confirmation
Double payment due to hitting refresh button when transaction was in progress
I would like to know what are standard exceptions should be handled in payment gateway integration.
Any example with paypal would help me lot, I use asp.net mvc 3. thanks.
Double payment.
To avoid them you need to create a unique ID for every order, after the user move from your site to the paypal or other site, this ID must be read-only, and if the user return to your site after fail or other reason, and ask to re-order the same cart, you must create a new cart, and a new order ID.
For every order id, paypal and other sites allow only one payment (or one fail).
Lost the internet connections, or not get confirmations
Paypal have 3 ways that contact with your.
IPN
PDT
emails.
The one is that you get information from the return of the user after the payment, the other method is that paypal communicate with you and send you the payment informations, and final you get email.
In the rare case that all fails, user will inform you after some days that he did not get his order.
Practical they never fail all of them. Actually they never fail any of them.
Exceptions and bugs
Well some times you can not avoid bugs, so monitor your payments and log any possible errors to fix it. After 7 years of payments with paypal I still monitor them for problems, fraud, issues, new thinks etc, and still make some small adjustments time to time.