This extension used for implement form create card, provider helper function for payment with the Stripe services.
- Unzip all the files to packages/GGPHP/Payment.
- Open
config/app.php
and add GGPHP\Payment\Providers\PaymentServiceProvider::class. - Open
composer.json
of root project and add ""GGPHP\Payment\": "packages/GGPHP/Payment/src"". - Go to
packages/GGPHP/Payment
, run the following command
cd packages/GGPHP/Payment
yarn
yarn run prod
- Run the following command
composer dump-autoload
php artisan migrate
php artisan vendor:publish --force
php artisan route:cache
- Go to
https://<your-site>/admin/configuration/sales/paymentmethods
- Enter the values of the stripe's keys and Save
- Implement form Stripte create card in view
@section('content-wrapper')
// $guard accept value is customer or admin
@php $guard = 'customer'; @endphp
@include('ggphp-payment::payment.payment-stripe', ['guard' => $guard])
@endsection
- Use function helper
- Initial installation
use GGPHP\Payment\Http\Controllers\PaymentController;
$stripe = new PaymentController();
- Set guard
$stripe->setGuard('customer');
- Get list cards of customer
$stripe->cards();
- Get detail card
$stripe->showCard($id);
- Update card
$stripe->updateCard($id);
- Charge
$stripe->charge($amount, $currency, $data = []);