Reputation: 147
In my website, I am using Braintree payment gateway for both card payments and PayPal transactions with auto renewal subscriptions.
i am creating the customer and storing the card in Braintree vault for auto renewal.. also using the same customer id for that customer PayPal transactions (if happened)
before proceeding the payment, just need to check for active subscription, for both auto renewable and auto renewal cancelled and still expiration date is due subscription existence.
I am new to payments, is there any recommended git projects available? so that it would helps a lot
thanks in advance.
Upvotes: 1
Views: 1341
Reputation: 1949
You can get a customer by id with the customer.find(id)
method. It will return the customer with a paymentMethods
property which contain the subscriptions
associated with it.
Upvotes: 0
Reputation: 896
It sounds like you want to find active subscriptions for a given customer. According to this answer, "customers have a credit_cards
array, and each credit card has a subscriptions
array."
With that in mind, you can iterate through each credit card to grab each subscription. Once you have all the customer's subscriptions you can check their status. Here are the relevant Braintree Developer Docs links for .NET:
Upvotes: 1