mardi 21 juillet 2020

Making an OAuth request with Laravel for Stripe

I was translating following PHP code:

$person = \Stripe\Account::createPerson(
    '', // id of the account created earlier
    [
       'person_token' => $token,
    ]);

To:

$making_user = $stripe->account()->persons()->create(
    $request[0], // id of the account created earlier
    [
       'person_token' => $request[1],
    ]);

Above Laravel code works find without any issue. Does anyone have any idea that what can be the equivalent Laravel syntax of the following:

$response = \Stripe\OAuth::token([
    'grant_type' => 'authorization_code',
    'code' => 'ac_123456789',
]);

I'm using following as equivalent, but it is giving me error of invalid method "oauth"

$making_account = $stripe->oauth()->create([
        'grant_type' => $request['code'],
        'code' => 'ac_123456789',
    ]);

I'm not finding anywhere its syntax anyone have an idea what will be the Laravel syntax of making Oauth call?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2ZNDiRQ
via IFTTT

Aucun commentaire:

Enregistrer un commentaire