public function subscribeExistingCustomerToPlan($customerId, $planId, $parameters = [])
    {
        $data = [
            'customer'      => $customerId,
            'plan'          => $planId
        ];

        if ($parameters && is_array($parameters)) {
            $data = array_merge($parameters, $data);
        }

        return Subscription::create($data);
    }
public function subscribeExistingCustomerToPlan($customerId, $planId, $parameters = [])
    {
        $data = [
            'customer'      => $customerId,
            'plan'          => $planId
        ];

        if ($parameters && is_array($parameters)) {
            $data = array_merge($parameters, $data);
        }

        return Subscription::create($data);
    }
public function subscribeExistingCustomerToPlan ( $ customerId , $ planId , $ parameters = [ ] ) { $ data = [ 'customer' => $ customerId , 'plan' => $ planId ] ; if ( $ parameters && is_array ( $ parameters ) ) { $ data = array_merge ( $ parameters , $ data ) ; } return Subscription :: create ( $ data ) ; }
Associate an existing Customer object to an existing Plan.

@throws HttpException:
- If the customerId is invalid (the customer does not exists...)
- If the planId is invalid (the plan does not exists...)

@see https://stripe.com/docs/api#create_subscription

@param string $customerId: The customer ID as defined in your Stripe dashboard
@param string $planId: The plan ID as defined in your Stripe dashboard
@param array $parameters: Optional additional parameters, the complete list is available here: https://stripe.com/docs/api#create_subscription

@return Subscription
Associate an existing Customer object to an existing Plan .