Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/md-aamroni/stripe

Stripe API Payment in Laravel
https://github.com/md-aamroni/stripe

stripe stripe-api stripe-checkout

Last synced: about 1 month ago
JSON representation

Stripe API Payment in Laravel

Awesome Lists containing this project

README

        

Laravel Logo

### Install
```shell
composer require aamroni/stripe
```

### Config Example
Collect your public and secret keys, and configure as necessary in config/payment.php

```php
'stripe' => [
'public' => env('STRIPE_PUBLIC_KEY'),
'secret' => env('STRIPE_SECRET_KEY'),
'redirect' => [
'success' => 'http://localhost:8000/stripe/success',
'cancel' => 'http://localhost:8000/stripe/cancel'
],
'currency' => 'USD'
]
```

### Checkout Example
```php
checkout($customer, $purchase);

dd($stripe);
```

### Customer Example
```php
create(CustomerEntity: $customer); // Create a customer information
$response = $instance->delete(); // Delete a customer information
$response = $instance->record(); // Fetch all customer information
$response = $instance->record(id: $id); // Fetch a specific customer information

dd($response);
```

### Purchase Example
```php
create(PurchaseEntity: $purchase); // Create a purchase information
$response = $instance->record(); // Fetch all purchase information
$response = $instance->record(id: $id); // Fetch a specific purchase information

dd($response);
```