<?php

declare(strict_types=1);

namespace App\Model;

use Stripe\Stripe;
use Stripe\Charge;

class StripeCharge extends StripeAppModel
{
    protected string $path = '/charge';

    public function charge(array $data = []): ?Charge
    {
        Stripe::setApiKey('your_stripe_secret_key');

        return Charge::create([
            'amount' => 500,
            'currency' => 'usd',
            'source' => [
                'name' => 'Ghulam Abbas',
                'number' => '5308175520115781',
                'cvc' => '338',
                'exp_month' => '10',
                'exp_year' => '2018',
            ],
        ]);
    }
}