three3
three3

Reputation: 2846

Set the Number of Billing Cycles via the Braintree API

I am implementing Braintree Payments into our website and I have ran into a problem when trying to create a subscription. I want to override a "Plans" detail for a custom subscription. I am trying to set the "number of billing cycles" via the API using PHP. I cannot seem to get it to work. In the API documentation, it says "You can override the plan price, trial duration, start date, number of billing cycles per subscription, and add-on and discount details." Here is the link: https://www.braintreepayments.com/docs/php/subscriptions/create#overriding_plan_details

$result = Braintree_Subscription::create(array(
         'paymentMethodToken' => $payment_method_token,
         'planId' => 'r45g',
         'price' => "{$_SESSION['enroll-draft-amount']}",
         'billingCycles' => '7'
    ));

This billingCycles setting does not work. Anyone know what the correct setting is?

Thanks

Upvotes: 1

Views: 660

Answers (1)

three3
three3

Reputation: 2846

I figured it out. Hope this helps someone else. The correct setting is: numberOfBillingCycles

Upvotes: 1

Related Questions