0

Starging fresh, I logged on to paypal.com and went to the Developer Dashboard.

I created a new app there called, CADESandboxApp. Selected “Merchant” type and sandbox account, sp-facilitator@l.net. I used the following creds (numbers changed and deleted from real ones)

Client ID:AaSu-f_n5N89gp_sjHNeIHPH-tUWbn4R-kHoNvWu2tR6NZJPLyx1dhj0lYx51Jw494e9Md18mcHaHu
Secret:EBqYRx-Lenb4jIcw5_Grs8Kr3jmbB2hdQnwyrNj8qLQl2QbiDi8X8NnRURZmkzUo9GXaoQnxdT0kc
In Features: vault, subscriptions, native checkout SDK, and invoicing are checked and saved

Make a vault payment and get the error:

General The remote server returned an error: (400) Bad Request.
Error: PAYEE_ACCOUNT_INVALID
Message: Payee account is invalid.
URI: https://developer.paypal.com/docs/api/payments/v1/#error-PAYEE_ACCOUNT_INVALID

I verified the creds and was using what I've shown. Code which causes error:

var createdPayment = payment.Create(ppc.apiContext);

ppc.apiContext.config values
    [0]: {[mode, sandbox]}
    [1]: {[clientId, AaSu-f_n5N89gp_sjHNeIHPH-tUWbn4R-kHoNvWu2tR6NZJPLyx1dhj0lYx51Jw494e9Md18mcHaHu]}
    [2]: {[clientSecret, EBqYRx-Lenb4jIcw5_Grs8Kr3jmbB2hdQnwyrNj8qLQl2QbiDi8X8NnRURZmkzUo9GXaoQnxdT0kc]}

Here is the request:

{
  "intent": "sale",
  "payer": {
    "funding_instruments": [
      {
        "credit_card_token": {
          "credit_card_id": "CARD-617234197E5556435MSYQZ6A",
          "expire_month": 3,
          "expire_year": 2027,
          "last4": "xxxxxxxxxxx4004",
          "payer_id": "701",
          "type": "amex"
        }
      }
    ],
    "payer_info": {
      "email": "*****",
      "payer_id": "lutzie43"
    },
    "payment_method": "credit_card"
  },
  "transactions": [
    {
      "amount": {
        "currency": "USD",
        "details": {
          "shipping": "0",
          "subtotal": "10.00",
          "tax": "0"
        },
        "total": "10.00"
      },
      "description": "1xLutzie-43 Safe Driving Habit-Builder - Annual\r\n\r\n  $10.00",
      "invoice_number": "68805",
      "item_list": {
        "items": [
          {
            "currency": "USD",
            "name": "1xLutzie-43 Safe Driving Habit-Builder - Annual\r\n\r\n  $10.00",
            "price": "10.00",
            "quantity": "1",
            "sku": "sku"
          }
        ],
        "shipping_address": {
          "city": "Woodstock",
          "country_code": "US",
          "line1": "117 xxxxxx",
          "line2": "*****",
          "postal_code": "30188",
          "recipient_name": "*****",
          "state": "GA"
        }
      },
      "payee": {
        "email": "*****",
        "merchant_id": "W7SYLKMYANP2S"
      }
    }
  ]
}

What am I doing wrong?

Velocedge
  • 1,222
  • 1
  • 11
  • 35
  • If you have a log of the JSON request and responses of how the "CARD" id was both initially created and then attempted to be used (total of 4 different JSON bodies), add all that information to your question. If you don't have access to it, ask the developer of what you are using for guidance and to troubleshoot the problem. – Preston PHX Jul 19 '23 at 18:21
  • Card was created a long time ago so I'll have to create a new card. I'll create another and try again. I added the request json and the response is what is in the error. – Velocedge Jul 19 '23 at 18:28
  • 1
    That's a different error now than what you started with, 400 code instead of 404 so more of a permission/config issue. You should include the full JSON response with any debug_id but it seems W7SYLKMYANP2S may not be a valid account. you shouldn't specify both an email and a merchant_id , not sure which is being used as the payee here – Preston PHX Jul 19 '23 at 18:34
  • 1
    Also I wouldn't recommend using the v1/payments API for one-time payments anymore, it's fairly old at this point and has been fully replaced by v2/checkout/orders – Preston PHX Jul 19 '23 at 18:38
  • Sorry, I apparently fixed the 404 and nobody had responded so I thought I'd be quick and change it. I'm using the PayPal SDK out of C# so I don't think I can control the V1/payments, it's selected through the SDK. Merchant ID comes from Sandbox account info -> Account ID. I will try again with just the Merchant email. – Velocedge Jul 19 '23 at 19:04
  • 1
    There is a newer Checkout-NET-SDK but both it and the older PayPal-NET-SDK are deprecated, only direct HTTPS API calls (to first get an access token) should be used for new integrations – Preston PHX Jul 19 '23 at 19:06
  • This is not new... been running for years. Works in Production but not in sandbox. I have new functions and can't test them in the sandbox. Anyway, I edited the post and pasted the latest response. Used both the merchant email and then the ID. Neither worked. – Velocedge Jul 19 '23 at 19:13
  • But I'm so confused at this point, if you'll point me to an example of how to use the vault with https API calls, I'll consider switching ;-) – Velocedge Jul 19 '23 at 19:19
  • 1
    For US receiver accounts, https://developer.paypal.com/docs/checkout/save-payment-methods/purchase-later/cards/ -- API examples are in curl and so language/framework agnostic – Preston PHX Jul 19 '23 at 19:31

0 Answers0