Paypal PAYEE_ACCOUNT_INVALID

21 Views Asked by At

I am attempting to collect payments from my clients by using their credit card information using the nodejs paypal-rest-sdk

const paymentData = {
intent: 'sale',
payer: {
payment_method: 'credit_card',
funding_instruments: [
{
credit_card: {
number: '****',
type: 'visa',
expire_month: **,
expire_year: ***,
cvv2: '***',
first_name: 'John',
last_name: 'Doe',
},
},
],
},
transactions: [
{
amount: {
total: '10.00',
currency: 'USD',
},
payee: {
merchant_id: 'mymerchantid',
},
description: 'Some description',
},
],
};
paypal.payment.create(paymentData, ....)

When i run this code i get an error PAYEE_ACCOUNT_INVALID.

Is there something i need to enable in my account in order to allow this payment to go through and debit my account?

I would prefer not to use the hosted UI as the payments are collected via consultants over the phone.

I am currently using sandbox.

1

There are 1 best solutions below

0
Preston PHX On

Using the v1/payments API for credit card processing was deprecated a long time ago. Your account is not (and will not be) set up to receive such payments, therefore it is invalid, hence the error message.

Moreover, at the time of this writing all server-side SDKs for PayPal APIs are deprecated. Only direct HTTPS (no SDK) integrations of first obtaining an access_token and then sending API requests in JSON format are supported.

See the Standard and Advanced integration guides.