braintree / braintree_node

Braintree Node.js library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
334 stars 104 forks source link

Search subscriptions by customerId #128

Closed mgarchagudashvili closed 6 years ago

mgarchagudashvili commented 6 years ago

Is there a way to search subscriptions by customerId? Also, if customer object would return subscriptions object directly would be more helpful. Currently, I can get subscriptions under payment methods objects.

sdcoffey commented 6 years ago

Hey @mgarchagudashvili,

Thanks for the feedback, that's useful for us to hear. Currently, there is no way to search subscriptions through a customer id.

What you can do, however, is a customer find, which will return you information about a customer, including payment methods, which in turn contain subscriptions associated with that customer.

I'm going to close this issue, but please let me know if I'm misunderstanding your request and the above recommendation doesn't fit your use case.

ginovski commented 4 years ago

@sdcoffey What about when customer deleted their payment method? Currently, I have an issue that I can't get transactions and subscriptions from customer.id when the payment method is deleted.

crookedneighbor commented 4 years ago

@ginovski reach out to our support team for help with your integration: https://help.braintreepayments.com/

newpdv commented 4 years ago

@sdcoffey What about when customer deleted their payment method? Currently, I have an issue that I can't get transactions and subscriptions from customer.id when the payment method is deleted.

I can assume that if the payment method is deleted, the subscription can no longer exist

ChuckJonas commented 4 years ago

@newpdv

Just tested this and subscription will still exist but will be canceled.

It will no longer show up in the getCustomer response (as the payment method goes away). So there is no way to get canceled subscriptions for customers on deleted payment methods.

paq85 commented 3 years ago

Just tested this and subscription will still exist but will be canceled. It will no longer show up in the getCustomer response (as the payment method goes away). So there is no way to get canceled subscriptions for customers on deleted payment methods.

This is quite a big limitation :|

benheb commented 3 years ago

@ginovski did you ever find a solution for this?

gwdp commented 3 years ago

Going through an app integration with Braintree and was looking for the same thing.

If using drop-in UI I believe this might be an issue, but if doing self implementation maybe would be a good idea to prevent a user from deleting a payment method if associated with a subscription and ask for a new payment method to be associated with that subscription before allowing to delete that payment method.