# Find the subscription
subscription = Braintree::Subscription.find(sub_id)
# Access the subscription's next billing date
subscription.next_billing_date
# Find the customer
customer = Braintree::Customer.find(cust_id)
# Retrieve the customer's first payment method
pm = customer.payment_methods.first
# Retrieve the subscriptions created with that payment method
subscriptions = pm.subscriptions
# Access the subscription's next billing date
subscriptions.first.next_billing_date
1 回答
假设您有订阅ID:
Braintree::Subscription.find()返回Braintree::Subscription result object .
假设您有一个客户ID:
Braintree::Customer.find()返回Braintree::Customer response object . 客户的payment methods can then be retrieved . 订阅与付款方式相关联 . 获得付款方式后,您可以检索an array of Braintree::Subscription objects .