Comments (18)
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
- When you create the order, you set the payment source as
paypal
and pass that order id to our unbranded card feature - 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 - When retrieving the order, it still shows as
paypal
for the payment source since that's how the order was created.
from paypal-js.
Asking the right folks, hope to have an answer for you.
from paypal-js.
@devchristina Any update ?
from paypal-js.
@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.
Hi @FredericLatour, can you see if paymentSource
works for you? This value should tell you which button was clicked to start the payment flow:
paypal-js/types/components/buttons.d.ts
Line 15 in 1acba3f
Here's an example:
window.paypal.Buttons({
createOrder(data, actions) {
console.log({
paymentSource: data.paymentSource
});
}
})
from paypal-js.
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.
@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.
@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"
As opposed to a "Checkout" (Paypal account).
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.
Are you integrating with PayPal and our unbranded card solution?
from paypal-js.
@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.
@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.
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.
@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.
@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.
what does your order payload look like for paypal vs direct card payment?
from paypal-js.
@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.
@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.
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):
This is also reflected by the payment type of the resulting transaction :
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)
- CSP error for script-src
- https://github.com/paypal/paypal-checkout-components.git[Bug] Bug report
- https://github.com/paypal/paypal-checkout-components.git
- [BUG]: Issue with Sandbox Account Payment Failure HOT 5
- [BUG]: Sometimes paypal subscription details along with total not showing. HOT 2
- Storybook Documentation missing for React PayPal
- [Bug] Incorrect types for `onShippingAddressChange`
- [Bug] sometimes pop up is closed with 500 status error HOT 1
- [Bug] Paypal Modals hidden behind <dialog> modals HOT 1
- [Bug] npm homepage link returns 404
- [Bug] Typescript warning: `resetOptions` cannot be used in dispatch type HOT 1
- [Bug] Error: zoid destroyed all components - when using the messages component in dev mode
- [Bug] PayPalCardFieldsProvider does not render component HOT 3
- [Bug] Paypal Button Click opens Overlay to login and an empty Popup HOT 8
- [Feature] paypal javascript sdk
- How to specify tax, product quantity and other info in product_units HOT 1
- [Bug] PayPalButtons onShippingAddressChange not able to update shipping costs
- [Bug] React-JS Paypal Button Isn't Working in Production for iOS 17 Safari HOT 7
- [Feature] Feature request credit card button as a popup
- Added functionality to test negative response
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paypal-js.