samedi 16 novembre 2019

paymentMethods() return always empty object result

  • Cashier Version: ^10.5
  • Laravel Version: ^6.0
  • PHP Version: 7.3.5
  • Database Driver & Version:

Description:

paymentMethods() retrieve always array with empty object.

public function userAllPaymentMethods(Request $request)
    {
        $user = User::find(5);
        $paymentMethod = $user->paymentMethods();
        return response($paymentMethod);
    }

Result : https://www.screencast.com/t/aqenaud77A

Also using Stripe PaymentMethod lib it's works.

public function userAllPaymentMethods(Request $request)
    {
        $user = User::find(5);
        \Stripe\Stripe::setApiKey('');
        $paymentMethod = \Stripe\PaymentMethod::all([
            'customer' =>  $user->stripe_id,
            'type' => 'card',
        ]);

        return response($paymentMethod);
    }

Result :
https://www.screencast.com/t/X14ane7WyqS

GitHub : here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire