public function createAsStripeCustomer(array $options = [])
    {
        $options = array_key_exists('email', $options)
                ? $options
                : array_merge($options, ['email' => $this->email]);

        // Here we will create the customer instance on Stripe and store the ID of the
        // user from Stripe. This ID will correspond with the Stripe user instances
        // and allow us to retrieve users from Stripe later when we need to work.
        $customer = StripeCustomer::create(
            $options, $this->getStripeKey()
        );

        $this->stripe_id = $customer->id;

        $this->save();

        return $customer;
    }
public function createAsStripeCustomer(array $options = [])
    {
        $options = array_key_exists('email', $options)
                ? $options
                : array_merge($options, ['email' => $this->email]);

        // Here we will create the customer instance on Stripe and store the ID of the
        // user from Stripe. This ID will correspond with the Stripe user instances
        // and allow us to retrieve users from Stripe later when we need to work.
        $customer = StripeCustomer::create(
            $options, $this->getStripeKey()
        );

        $this->stripe_id = $customer->id;

        $this->save();

        return $customer;
    }
public function createAsStripeCustomer ( array $ options = [ ] ) { $ options = array_key_exists ( 'email' , $ options ) ? $ options : array_merge ( $ options , [ 'email' => $ this -> email ] ) ; // Here we will create the customer instance on Stripe and store the ID of the // user from Stripe. This ID will correspond with the Stripe user instances // and allow us to retrieve users from Stripe later when we need to work. $ customer = StripeCustomer :: create ( $ options , $ this -> getStripeKey ( ) ) ; $ this -> stripe_id = $ customer -> id ; $ this -> save ( ) ; return $ customer ; }
Create a Stripe customer for the given model.

@param  array  $options
@return \Stripe\Customer
Create a Stripe customer for the given model .