Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

182
Views
Capture payment method used to pay with PayPal Checkout/Orders API

I'm using the Standard Integration of PayPal Checkout (via the Orders API), and want to capture the actual payment method - which I believe PayPal calls a "funding source" - that the customer paid with, so that I can pass this value to my server and persist it to my database.

What API object do I need to call to get this information?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

When using JS SDK buttons that call your server, you can track which button on your site was clicked by passing an onClick function; its first parameter will be an object with fundingSource set to e.g. "paypal", "venmo", "card", "paylater". Have it store this to a global or w/e and then you can include this in the JSON body sent to your server when capturing an order from onApprove.

However, the actual funding method that the payer ended up using might not correspond to that initial click selection, and is not returned; this and all other billing information is kept private to the payer in PayPal by design.

about 4 years ago · Juan Pablo Isaza Report

0

This is a similar approach to the one that Preston outlines, and in the same way it has the limitation that it only returns the funding source of the button that's initially selected rather than the one that the user actually paid with (as this can be changed by the user from within the PayPal modal).

It seems that this is currently the closest that those using the Standard integration of PayPal Checkout can get to obtaining the payment method the user actually paid with because, for some reason, PayPal only sees it necessary to expose that information (which does exist in the API) to developers who have implemented the Advanced integration.

This is a disappointment if you're someone like me who's invested considerable time in integrating the Standard integration only to find out too late (thanks to poor documentation of both the integrations and the API) that the Standard integration can only access a crippled version of the API that has limited data.


In your client-side JavaScript, add fundingSource: fundingSource and any other variables you want to grab from the order data:

paypal.Buttons({

...

onApprove: function (data, actions) {
    return fetch("/route/to/paypal/capture", {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
        },
        body: JSON.stringify({
            fundingSource: fundingSource, 
            // Add any other variables you need here
        }),
    })

...

Then, when capturing the payment on your server, use:

$data = json_decode($request->getContent(), true);
...
$payment_method = $data["fundingSource"];
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!