Using new Paypal Rest API does not accept payment in GBP - paypal

I get a 400: Bad Request error when trying to make payment in GBP, where as USD is working fine. I am getting this error since last few days earlier it was working fine, I think the issue has started after Paypal has made changes to its site rencently.
Also all the payment is going to a default sandbox account (it has a word facilitator appended to it, I did not create this account) I am not sure if I can change and set a sandbox account that I created as default account for receiving payment. Any idea?
Any suggestion would be helpful.

Currently the REST API's only support USD, passing a different currency can cause errors to be generated. There are plans to eventually support additional currencies, but currently it is only set up for USD.

Related

PayPal sandbox test accounts - inconsistent results

While testing payments in the sandbox using SetExpressCheckout, GetExpressCheckoutDetails, and DoExpressCheckoutPayment, testing works as expected.
Payments are reflected in the developer portal and in the test account. The developer account and test accounts are more than 3 years old.
However, when using a new test account created in the last 30 days, the same test fails without error and are payments are not reflected in the test account or in the developer portal.
I suspect that there may be some difference between the older test accounts and the new. Any thoughts?
First of all, why are you testing deprecated NVP APIs that are several generations old, instead of REST v2/checkout/orders (with or without a modern UI for approval) ?
It's hard to say what specifically the problem might be since you don't share any API responses, but at a guess the email address of the sandbox receiver account is not confirmed.
Check in https://www.sandbox.paypal.com/businessprofile/settings/email , resend confirmation message as needed
Read confirmation messages in https://www.paypal.com/signin?intent=developer&returnUri=https%3A%2F%2Fdeveloper.paypal.com%2Fdeveloper%2Fnotifications%2F , and log in again to confirm
If that's not the issue, you'll need to share API responses.

Invalid or unsupported currency code paypal error when using multiple currency

I am using payflow pro. When I use currency code 'USD' all payment flow's works fine. But when I change currency code to 'CAD' it will return error with result code 06 which means Invalid or unsupported currency code. How to solve this problem?
This is not problem with your code.
Following https://developer.paypal.com/docs/classic/api/currency_codes/
Payment Receiving Preferences
If you have a PayPal Premier or Business account, configure your Payment
Receiving Preferences to handle payments automatically. You can convert
any payment into your primary currency or block certain types of payments.
You can set the following:
Block or unblock payments from U.S. customers who don’t have a confirmed address.
Block or unblock payments sent to you in a currency you don’t hold.
Block or unblock payments for duplicate invoice IDs.
Block or unblock payments from customers who have non-U.S. PayPal accounts.
Block or unblock payments from Student Account holders.
Log in to your PayPal business account at www.paypal.com. Click the
profile icon (Profile menu) on the top right side of the page. From the
Business Profile menu, select Profile and Settings.
Note: If you do not see the profile icon on the top right, select
Profile which appears in the top menu when the My Account tab is selected.
From the left menu, click My selling tools.
In the Getting paid and managing my risk section, click the Update link
for the Block Payments item.
Update your settings and click Save.
Just happened to hit this problem with Magento 2.3.1, when paying with credit card against PayPal Payflow Pro. Our default currency for the store is "CAD".
The support team is super, after our several failed transactions they managed to figure our the problem, let me share their reply here:
Thanks for reaching out today. Happy to help.
It looks as though this is an issue with the currency code you're passing. Right now it appears you're trying to pass USD in on the $0.00 verification call, but CAD on the actual 2.20 transaction itself. When you verify a card, the transaction you attempt against that verification must use the same currency. Try passing the subsequent transaction with USD, or create the verification in CAD and then run the transaction against it using CAD. See https://developer.paypal.com/docs/classic/payflow/integration-guide/#submitting-account-verifications for more on verifications. That's a great resource for Payflow in general as well.
That should resolve the issue you're seeing, but please let us know if you run into any other issues.
I hope that helps. Let us know if you have any questions.
That says for two API calls from our server (Magento 2.3.1) to PayPal need to specify the same currency code. While our first API call which sending amt=0 field doesn't have separate currency field there, so I guess the default value was assigned which is "USD". While the second API call which sending the real amt number had currency=CAD field, that might confused the API and eventually refused by it.
For Magento 2.3.1 the fix is to add the currency filed for the first API call, which the same idea may apply to other conditions as well.
Here is the Magento fix in case you are interested.

Payout in Sandbox

Paypal newbie here. I am using the .net sdk to call PayPal's rest api in the Sandbox environment. I am trying to test a batch payout(Mass Payment).
Issue 1. The sandbox "facilitator" account which came pre-created has a zero balance. I cant seem to find any way to get some money in the account so that i can test payouts. If i create a new business account, i get to specify an opening balance, but when i try to do payouts using this new account, i get back a 403 forbidden response when i try to payout even though i am able to get a token successfully.
Issue 2: Using the facilitator account, i am able to submit a payout request, but its behavior seems to have changed since a couple of day ago. A few days ago, all payout request used to be DECLINED and would show up on the transactions list on the sandbox site. I assumed they were getting DECLINED because the balance was zero. Since yesterday, all payout transactions via the facilitator account stays in PENDING stage and they do not show up on the transaction list. A Payment/Get request for the payout_batch_id always returns back as pending even aftter a day, but theres no sign of those transactions on the sandbox site.
1 - Creating a fresh account and giving it an opening balance is correct, and that should work just fine for you to test MassPay. If you're getting a 403 error that sounds like a problem with your API endpoint or something. Need to see a sample of the API request/response to know more on that.
2 - Again, need to see a sample of the API request/response that you're getting to know more here. My MassPay transactions in the sandbox work just fine. Here's an example. You'll see the request and response data there, showing it was successful. Then when I go look at the separate accounts I see the money as expected.

Payment status remains "Pending"

I integrated PayPal in my web shop in order to allow instant payments with automatic product delivery (already had this before but only with instant wire transfers via sofort.com). I integrated it with the help of the example provided by PayPal (I'm using ReviewOrder.php, GetExpressCheckoutDetails and DoExpressCheckoutPayment).
It's working great if they pay with PayPal balance or a linked credit card. However, some customers from Germany don't have balance in their accounts but only a bank account linked to their account. The payments go through and they receive their product, however I noticed the payment status would remain "Pending" for 1 month and change to "Expired" afterwards, so effectively no money arrives.
Why is this happening? Or is there any way to deny such payments? (Payments from backup funds)
Any help would be appreciated.
Its hare to day with out looking at the transaction specifically. But there are several things that can cause your payment to be pending, such as your preferences that you may have set in the account. Check to make sure you dont have your preferences set to ask me before accepting a payment in a currency that you do not hold. Did the buyer pay with an eCheck? If so, it could be waiting for the payment to clear. If this is in the sandbox, you have to manually clear the payment. If you are still not able to determine the cause of the pending payment, if you provide the transaction id, I will check it on my end.
Hey guys I managed to find a solution to this odd problem after all.
It turned out I had the following code in my implementation where I actually initialized the payment process:
$_REQUEST['paymentType'] = "Order";
This was a mistake though, since this payment type won't place a hold on the funds and if the DoCapture call is never called this payment will remain pending for about one month and then expire entirely (as described in my question, so this is what actually happened to me). The bad thing is that it's impossible for such payments to even accept them manually from within PayPal (not even the local PayPal phone support was able/wanted to accept these payments for unknown reasons because they told me they'd come up with a solution and contact me via Email within 24 hours but they never did).
So in order to fix this issue I changed the payment type to Sale which instantly captures the payment rather than waiting for sort of approval or a capture call. It worked fine for two weeks now and I think I'll leave it like this now.
$_REQUEST['paymentType'] = "Sale";
I lost about 110€ because this stupidly trivial detail but at least it's working fine now and I was able to re-enable PayPal as a payment form. I hope they'll at least add an option to manually accept these payments if the DoCapture call was not implemented because it worked fine without it for most of the payments as well and after all this is still about real money, so this absolutely would be an essential thing to have....
This can happen also if you are trying to accept a payment in a different currency of your account. To avoid that you must create a "PayPal balance" in the currency of the payment.
IPN is also giving hints on the pending reason in this case:
[pending_reason] => multi_currency

How to verify paypal reference transactions is enabled

Hi I'm setting up paypal pro for a client. I need reference transactions to work as we would have to bill the customer each month and sometimes the amount may vary.
Credit card payment
The code flow has been tested with paypal sandbox and it completely works. But with the real account we get the following error.
"This transaction cannot be processed. Please contact PayPal Customer Service."
Paypal Account Payment/Express Checkout
It did not work with paypal sandbox too owing to reference transactions not being enabled. i'm facing a similar situation with the paypal pro account too. I get the error
"Merchant not enabled for reference transactions"
We sent a request to paypal asking them to enable reference transactions. They replied back assuring they did but I still get the same error. I even tried removing the current api signature and recreating a new one. But I still get the same error.
Has anyone faced a similar situation ?
Is there any sure way of verifying if reference transactions is enabled?
If it is not, is there a way to enable it other than going through paypal's customer service (it's appalling) ?
Yes it's easy.
Just try to make a payment with a billing agreement.
Just above the confirmation message on the PayPal website it will show:
Use PayPal for future payments to XXX Inc. Payments will be made with
your default payment method unless you select a preferred payment
method. To make changes, go to My money in your Profile, and update
the My preapproved payments section.
If you don't see that message they're not enabled (or your request is wrong). But of course you can check in the sandbox to make sure the request is correct.