diff --git a/src/StripeConnect.php b/src/StripeConnect.php index 6a06df9..ec6ff67 100644 --- a/src/StripeConnect.php +++ b/src/StripeConnect.php @@ -45,7 +45,7 @@ public static function createCustomer($token, $from, $params = []) self::prepare(); $customer = self::getStripeModel($from); if (!$customer->customer_id) { - $customer->account_id = Customer::create(array_merge([ + $customer->customer_id = Customer::create(array_merge([ "email" => $from->email, 'source' => $token, ], $params))->id; @@ -54,8 +54,8 @@ public static function createCustomer($token, $from, $params = []) return $customer; } - public static function transaction() + public static function transaction($token = null) { - return new Transaction; + return new Transaction($token); } } \ No newline at end of file diff --git a/src/Transaction.php b/src/Transaction.php index 3936e4d..1c78037 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -57,11 +57,11 @@ public function create() return \Stripe\Charge::create(array( "amount" => $this->value, "currency" => $this->currency, - "customer" => $customer->account_id, - "application_fee" => $this->fee ?? null, + "customer" => $customer->customer_id, "destination" => array( "account" => $vendor->account_id, ), + "application_fee" => $this->fee ?? null, )); } } \ No newline at end of file