braintree / braintree_php

Braintree PHP library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
546 stars 224 forks source link

Search by seller_transaction_id #276

Closed liran-co closed 4 years ago

liran-co commented 4 years ago

Is there a way to search by seller_transaction_id? PayPal only returns the seller_transaction_id with their webhooks and we need to connect it back to a Braintree transaction.

crookedneighbor commented 4 years ago

:wave:

You can use the paypalPaymentId property to look up the transaction based on the seller_transaction_id: https://developers.braintreepayments.com/reference/request/transaction/search/php#paypal_payment_id

You can also search on paypalAuthorizationId https://developers.braintreepayments.com/reference/request/transaction/search/php#paypal_authorization_id

One wrinkle with this is that the paypalPaymentId refers to the PayPal seller_transaction_id for auths, captures, and sales. For charges (where intent=sale in PayPal), the authorization ID is the same as the capture id. When intent=authorize, the capture id is different and searching on the subsequent capture ID is not supported by BT.

liran-co commented 4 years ago

@crookedneighbor Specifically looking at PayPal Webhooks for when disputes are created. PayPal only provides the seller_transaction_id in the payload, but that's not returning any results when using paypalPaymentId.

crookedneighbor commented 4 years ago

@liran-co I'd reach out to our support team so we can help track it down. Be sure to include a link to this issue so I can help point the support person to the right team to help them inspect your account.

https://help.braintreepayments.com/