Skip to content

greenglobal/bagisto-stripe-payment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This extension used for implement form create card, provider helper function for payment with the Stripe services.

Requirements

Installation

  1. Unzip all the files to packages/GGPHP/Payment.
  2. Open config/app.php and add GGPHP\Payment\Providers\PaymentServiceProvider::class.
  3. Open composer.json of root project and add ""GGPHP\Payment\": "packages/GGPHP/Payment/src"".
  4. Go to packages/GGPHP/Payment, run the following command
cd packages/GGPHP/Payment
yarn
yarn run prod
  1. Run the following command
composer dump-autoload

php artisan migrate

php artisan vendor:publish --force

php artisan route:cache

Configurable

  1. Go to https://<your-site>/admin/configuration/sales/paymentmethods
  2. Enter the values of the stripe's keys and Save

Usage

  1. 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
  1. 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 = []);