"callback" from PayPal to confirm payment? - mysql

I have a very simple online ordering app in Perl. The user fills in a form, and when they submit, my app inserts the info into a mySql database, then redirects them to PayPal to complete the payment. The problem is that the database does not have any information about whether they actually completed the payment. I end up having to manually reconcile a report from PayPal with my database to confirm payment for each order.
Is there anything like a "callback" from PayPal, where I could provide PayPal with a unique identifier for the order and PayPal could send back that identifier as confirmation that the order was paid, preferably through an HTTP request back to my server? Then I could update the order in my database with a "paid" flag.

yes, that's pretty much exactly how it works.
Instant Payment Notification

check out Paypal instant payment notification

Related

PayPal email confirmation

Currently I am trying to implement API for PAY-PAL. So basically, there is a form and user will input their email address on the textbox and that will check if the email that user inputted is valid or not. So pretty much it is verifying if email exist or not. I have created the paypal developer account and searched through google to see if i can get any idea but it did not really helped me much. Can anyone tell me where I should start first? Also, there were something called adaptive accounts on paypal website but not sure if that is the correct one...
Thank You
Adaptive Accounts is deprecated and not available.
To verify that an email corresponds to a PayPal account, you need to integrate Connect with PayPal: https://developer.paypal.com/docs/connect-with-paypal/
To integrate a PayPal Checkout that will send the payment to a particular email address, you can set a custom payee object to direct the payment: https://developer.paypal.com/docs/checkout/integration-features/pay-another-account/

Check if payment received paypal?

I am making a website where people will buy things. What I am wondering is if there is a way to check if payment was received in paypal, and then execute some code. Or should I add a paypal widget where when payment is done then it executes some code? This is all being done in HTML and CSS being it is a website.
Take a look at Instant Payment Notification (IPN). Any time a transaction hits your PayPal account their server will POST the transaction data to a URL you specify. Your script receives the data, verifies it with PayPal to ensure it actually came from them, and then you can process that data however you need to.
This gives you the ability to update your own database, send out your own email notifications, hit 3rd party web services, or anything else you want to automate when transactions hit your account. This works for payments, refunds, disputes, etc. so you can automate lots of tasks. It happens in real-time, too.

User is not allowed to perform this action

Our platform is trying to create a feature so that a seller can refund a paypal transaction after 60 days. To do this our thought was that we would use the adaptive payment feature and simply ask paypal to send money from seller to buyer.
We created an application, and in the sandbox we have everything working. When we move to production we get this response below.
{"errorId":"550001","domain":"PLATFORM","subdomain":"Application","severity":"Error","category":"Application","message":"User is not allowed to perform this action"}]}
The question is, "How does the seller authorize our platform?" Do they need to check a box in their Paypal account?
What's a bit confusing to us, is that we are testing with our own 'seller' account which is of course a valid Paypal account.
Furthermore, we are doing a simple implicit approval. We did notice that in our application registration we are 'conditionally excepted'. We read that simple payments should work fine, it is only the chained payments that require specific approval from paypal.

When does Paypal send subscr_eot?

can we rely solely on subscr_eot to activate/deactivate an account?
Assume we have the following scenario:
On 9/16, a customer pays using Paypal for a monthly recurring
service.
With 24 hours, Paypal sends "subscr_signup" and
followed by "subscr_payment". At this time, the application will
grant the user access.
??
The question, will Paypal send an EOT before attempting to collect the payment on 10/16 or would it send it before?
Thanks,
subscr_eot means that the subscription has expired, either because the subscriber cancelled it or it has a fixed term (implying a fixed number of payments) and it has now expired with no further payments being due. It is sent at the end of the term, instead of any payment that would otherwise have been due on that date.

How to update DB records using a dynamically generated link

I have a requirement to generate an email to administrator whenever a user sign up. Administrator will approve the registration by clicking on a link provided in email and database should get updated, without admin to login to administrator console.
I am looking for best practice to code this scenario with keeping application security intact. I can generate email with dynamic rendom value attached to the link(provided in email) URL, but i am not sure how to keep a track of this on application side?
Any thoughts?
You could generate a random validation number when the user signs up, and store it in the database with the user record. Then generate an email with a link such as
http://foo.bar.com/approveUser.action?userId=<theUserId>&validationToken=<theRandomNumber>
When the approveUser action is invoked, check if the validation token stored in the database for the given user ID matches with the token sent as parameter, and if so, approve the user.