问题
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.
- is there any predefined methods for verifying that one with .net code?
I am new to payments, is there any recommended git projects available? so that it would helps a lot
thanks in advance.
回答1:
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:
- customer.CreditCards
- creditCard.Subscriptions
- subscription.Status
来源:https://stackoverflow.com/questions/49074527/search-for-active-subscription-for-a-customer-in-braintree-payments