protected function getSubscriptionPayload($customer, array $options = [])
    {
        $plan = BraintreeService::findPlan($this->plan);

        if ($this->skipTrial) {
            $trialDuration = 0;
        } else {
            $trialDuration = $this->trialDays ?: 0;
        }

        return array_merge([
            'planId' => $this->plan,
            'price' => number_format($plan->price * (1 + ($this->owner->taxPercentage() / 100)), 2, '.', ''),
            'paymentMethodToken' => $this->owner->paymentMethod()->token,
            'trialPeriod' => $this->trialDays && ! $this->skipTrial ? true : false,
            'trialDurationUnit' => 'day',
            'trialDuration' => $trialDuration,
        ], $options);
    }
protected function getSubscriptionPayload($customer, array $options = [])
    {
        $plan = BraintreeService::findPlan($this->plan);

        if ($this->skipTrial) {
            $trialDuration = 0;
        } else {
            $trialDuration = $this->trialDays ?: 0;
        }

        return array_merge([
            'planId' => $this->plan,
            'price' => number_format($plan->price * (1 + ($this->owner->taxPercentage() / 100)), 2, '.', ''),
            'paymentMethodToken' => $this->owner->paymentMethod()->token,
            'trialPeriod' => $this->trialDays && ! $this->skipTrial ? true : false,
            'trialDurationUnit' => 'day',
            'trialDuration' => $trialDuration,
        ], $options);
    }
protected function getSubscriptionPayload ( $ customer , array $ options = [ ] ) { $ plan = BraintreeService :: findPlan ( $ this -> plan ) ; if ( $ this -> skipTrial ) { $ trialDuration = 0 ; } else { $ trialDuration = $ this -> trialDays ? : 0 ; } return array_merge ( [ 'planId' => $ this -> plan , 'price' => number_format ( $ plan -> price * ( 1 + ( $ this -> owner -> taxPercentage ( ) / 100 ) ) , 2 , '.' , '' ) , 'paymentMethodToken' => $ this -> owner -> paymentMethod ( ) -> token , 'trialPeriod' => $ this -> trialDays && ! $ this -> skipTrial ? true : false , 'trialDurationUnit' => 'day' , 'trialDuration' => $ trialDuration , ] , $ options ) ; }
Get the base subscription payload for Braintree.

@param  \Braintree\Customer  $customer
@param  array  $options
@return array
@throws \Exception
Get the base subscription payload for Braintree .