laravel 5 stripe error -


im using laravel 5 , cashier. working except adding cards customer. i'm missing something, don't know what.

i these 2 errrors:

1. stripe notice: undefined property of stripe_customer instance: cards  2. php fatal error:  call member function create() on null in /app/repositories/billing/stripegateway.php on line 56 

the create being referenced:

public function createcard($customer_id, $token) {     $cu = customer::retrieve($customer_id);     //1 $card = $cu->card->create(["source" => $token]);     //2 $card = $cu->source->create(["source" => $token]);         $card = $cu->source->create(["card" => $token]);     return $card; } 

basically looks customer object isn't referencing card/source object... don't know need do.

any appreciated

ok helps read api. correct implementation is

$card = $cu->sources->create(["source" => $token]); 

notice sources plural.. using source not source. spent way time tinkering things no reason.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -