I'm trying to implement Mollie API via omnipay php library.
However i have few questions which i cant understand by myself.
When i chose the payment status to be returned as Cancelled and click on Further to your webshop Mollie redirects me to the payment methods page (the page where you choose what payment method to use), is this correct?
If no.1 is correct how should i test failed transaction?
After successful transaction i cant see any transactions in the dashboard? Does on test mode the transactions are not shown in the dashboard?
When its on live mode and no payment modes are passed only the checked payment modes from the dashboard will be shown, right?
I cant find a way to test the webhooks, i'm passing the the notifyUrl param but this url is never called, how can i test this?
Any help will be appreciated.
Thanks.
have you been able to figure this out? You can always contact Mollie at info#mollie.com for questions like this.
But to answer them:
When i chose the payment status to be returned as Cancelled and click on Further to your webshop Mollie redirects me to the payment methods page (the page where you choose what payment method to use), is this correct?
This is the expected behaviour when you don't send the payment method (and optionally the issuer, depending on the payment method) yourself. The consumer gets the chance to retry the payment with another method.
If no.1 is correct how should i test failed transaction?
You can press the 'cancel' button to test cancelled payments.
Another option is to specify the payment method. In that case you will be redirected to your website immediately after you selected 'cancelled' as payment status.
After successful transaction i cant see any transactions in the dashboard? Does on test mode the transactions are not shown in the dashboard?
It could be that this was not available at the time you asked your question, but now you can switch the 'test mode' toggle next to the 'refresh' and 'export' buttons.
When its on live mode and no payment modes are passed only the checked payment modes from the dashboard will be shown, right?
In live mode, only the enabled payment methods in your profile are shown. In test mode, all payment methods are active.
I cant find a way to test the webhooks, i'm passing the the notifyUrl param but this url is never called, how can i test this?
For test payments, the webhook should be called also. Make sure that the url is publicly visitable, so no local development URLs. When you need to use local url's, you could use tools like Ngrok.
Related
I am working on integration of liqpay payment gateway to site using their available documentation at: https://www.liqpay.ua/en/doc/checkout.
so far I have integrated their checkout method (client-server). user clicks subscribe and it redirect user to liqpay checkout screen. but problem is when user cancel transaction or it is successful user. user just redirect back to given return flag available in their argument list. without any status code or message in url like other payment gateways do.
Need suggestions on it. if someone has experience in working with Liqpay.
While working around in admin panel i found some thing which help me upto some extent. with these settings i was able to get auto redirect to my site as well as some response from API after cancellation and successful payment. and when user cancel transaction it return back with "code" = cancel. attached are the settings and response in case it helps any one.
Settings
Response
I am implementing PayPal payment to my application.
I am using Laravel Framework and merchant-sdk-php package to handle NVP/SOAP API. I would accually prefer REST API, but i need customers to make Reference Transactions with various amount, in non regular time periods and as far as i know it's possible only with NVP/SOAP API.
The payment flow in shortcut:
1. Payer clicks "connect" button, which is to create billing agreement using "SetExpressCheckout" method. Amount is set to 0 and adding a Billing Agreement field to request. Customer is redirected to PayPal, log in to his account, agreeing to direct debit and finally redirected to my return url.
2. After response is come, return action is fired (the one, which is passed in returnurl field). Next using token from paypal resposne i use CreateBillingAgreement method to get "BillingAgreementID" which i store in database.
3. Using "BillingAgreementID" i make "DoReferenceTransaction" request. No prompt to login is occurring, everything is happening behind the scene. Finally i get response after transaction.
The thinks i want to know are:
1. Is there a way, to get an email address, which consumer used to log in when creating billing agreemenet? I want to show in application which PayPal account (related to mentioned email) is direct debit set to?
2. I want to make some action in databse both after "BillingAgreementID" and "DoReferenceTransaction". Is the response status "Success" and additionally in "DoReferenceTransaction" field "PaymentStatus" set to "Completed" enought to conclude, that transaction is fully completed, and i cant i.e. share some digital goods or should i wait for IPN from this request?
Thanks for all contributions!
Found solution to question 1.
After betting billing agreement id i had to make "GetBillingAgreementCustomerDetails" action. In response i got customer details including email.
Still watching for hint to second question
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.
After successful Sandbox testing for Website Payments Standard, I'm going live now. When I click on a "Buy Now" button, I should be able to see a page that shows me the total quantity on the left, and allows me to log in using PayPal on the right.
But I just get the following page, which also says "Test Site" at the top, although I'm no longer referring to the sandbox:
The error is: Paypal cannot process this transaction because of a problem with the seller's website.
I've done the following things:
Made sure I've changed the API endpoints to live production (basically, eliminate "sandbox" from the URLs.
Made sure I'm using the seller API crendentials from my seller account (not sandbox test API).
I'm using an IPN listener and have set $listener->user_sandbox to false (although I don't think the listener is even loaded yet at this stage).
By the way, if it matters, I'm using PayPal's ButtonManagerAPI to dynamically create hosted buttons, and I'm using NVP API calls with PHP. Everything worked as expected in the sandbox. This was my relevant API code:
"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature&BUTTONCODE=HOSTED&BUTTONTYPE=BUYNOW&L_BUTTONVAR1=amount=".$usd_total
I tested your API request against my account and it is working correctly. It correctly generates a button, and then I am able to go through with a buyer account and make a purchase, so it looks like the issue is with the account you are using to generate the button. Can you provide either the test sandbox email, or the merchant id for the account that you generated the test sandbox credentials from so that I can take a look at the account and see what the issue may be?
I was getting the same error message until I removed the ng-model reference (angularJS) in the button html code.
I was actually getting this issue from simply not having the correct product ID in the form. Once I updated that it worked for me.
Hope this helps!
I'm doing a project involving Paypal, more specifically with the NVP API in PHP. But I just can't seem to figure what to use the IPN feature for.
I mean, when the user has been redirected to Paypal to confirm the purchase, he is redirected back to my website's "Paypal-succes-page", when the transaction is complete. And just to be sure that he actually payed i could use the "PaymentDetails" operation.
Now where does IPN fit in this process? and what is the benefit of it?
Thanks
The integrate with PayPal's services you will notice there are three main channels (and IMO it's important to know this so you can decide the benefits for your application):
IPN: Instant Payment Notification
PDT: Payment Data Transfer
PayPal's API
To use PayPal's IPN you need to add a 'listener' script (example) and add the address to your PayPal account. Whenever an event occurs PayPal will send a message directly to your server via your listener and you then update your accounts appropriately. This is especially useful for running subscription services as events will occur in the background without user intervention and you can capture successful/failed recurring payments etc.
PayPal's PDT is a system for accepting data when a user is redirected back to your site from PayPal. For example, a user clicks 'Buy', they are directed to PayPal, enter information etc. Then, once the payment has been taken, they are redirected back to your site. PayPal can pass details about the transaction including whether it was successful or not so you can display the appropriate success/failed page from your site.
PayPal's API allows you to integrate more deeply with PayPal's services, and you would use this if you were managing payments directly from your site.
These services aren't mutually exclusive, so you can use any combination with your application.
I hope this helps
The IPN feature is a very useful feature which you should use to update your database in my opinion. Sure the user is redirected to your success-page after the purchase where you can validate the payment details.
But what if he closes (by accident or not) the browser before reaching your success page? You will never know the result of the transaction and you will never update your database or process his order accordingly.
When using the IPN you can be sure that the transaction result will always reach you because PayPal will keep on making an offline request to your IPN page until it has reached your servers.
Instant Payment Notification
The typical usage of the IPN is to validate the purchase and to let your script or management system know that the transaction is complete so your system can update any records you may have for your service.
But the most important part is that the transaction is validated.
IPN send all data about transaction to your server - price, items, contacts ... so you can check, if someone don't pay you only 1$ instead of 100$ and confirm your order. It prevets thiefs, cheaters, ... USE IT! ;)