Authorize.Net DPM & Silent post - php

Is there any function in Authorize.Net that does the same of the IPN function on Paypal? I've read a lot about Silent Post but I have some of questions.
If I have at the moment of paying a Pending status, and after few days Authorize changes it to denied, Is Silent Post going to notify me this status change?
Does it work for DPM payment method?
Is there any php example code?
I need it very much because I'm doing a project that recharges devices like mobile phones, but in case to have a pending status I have to do this recharge, and if this status is later finally rejected I have to revert this changes, so I need in each moment to know the transaction status changes in Authorize.Net.

Silent Post is essentially Authorize.Net's version of IPN so it is what you're looking for.
If I have at the moment of paying a Pending status, and after few days Authorize changes it to denied?, is Silent Post going to notify me this status change?
No. Fortunately this rarely ever happens.
Does it work for DPM payment method?
Yes. It works for all payments regardless of method (DPM< AIM, etc) and status (approved, declined).
Is there any php example code?
Handling Authorize.Net Silent Post with PHP (I am the author of this article)

Related

PayPal REST API order workflow: Payment -> Sale -> Webhook?

I am trying to integrate the PayPal REST API into my Symfony 2 web app but I find hard to understand how exactly the complete workflow looks like:
The PayPal docs describe the following steps to accept a payment. One can use the PayPal Playground to simulate these steps:
Get an access token
Create a Payment object by querying the API
Redirect the user to the approval url received in the Payment response
After the user approved the payment on the PayPal page, he is redirected back to my page, using the success-link defined in the Payment object. Use the received information to execute the payment.
Payment is completed with status approved
From the docs: Once a payment is complete, it is referred to as a
sale. You can then look up the sale and refund it.
So far so good. BUT: Where are Webhooks used/fired in this workflow? I have defined a wildcard Webhook (accepting all possible events) in the PayPal Developer Dashboard.
My observation is, that my system receives the Webhook event 1-2 Minutes (!) after the user was redirected back to the success-link and after the payment was executed (Step 4).
Beside this long delay between executing the payment and receiving the Webhook, this workflow means, that I only receive the Webhook AFTER handling the success-link. This means, handling the success-link is absolutly necessary for the payment to be completed. Is this correct?
Do I need to use Webhooks?
I already asked this question a few days before and the answer by nifr is quite reasonable: One cannot trust the user to follow any redirect URL but should only rely on the Webhook events.
However this collides with the observations I described before, since I will never receive the Webhook without handling the redirect URL...
So, handling the PAYMENT.SALE.COMPLETED webhook event does not make a lot of sense, since this should already be done in when handling the redirect URL. Correct?
However, to handle updates on pending payments, handle refunds or reversed payments, etc. are only possible by listening on those events.
So the answer is: Only use Webhooks to get updates on payments made before. Correct?
So, the main questions are:
The 5-step process to accept payments does not say anything about using Webhooks. This does not seem to make a lot of sense, because without Webhooks one would miss update events, etc.? So, is it really possible to implement the complete payment workflow without Webhooks?
If yes, how are updates (refunds, pending, etc) handled in this case?
If no, what is the right strategy/time to fulfill the order since it take quite a long time to completly receive and handle the webhook?
i am still a newbie in PayPal world, but few days ago i integrated PayPal Plus REST API in an online Shop, and from my understanding i can tell that the workflow looks like:
create a Payment
redirect to PayPal
Payer could pay using PayPal account OR (using Bank Direct debit or Credit Card Payment without PayPal Account)
After completing the process on PayPal side, PayPal redirect the user back to your success URL.
till now the user is still not charged(you got no money). At the moment where you (in your success URL) do $payment->execute($paymentExecution,$api); , you ask Paypal to charge the amount from user. BUT also after this, you got no Money. Paypal have first to process the charging and notify you later via WebhookEvents.
the Webhook Notification (with that nasty delay) is especially important when the user pays per direct debit or Credit Card etc. Processing such Payments takes few seconds/minutes.
the redirectUrl ist absolutly necessary for charging/executing the Payment.
here on execution succeed, just to tell the user, that he finished his Job, and you can here save/capture the PaymentID/Transaction id for later usage/update via WebhookEvent Listener.
so i would recommend you to update your Database(Payment completed) only after receiving notofications via WebhookEvent Listener and not in the success RedirectUrl.

What payment statuses are possible in PayPal PDT?

I'm going to use PDT to handle one-off payments made via a Payment Button on my site (PayPal Payments Standard). In fact, I will also use IPN, but the question is about PDT. What values of 'payment_status' variable are allowed in PDT message that PayPal sends us in their response? It seems to me that not all values are possible in PDT messages, and thus not all should be handled in my code.
I did not find any info on 'payment_status' with regard to PDT in PayPal documentation (and in any other places), so I had to come up with my own idea. I decided that these values are legal for PDT:
Completed
Processed
Pending
Failed
and also may be
Denied
So, the above 4 (5) statuses I need to handle in my PDT script and no others. I think others:
Canceled_Reversal
Expired
Refunded
Reversed
Voided
relate to IPN (not PDT). Is my guessing correct?
Thank you.
Exactly, IPN will notify you asynchronously of certain events like refunds, reversals, holds, etc, so if you are using IPN you may receive those statuses as “updates” on previously completed transactions.
However, PDT variables are sent back only when your integration’s return URL sends a POST against https://www.paypal.com/cgi-bin/webscr passing “cmd=_notify-synch” along with your PDT token and the transaction ID (“tx”), so you will only receive the status of a successful transaction, which would be “Completed” (if paymentaction=sale) or “Pending” (if paymentaction=authorization/order).
You shouldn’t receive Denied/Failed/Processed payment status either, as these usually refer to MassPay IPNs.

Payment info using paypal

I have Integrated Paypal using php. I know there is return url ,that means when payment is received it will return to the url for our website.My Question is if payment is received and due to internet problem it does not return to our web page, how do I know that payment is received from a particular user?
If there is a network issue and PayPal cannot issue the IPN message, then according to their documentation, they will retry 15 times up to 4 days.
The IPN message service does not assume that your listener will receive all IPN messages. Because the Internet is not 100% reliable, IPNs can get lost or be delayed. To address these issues, the IPN message service includes a retry mechanism that re-sends a message at various intervals until your listener acknowledges receipt. An IPN message may be present up to four days after the original was sent. The maximum number of retries is 15.
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNIntro/
This item below might help. Instant Payment Notification should work, but in the case of a network failure, if the payment reached PayPal but the purchaser did not get back to your site to complete a purchase, then you should still receive an email from PayPal telling you that you have received a payment.
using paypal button - can my webpage tell if paypal transaction was successful or not?
You get a confirmation email with their name and email address - be aware that occasionally this may not be the user's current, most active email address. You can also log in to your PayPal dashboard to see all details as well, of course.
You can look up your payment details from the email and compare them to your own user records in your database. If the email they use for PayPal is not the same as the one they registered on your site with, you can still look up their name from the email - in practice it seems to happen extremely rarely that payments have such a problem in my personal experience
I set up a script which emails my users with a passcode to get to the online product they bought which is emailed to them so they can submit that later along with their email address. This is the first thing that happens on return to my script so at least if the site fails to respond properly they can get to what they bought later.
The script uses PHPMailer and cc's me with their passcode so I have it available to re-send to them if they write with a complaint. It doesn't help if the PayPal return for Instant Payment Notification fails completely but the other answers cover that very fully and detail the PayPal repeat attempt process well.
Instant Payment Notification scripts can be downloaded from PayPal for modification by yourself as per the article linked to above.
To be perfectly honest, this is one of PayPal Standard's largest holes. IPN is a POST callback (as is PDT) and they check to make sure they get a 200 response or else they retry (and you can use the IPN history in your PayPal account to resend missing IPNs). But this method still relies on you getting the callback in a timely manner and it's not foolproof. Worse, you need to verify the IPN call and that introduces yet another point of failure in calling PayPal to make sure they did indeed send you the IPN you got.
There's a couple of ways to deal with this
Audit your account regularly. This is a good idea in general, but for a small website this shouldn't be terribly hard. Match your invoices up to your PayPal payments. Obviously this doesn't scale well so...
Switch to Payments Pro. There's more hurdles to this (like more PCI compliance, SSL certificate, etc) but the major advantage is that the API is far less susceptible to the whims of the Internet and only involves one call for credit cards (you can ignore the IPN because the API tells you everything you need to know). The worst that can happen is you send a payment API call and fail to get a response. This is exceptionally rare as PayPal makes sure their API is 99.9% reliable (IPN relies on your server being reliable). Speaking from experience, Payments Pro has far fewer issues than IPN does.
In your application, you should have a status field for orders. If you haven't received the ipn, you wouldn't change the status to Paid.
After that, if you receive an email from Paypal that someone has paid, check the order number, and change the status manually.
how do I know that payment is received from a particular user?
Paypal will send an email both user and you.
Paypal offers 2 solutions for your problem.
PayPal IPN - it notifies the server with a POST request to a specific URL, whena transaction has been successful, declined, aborted by user and so on. Paypal provide an IPN Simulator (the worst simulator ever) in order to test its functionality. you may give it a try at : https://developer.paypal.com/developer/ipnSimulator/
Paypal WebHooks - The webhooks are the "New Kid in the Block",they are basically "user-defined HTTP callbacks that receive events for the subscribed event types. Webhooks are asynchronous, the order is not guaranteed, and idempotency may lead to the same event being sent more than once." as stated in the Paypal documentation.
You can read more about it on : https://developer.paypal.com/docs/integration/direct/rest-webhooks-overview/
For any further help, comment below and I shall try to help.
Cheers,
You have to use notify_url for this purpose
<input type="hidden" name="notify_url" value="https://domain-name.com/ipn.php">

Paypal response code - how to properly handle

I'm very new with ecommerce sites and making payments online. I'm building a website for a racetrack company. I built my customer a website where you can order subscriptions, rent gear & rent track days. I got paypal to the point where it is returning to me an IPN and I'm getting the response code coming back as either "Pending" or "Completed".
Once a customer makes a payment I need to update in the database the spots they took up, the gear they rented etc to keep inventory correct.
My question is what is the proper protocol for handling this? Should I assume the payment is good if it comes back as "Pending" & fill up all of the spots in my database & if it later comes back as anything other than "Completed" undo everything? Or is there a better way of handling this?
Also, is there other repsonse codes I should be concerned with from the Paypal IPN?
Finally, is there a way for me to only allow instant payments that I know for sure have gone through so I don't have to deal with 'pending' payments?
Any and all advice on Paypal IPN repsonses and anything related to this is very helpful as I need to release this site in 2 weeks and I want to make sure I don't do something wrong with this.
is there a way for me to only allow instant payments
There is an account level setting (Payment Receiving Preferences):
In REST API:
the intent set to sale "is for immediate payment"
payment_options of transaction (INSTANT_FUNDING_SOURCE)
For good measure, you should still check the status though (for other reasons that might set the status to pending - in the link referenced in comments above, e.g. currency/fraud settings, etc.) and handle according to your business rules..
Hth..

Callback from PayPal. How to know the user paid successfully immediately?

I am running a e-commerce website and I want to integrate PayPal. I need to know immediately whether a user paid successfully or not after they paid via their credit cards. Is there a chance i can do that with PayPal?
I've heard PayPal has a service called IPN, which can post to my server and tell me the transaction's status. But lots of people are complaining that there are huge delays with IPN's PHP API.
Just finished an IPN integration a few hours ago :).
IPN stands for INSTANT payment notifications. In most times it just works(hi Apply fans!).
You add a form with variables such as currency and return URL and with a special page that you expect Paypal to send transaction information when the payment is made. Receiving a notification does not mean funds are sent to your account but the transaction has completed. (possible reasons to not get funds to your account include problems with card provider, incomplete accounts, etc)
You will face some questions regarding specific problems. But I would suggest checking paypal site and it's API docs. They are pretty straight forward and with a little understanding in your programming language and how HTTP works, you can implement it.
I have seen some posts about PayPal IPN system is slow. I have not seen it myself but in most cases, I'm sure you will get paypal API calls just before the user come back to your site.
I've had great success with nSoftware's PayPal plugins.

Categories