How to test Failed/Denied transactions in paypal sandbox - paypal

I am performing tests in SANDBOX.
I am implementing Website Payment Standard on my website.
I have tested successfully Completed transactions (payment_status Completed) .
I need to test Failed and Denied transactions but I am not able to do it.
If there is a test card for Failed or Denied transactions in Sandbox, please provide.
I tried with an invalid credit card to create a Failed or Denied transaction and I got an error that appeared on the same page (I imagine that was a result of Javascript validation) but I did not receive any reply to my IPN listener on the server and there should have been a redirection to an URL specified in the HML form as URL for invalid operations.
I understand that a result of each transaction independently of its payment status should be received by my IPN listener. It receives Completed transactions so I imagine it should received Failed or Denied ones too.
I used IPN simulator (developer.paypal.com) to create Failed/Denied transactions and I did receive them with my IPN listener so I imagine it is not a problem with the listener. I just cannot create these transactions from my page directly.
Thanks and best regards,
Anna

You will have to enter error code at the place of amount https://developer.paypal.com/docs/classic/api/errorcodes/
When you will set error code number at the place of amount paypal detect what type of transaction it is.
profile = PAYPAL_EXPRESS_GATEWAY.recurring(10502, nil,
:description => plan.description,
:start_date => Time.now,
:period => 'Day',
:frequency => 1,
:auto_bill_outstanding => false,
:token => params[:token],
:max_failed_payments => 1
)
in above code I set 10502 at the place of payment and when you see the doc https://developer.paypal.com/docs/classic/api/errorcodes/
error code details are:
10502 Invalid Data This transaction cannot be processed. Please use a valid credit card. The credit card used is expired. Recurring Payments
and you will get APN with failed transction.
I hope this will help you

Related

Paypal payment execute transaction refused

Everything is good at sandbox environment, but something wrong in production.
First, i created a payment with enough information. It's still good.
Second, I redirect to apprvoved url for end user, user accepted payment.
Lastly, i make a request execute payment within payerId, but i received response error, it's return 400 and message name TRANSACTION_REFUSED.
Anyone help me!
Detail payment: here
Detail error: here
The payment attempt was rejected by PayPal. This error is normal behavior when a payment is declined.
Have the user use a different account or payment method.
Unrelated to the decline issue, you are using a deprecated v1/payments API, which should not be used for any new integrations. Here is how to change to a current v2/checkout/orders integration:
Make two routes on your server, one for 'Create Order' and one for 'Capture Order', documented here. These routes should return only JSON data (no HTML or text). The latter one should (on success) store the payment details in your database before it does the return (particularly purchase_units[0].payments.captures[0].id, the PayPal transaction ID)
Pair those two routes with the following approval flow: https://developer.paypal.com/demo/checkout/#/pattern/server

Magento 2.3.2 PayPal Payflow Payment failed

When a customer places an order from the shop (Magento 2.3.2) using PayPal PayFlow Credit Card payment method but sometimes payment failed for some of the customers and there is no any message displaying on the checkout page.
When place order button hit PayPal generates the secure token to for the further transaction. Let me explain you step by step.
Place order button hit
PayPal generates securetoken and securetokenid
PayPal authorize the transaction with AMT : 0
PayPal response with the error message on step : 3 requests.
'RESPMSG' => 'Field format error: 10004-The transaction id is not valid',
I see the API docs from the PayPal but PayPal not stated clearly any specific error message. They have written generic error message. Please check in this screen shot.
https://i.imgur.com/2od4nIr.png
If anyone help on this to know exact reason for the transaction failed that will help us or customer to understand in better way rather then to show a generic message from the PayPal error message.
Looking forward to hearing for a solution.
I suggest you contact support for this issue as changes were put in place due to rate limiting and other item for merchants who are on Magento due to this issue, https://support.magento.com/hc/en-us/articles/360025515991-PayPal-Payflow-Pro-active-carding-activity.

We get paypal error 10423 with no clue what is wrong

We are a big webshop provider, and we have thousands of webshops in our system.
We have a case where we get an error in DoExpressCheckout with PaymentAction of Authorization here is the error
Ack: FAILURE
Build: 000000
Version: 117.0
Timestamp: 2017-04-06T08:54:36Z
CorrelationID: 4d6d16d1d30fa
ErrorCode: 10423
SeverityCode: ERROR
ShortMessage: Transaction refused because of an invalid argument. See additional error messages for details.
LongMessage: This transaction cannot be completed with PaymentAction of Authorization.
We have no clue what is wrong. Because it happens for specific paypal account of a specific customer.
We have two shops / one of a customer of us. Where we get the error. We made another shop in our system where we connected a paypal verified business account and then with another real personal account we bought an item from that shop and it all works. No errors.
We tried to the the same for this problematic customer and we get the error. We are sure that the code we use is the same in both cases and there is no difference in our handling. So the question is what could be wrong on the other paypal business account?
Could it be an SDK problem?
Did you even try to google it? I googled 'paypal 10423' and found:
Issue PayPal returned API error code 10423 - This transaction cannot be completed with PaymentAction of Authorization. Cause You set PaymentAction to "Sale" with SetExpressCheckout at the first API call.
Not sure if this article may help you:
https://www.paypal-knowledge.com/infocenter/index?page=content&expand=true&locale=en_US&id=FAQ1015
Apparently its because your setting the payment action to sale on a SetExpressCheckout then switching to Authorization. Paypal doesn't allow this and advises to set the PaymentAction to Authorization with the SetExpressCheckout then swap to Sale when setting the DoExpressCheckout call.
This is how we post the request to SetExpressCheckout:
SetExpressCheckoutRequestDetailsType req = new SetExpressCheckoutRequestDetailsType();
.....
PaymentDetailsType paymentDetails = new PaymentDetailsType();
paymentDetails.PaymentAction = PaymentActionCodeType.AUTHORIZATION;
paymentDetails.ShipToAddress = ....
req.PaymentDetails.Add(paymentDetails);
So we are 100% sure we use Authorize, and we do the same for DoCheckout, so it seems like PayPal is thinking we did Sale as PaymentAction why is that?

sandbox : how to get paypal payment details if failed to return back? -PHP

I am using Paypal Sandbox for at my site to process payments.
I am saving payment stuffs after the user returned successfully to the store using an URL defined for payment successful/canceled.
But suppose the user loses connection due to any technical issue (e.g. server down or failed internet connection), then how I will get the payment details, especially in cases of the paid orders?
Hi please check this below URL
https://www.asp.net/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/checkout-and-payment-with-paypal

PayPalRESTException with response as CREDIT_CARD_REFUSED. How to get the cause of this refusal

I was trying to make a transaction through PayPal REST API using a saved credit card in live environment.
I have got a PayPalRESTException with response as CREDIT_CARD_REFUSED.
Here is the error message:
Error code : 400 with response : {"name":"CREDIT_CARD_REFUSED","message":"Credit card was refused","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#CREDIT_CARD_REFUSED","debug_id":"<some number>"}
Now I want to know why the card is refused and how to get any info. from this debug_id.
Is there any way to get all these failed transaction details in PayPal merchant account?
Note: The card was previously authorized and saved in paypal
Merchants aren't usually told the reason for a CC refusal. It's none of their business after all. It's between the CC provider and the cardholder.