braintree / braintree_java

Braintree Java library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
158 stars 98 forks source link

PayPal - PaymentMethodNonce.find() #72

Closed GaL3n closed 5 years ago

GaL3n commented 5 years ago

General information

Issue description

PaymentMethodNonce.find() in PHP returns useful PayPal buyer information at Server Side level as the Payer ID or Shipping Address selected by the user on PayPal pages.

The Java SDK seems that doesn't have any method to access those data, that actually are transferred to the merchant server,

Can you please consider to add a specific method to allow merchants to treat this data before the payment is done ?

Thanks, Stefano

quinnjn commented 5 years ago

This method is available, here is the reference documentation for find.

All the server SDKs should have the same methods that return the same data. If you see any discrepancies let us know!

GaL3n commented 5 years ago

Hey guys,

there are discrepancies with data returned back. PHP returns more information (see below) than Java.

Braintree\PaymentMethodNonce Object

(

[_attributes:protected] => Array

    (

        [type] => PayPalAccount

        [nonce] => 3580b414-25ac-0656-5bca-e013a9ce4be3

        [description] => PayPal

        [consumed] =>

        [details] => Array

            (

                [correlationId] => EC-7M3034294S918081A

                [payerInfo] => Array

                    (

                        [email] => redacted

                        [firstName] => redacted

                        [lastName] => redacted

                        *[payerId] => T6F4YU5NZ77J8*

                        [countryCode] => redacted

                        [billingAddress] => Array

                            (

                                [line1] => redacted

                                [line2] =>

                                [city] => redacted

                                [state] => redacted

                                [postalCode] => redacted

                                [countryCode] => redacted

                            )

                        [shippingAddress] =>

                    )

            )

    )

)

On Mon, Jun 3, 2019 at 6:50 PM Quinn J Neumiiller notifications@github.com wrote:

This method is available, here is the reference documentation for find https://developers.braintreepayments.com/reference/request/payment-method-nonce/find/java .

All the server SDKs should have the same methods that return the same data. If you see any discrepancies let us know!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/braintree/braintree_java/issues/72?email_source=notifications&email_token=AIMLXRIERDZ5LCEAKCLPL3DPYVDTRA5CNFSM4HSJTYL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW2AKYI#issuecomment-498337121, or mute the thread https://github.com/notifications/unsubscribe-auth/AIMLXRK6RMOOIWMLTW35E3TPYVDTRANCNFSM4HSJTYLQ .

quinnjn commented 5 years ago

Payer ID looks available in 2.89.0.

GaL3n commented 5 years ago

Can you please check if you are able to retrieve the payerID using PaymentMethodNonce.find() ?

Thanks

Il giorno lun 3 giu 2019 alle 19:50 Quinn J Neumiiller < notifications@github.com> ha scritto:

Payer ID looks available in 2.89.0 https://github.com/braintree/braintree_java/blob/caf7a347cce74df2be2b4f713ba1f44117a0f022/CHANGELOG.md#2890 .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/braintree/braintree_java/issues/72?email_source=notifications&email_token=AIMLXRPQXVPAUSUEIB3TK53PYVKW7A5CNFSM4HSJTYL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW2FT5Y#issuecomment-498358775, or mute the thread https://github.com/notifications/unsubscribe-auth/AIMLXRPEOBTIK3THPP2TJFDPYVKW7ANCNFSM4HSJTYLQ .

crookedneighbor commented 5 years ago

In 2.89.0, we added the ability to pass the payer id in the transaction create call. We did not add an accessor to retrieve it from the payment method nonce class. (nor is it documented in the response object)

The reason PHP has it is because there's a bit of magic in how the accessors are added, so it automatically gets new attributes as they are added to the API. Java though requires an explicit method to be added for the properties, and that does not exist for the all the properties on the details node: https://github.com/braintree/braintree_java/blob/caf7a347cce74df2be2b4f713ba1f44117a0f022/src/main/java/com/braintreegateway/PaymentMethodNonceDetails.java#L18-L29

Thanks for reporting it, it's on our radar.

In the meantime, you have the payment method token, so you can still look up the payer id using the payment method object: https://github.com/braintree/braintree_java/blob/caf7a347cce74df2be2b4f713ba1f44117a0f022/src/main/java/com/braintreegateway/PayPalAccount.java#L58-L60

crookedneighbor commented 5 years ago

Ignore what I said about the vaulted payment method stuff. I forgot that paymentMethodNonce.find takes a nonce, not a vaulted payment method token.

We're looking into this.

crookedneighbor commented 5 years ago

This is fixed in 2.97.0 https://github.com/braintree/braintree_java/blob/master/CHANGELOG.md#2970