Giter Club home page Giter Club logo

Comments (18)

wsbrunson avatar wsbrunson commented on September 22, 2024 1

The weird thing is that it would not prevent the transaction to properly happen.
Is there a logical explanation regarding what's going on here ?

I only work on the SDK so I can't say for certain but my hunch is that

  1. When you create the order, you set the payment source as paypal and pass that order id to our unbranded card feature
  2. When the buyer clicks the submit button with their card information, the unbranded card feature does what we call confirmPaymentSource where it patches the current order id with the card details and any billing address information. At that point our backend systems must know to process the transaction as unbranded/Direct Card Payment
  3. When retrieving the order, it still shows as paypal for the payment source since that's how the order was created.

from paypal-js.

devchristina avatar devchristina commented on September 22, 2024

Asking the right folks, hope to have an answer for you.

from paypal-js.

FredericLatour avatar FredericLatour commented on September 22, 2024

@devchristina Any update ?

from paypal-js.

FredericLatour avatar FredericLatour commented on September 22, 2024

@devchristina Isn't there any person in Paypal who can provide this information?
It's now m 2 weeks !!
There should be a way to know the type of payment used by the customer (Paypal, Credit card, ...).

from paypal-js.

gregjopa avatar gregjopa commented on September 22, 2024

Hi @FredericLatour, can you see if paymentSource works for you? This value should tell you which button was clicked to start the payment flow:

paymentSource: FUNDING_SOURCE;

Here's an example:

window.paypal.Buttons({
  createOrder(data, actions) {
    console.log({
      paymentSource: data.paymentSource
    });
  }
})

from paypal-js.

FredericLatour avatar FredericLatour commented on September 22, 2024

Hi @gregjopa
Thanks for the feedback.
That's better than nothing but does it mean that PayPal does not keep any information regarding the payment method with a transaction? If for some reason we missed this data ( the paymentSource field on createOrder function) , isn't there any way to retrieve this information for a specific transaction?
That sounds surprising!

from paypal-js.

wsbrunson avatar wsbrunson commented on September 22, 2024

@FredericLatour you can use the Orders API to get details about the order:
https://developer.paypal.com/docs/api/orders/v2/#orders_get

It should return back the payment source used

{
  ...,
  payment_source: {
    [paymentSource]: { ... } // paymentSource will be 'paypal', 'venmo', etc
  }
}

from paypal-js.

FredericLatour avatar FredericLatour commented on September 22, 2024

@wsbrunson
The problem is there is no distinction between a payment using Paypal Account and a Credit Card.
Retrieving the order after the initial capture doesn't provide more information that what is in the initial capture data.

When I check a transaction through your web interface, I can make the difference between a "Direct Card Payment"
image

As opposed to a "Checkout" (Paypal account).
image

How can I discriminate both payment types with certainty (we keep orders in our own database and we obviously want this information).
There are a couple of fields that seem somewhat different though I'm not sure this is extremely reliable. Paypal should be able to clarify this without ambiguity.
For instance, when paying with credit card, Paypal payment source will be empty as opposed to when paying with a paypal account.

payment_source: {
    Paypal: { } 
  }

Can we rely on this difference to discriminate between a Direct Card Payment and a payment using Paypal Account?

Thanks in advance

from paypal-js.

wsbrunson avatar wsbrunson commented on September 22, 2024

Are you integrating with PayPal and our unbranded card solution?

from paypal-js.

wsbrunson avatar wsbrunson commented on September 22, 2024

@FredericLatour have you tried to find details about the transaction using our Transaction Search API? https://developer.paypal.com/docs/api/transaction-search/v1/#search_get

from paypal-js.

FredericLatour avatar FredericLatour commented on September 22, 2024

@wsbrunson Yes, I'm using the Advanced Checkout approach which corresponds to the unbranded card solution. It seems to be a solution that PayPal is pushing right now.

What specific details about the transaction should we use? Which exact field can we depend on? Wouldn't it be more straightforward if PayPal informed us about the data they use to indicate a 'direct card payment'? This would save us from having to explore the entire API and guess which data might serve this purpose ? :)

from paypal-js.

wsbrunson avatar wsbrunson commented on September 22, 2024

If you are using the unbranded card feature and want to differentiate between that and when a buyer used PayPal's Checkout, then this message should apply to you:

@FredericLatour you can use the Orders API to get details about the order: https://developer.paypal.com/docs/api/orders/v2/#orders_get

It should return back the payment source used

{
  ...,
  payment_source: {
    [paymentSource]: { ... } // paymentSource will be 'paypal', 'venmo', etc
  }
}

There should be a single key in the payment_source object that will be paypal if the transaction was completed with PayPal Checkout and card if it was the unbranded.

from paypal-js.

FredericLatour avatar FredericLatour commented on September 22, 2024

@wsbrunson This is not the case, at least not in the sandbox environment. As I mentioned in a previous post, the 'paymentSource' is 'PayPal' in both scenarios. The only difference is that PayPal account details are present when a payment is made using the PayPal Checkout button (as shown in the sample response on the PayPal developer website), whereas an empty object ({}) is present when the payment is made with a card

PD: the term "unbranded card feature" seems somewhat ambiguous to me. I'm using the Advanced Checkout approach which, I suppose, corresponds to the unbranded card solution you are referring to. However, you may want to check in order to ensure this is the case.

from paypal-js.

FredericLatour avatar FredericLatour commented on September 22, 2024

@wsbrunson Any update on this ?
I just tested an "IDEAL" payment and can confirm that I get "ideal" as the payment source but for direct card payment, this is not the case.

from paypal-js.

wsbrunson avatar wsbrunson commented on September 22, 2024

what does your order payload look like for paypal vs direct card payment?

from paypal-js.

FredericLatour avatar FredericLatour commented on September 22, 2024

@wsbrunson I have downloaded and run the

I connected my sandbox and it looks like I'm getting the proper card information as the "payment source". That's weird.
I will double check and compare both source code in order to see if I can find anything.
Any idea/clue that could facilitate my investigation are welcome.

PD: Not sure what you mean exactly by: "what does your order payload look like for paypal vs direct card payment?"

from paypal-js.

FredericLatour avatar FredericLatour commented on September 22, 2024

@wsbrunson I was able to pinpoint the origin of the problem. My payload (I understood in the end what you meant by that) was like the following :

const payload = {
    intent: 'CAPTURE',
    purchase_units: [
        {
            reference_id: product,
            amount: {
                currency_code: currency,
                value: price.toString(),
            },
            description: product,
        },
    ],
     payment_source: {
         paypal: {
             experience_context: {
                 shipping_preference: 'NO_SHIPPING',
             }
         }
     }
}

By removing the payment_source property, I am able to get the proper payment type ("card").
The weird thing is that it would not prevent the transaction to properly happen.
Is there a logical explanation regarding what's going on here ?

from paypal-js.

FredericLatour avatar FredericLatour commented on September 22, 2024

@wsbrunson

Can you confirm that when using Standard Integration (see picture below), in that case there is no distinction between paying using a CC or a PayPal account (the payment_source is paypal in both cases):
image

This is also reflected by the payment type of the resulting transaction :
image

Granting that my observations are correct, how could I possibly determine if the payment was made using a CC or a PayPal Account ?

Update

It looks like for "standard integration", the payment_source is available as part of the data that is passed to createOrder. Most of the examples provided do not even mention this parameter..

On the other hand, for "Advanced integration", you can retrieve the "payment_source" (to make the distinction between cards, and paypal) as part of the data passed to Approve function.

That's honnestly, quite confusing or maybe I'm missing something.

from paypal-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.