Paypal REST API - Error on Capture PAYER_CANNOT_PAY - php

We have deployed successfully Paypal on our website. However, every now and then, we get an error when a customer tries to pay.
Here is the error:
{"name":"PAYER_CANNOT_PAY","message":"The combination of payer and payee settings mean that this buyer can't pay this seller.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#PAYER_CANNOT_PAY","debug_id":"fb74a83818f40"}
Unfortunately Paypal's documentation doesn't say much. I also find this error very strange given it happens at the CAPTURE, after EXECUTE and after Paypal reports back to us with a success.
The payments show up in our Paypal account as Pending.
How do I resolve this? Does anyone know what causes this? So far I am unable to see what can cause this or reproduce it in my tests.
Here are the steps taken:
1 - We create a payment object using the REST API and redirect the user to the Approval link
2 - The customer goes to paypal and enters the desired payment information
3 - Our success return URL gets called after the customer completes everythin on the paypal side
4 - We execute the payment
5 - We capture the payment <-- ERROR happens HERE
Thank you!

It's buyer's funding source issue, payment is declined by buyer's card bank. it's not your integration issue. Buyer need to call bank to fix his/her card, then you try to capture the money again.

Related

Paypal Rest Api - recurring payment issue

I'm trying to setup recurring payments in Paypal for my website using REST API, and I have 2 questions/problems:
Can't see transaction details in the paypal checkout page:
For one time payment, I know how to display transaction details by providing values for item_list (as in https://developer.paypal.com/docs/api/).
However I don't know what values we should provide so that recurring payment profile will be shown on checkout page as well.
In the below picture(left side) you can see that no information is presented to the client regarding the payment amount and setup fees.
If I switch to production environment when the user tries to make a recurring payment, the user is redirected to the paypal website and he sees this error:
Sorry, we weren’t able to set up preapproved payments at this time.
Please return to the merchant and choose another way to pay.
So what's the issue with the recurring payment:
Why the user does not see any information regarding the payment amount in checkout paypal checkout page.
Why in production env the user gets that error message?
I'm using this documentation:
http://paypal.github.io/PayPal-PHP-SDK/sample/doc/billing/CreatePlan.html
http://paypal.github.io/PayPal-PHP-SDK/sample/doc/billing/CreateBillingAgreementWithPayPal.html
http://paypal.github.io/PayPal-PHP-SDK/sample/doc/billing/ExecuteAgreement.html
How will I be notified when a paypal client cancel the recurring payment?
It is important for my web application to know when somebody cancel the recurring payment.
I read something about webhooks, is this the way?
Can you give me some documentation?
My location is Romania, if this matters.
Thanks,
Catalin

PayPal Billing Agreement with further non regular Reference Transactions

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

PayPal Adaptive Chained Payments reverse immediately with the information "Your Payment can't be completed.Please return to ... and try again"

My Marketplace has been doing well until 2 days ago. I'm using PayPal chained Adaptive there were 15 Sellers where customers were able to complete the transaction successfully for 10 among 15 sellers. Rest 5 sellers were having an issue. Customer is not able to complete it instead it getting reversed immediately with the information on top of PayPal Screen "Your payment can't be completed. Please return to the participating website and try again".
I'm quite confused why it is behaving like this for few sellers but for rest of them is absolutely working fine. I've tried to contact PayPal support but haven't recieved a single response.
Hereby I have collected IPN trace logs of reversed transaction. Please see below. I replaced Sensitive info with **. Looking forward & excited to know about the cause of the issue, that would be of great help.
IPN Trace:
https://codeshare.io/Maybi

Authorize.net payment gateway not working in WooCommerce

I am developing woocommerce project . I used Authorize.net payment gateway plugin for that.
payment and order placings are working fine.But after get payment that url not redirect to success page .
I want show order info after payment completed. May be my x_relay_url is wrong.
I don't know how to give that .please tell me One example url for that and solve this problem to me...
after payment completed it's showing like this message..
An error occurred while trying to report this
transaction to the merchant. An e-mail has been sent to the merchant informing them
of the error. The following is the result of the attempt to charge your credit card.
This transaction has been approved.
It is advisable for you to contact the merchant to verify that you will receive the
product or service.
NOTE: IT IS IN TEST MODE.
thanks & regards..
This error typically occurs when the payment gateway is unable to POST to the relay response URL you configured. Since the POST is coming from Authorize.Net, the URL must be publicly available.
Also, if you are testing in the sandbox, you should not send transactions in Test Mode. Transactions submitted with test mode only confirm if the API Login and Transaction Key are correct, and returns OK but does not actually process and store a transaction.

Logging PayPal payments in application

I have several ambiguities in using paypal methods and cases, when IPN messages are sent. Im developing app, in which im using paypal(sandbox) for making deposits and cashouts. Each of these both transactions I want to log in my app and here some obscurity raises becouse I need to capture as many cases that may occur. So I'll take it gradually and I'll be thankful also for each partial response.
Firstly, I have some general questions:
In my app, im using BuyNow button, AdaptivePayment methods PAY and PaymentDetails and Merchant method GetTransactionDetails. Are these methods part of Bussines account and for free (there are no monthly fees) right? I cant afford to pay some monthly fees from begining.
May arise any problems, when i'll deploy it to non-sanbox environment?
cashout
For cashout Im using Adaptive payment PAY method.
When My app client make a cashout to his/her paypal account, I can catch through IPN message, that payment is completed and using AdaptivePayment PaymentDetails method and Merchant GetTransactionDetails method I can find out, that there is pending status with paymentreview reason. So on receiver side, where I dont have access, is payment review possibility. Thus receiver can DENY payment and here is a question, how to get information about this user action, becouse an IPN message doesn't come.
Another case that im facing is when client of my app make cashout to
his/her bussines paypal account with different currency from sender
(my bussines paypal account). There is pending status too, but with
reason "multicurrency" in IPN message. Here is similar problem to
previous point 1)... again, I cant get IPN message, which
determine, if user accepted or not the transacion.
deposit
For deposit Im using PayPal standard Buy now button.
PAYER SIDE(my app client): I dont understand, why there is payment
review (accept/deny) in payer account profile, when status of
payment is completed? Is it common behavior only in sandbox
environment? Or is it possible accept/deny payment on payer side in
non-sandbox?
RECEIVER SIDE(my bussines paypal account): There is payment review
too, on receiver side, and if im right, these links (accept/deny)
are similar to links on payer side, arent? There is refund
posibility too, exists some API method to refund programatically?
Correct, each of the products you mentioned do not have a monthly fee.
If a user accepts or denies a pending payment that would trigger another IPN with the completed status. Are you saying you've tested this specifically and you're seeing otherwise?
Receivers would only have to accept/deny in cases where there is currency conversion or maybe they have fraud filters set to flag specific transactions, etc. In most cases there should be no review necessary.

Categories