0

I have looked all over the internet and cannot find the proper format in a php create subscription call to add a discount. I can create the subscription just fine but no matter how I format the discount call it tells me I have an invalid format. I know the problem lies in my discounts code but I can't seem to figure it out.

$subscription = Braintree_Subscription::create(array(
'paymentMethodToken' => $token,
'planId' => 'monthly35',
'discounts' => array('add' => array('inheritedFromId' => '2free'))
));
Jeff_P
  • 71
  • 7

1 Answers1

2

hope this helps anyone stuck, below is the correct format for adding a discount

$subscription = Braintree_Subscription::create(array(
'paymentMethodToken' => $token,
'planId' => 'monthly35',
'discounts' => array('add' => array( array('inheritedFromId' => 
'2free')))
));
Jeff_P
  • 71
  • 7