PayPal Integration - Credit Card payement

Hi @david,

I’m using the PayPal integration to accept payments through PayPal and Credit Card.

My customer uses a credit card that requires him to do a one time authentication for the payment. I feel like this makes it impossible to automatically bill this customer using this payment method.

When the customer uses the portal to manually pay the invoice and selects the existing payment method (saved from previous successful payment) he gets an error message similar to:

Error processing payment token

Any idea?

Edit:
FYI: PayPal doesn’t log the payment attempt.

Hi,

I suggest creating an issue on GitHub to track this.

@nlantonsch

Are there any logs in the system_logs table for this?

You may also want to check your paypal accout and ensure advanced cards are enabled along with vaulting.

The system_log actiually did log something:

The upper one is the manual payment that was made after the one on the 17th didn’t work.

Vaulting actually wasn’t enabled in PayPal. I just did that, so as I understand, I need one manual payment now, which then stores the payment method in PayPal, not only in Invoice Ninja.

Is there a guide on setting up the PayPal application “correctly”? It’s kinda hard to guess what options have to be enabled and disabled for Invoice Ninja to work as expected.

We don’t have docs on configuring this part as it is pretty new.

You are correct. You would need to remove any existing tokens.

Then get a new payment on file, after that the payment method should be available for future billing.

Hi @david,

auto billing recurring invoices still doesn’t work.

Here is the request from the PayPal API log:

{
  "intent": "CAPTURE",
  "payment_source": {
    "card": {
      "vault_id": "xxxx",
      "stored_credential": {
        "payment_initiator": "MERCHANT",
        "payment_type": "UNSCHEDULED",
        "usage": "SUBSEQUENT"
      }
    }
  },
  "purchase_units": [
    {
      "custom_id": "xxxx",
      "description": "xxxx",
      "invoice_id": "xxxx",
      "amount": {
        "value": "xxxx",
        "currency_code": "EUR",
        "breakdown": {
          "item_total": {
            "currency_code": "EUR",
            "value": "xxxx"
          }
        }
      },
      "items": [
        {
          "name": "xxxx",
          "description": "",
          "quantity": "1",
          "unit_amount": {
            "currency_code": "EUR",
            "value": "xxxx"
          }
        }
      ],
      "shipping": {
        "name": {
          "full_name": "*****"
        }
      }
    }
  ],
  "payer": {
    "name": {
      "given_name": "*****",
      "surname": "*****"
    },
    "email_address": "*****"
  }
}

Response:

{
  "id": "xxxx",
  "status": "COMPLETED",
  "payment_source": {
    "card": {
      "name": "xxxxxx",
      "last_digits": "xxxxxx",
      "expiry": "xxxxxx",
      "brand": "xxxxxx",
      "available_networks": [
        "VISA"
      ],
      "type": "xxxxxx",
      "bin_details": {
        "bin": "xxxxxx",
        "bin_country_code": "FI",
        "products": [
          "CORPORATE"
        ]
      }
    }
  },
  "purchase_units": [
    {
      "reference_id": "default",
      "payments": {
        "captures": [
          {
            "id": "xxxx",
            "status": "DECLINED",
            "amount": {
              "currency_code": "EUR",
              "value": "xxxx"
            },
            "final_capture": true,
            "seller_protection": {
              "status": "NOT_ELIGIBLE"
            },
            "seller_receivable_breakdown": {
              "gross_amount": {
                "currency_code": "EUR",
                "value": "xxxx"
              },
              "paypal_fee": {
                "currency_code": "EUR",
                "value": "xxxx"
              },
              "net_amount": {
                "currency_code": "EUR",
                "value": "xxxx"
              }
            },
            "invoice_id": "xxxx",
            "custom_id": "xxxxxx",
            "links": [
              {
                "href": "https://api.paypal.com/v2/payments/captures/xxxx",
                "rel": "self",
                "method": "GET"
              },
              {
                "href": "https://api.paypal.com/v2/checkout/orders/xxxx",
                "rel": "up",
                "method": "GET"
              }
            ],
            "create_time": "2024-10-17T07:00:07Z",
            "update_time": "2024-10-17T07:00:07Z",
            "network_transaction_reference": {
              "id": "xxxx",
              "network": "VISA"
            },
            "processor_response": {
              "response_code": "5650"
            }
          }
        ]
      }
    }
  ],
  "links": [
    {
      "href": "https://api.paypal.com/v2/checkout/orders/xxxx",
      "rel": "self",
      "method": "GET"
    }
  ]
}

What do I have to do?

error 5650 = SCA required.

token billing not available as customer is not present. I would suggest reaching out to paypal