-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5d0292
commit 38223ff
Showing
5 changed files
with
50 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php namespace WebReinvent\VaahExtend\Libraries; | ||
|
||
|
||
use Illuminate\Support\Facades\DB; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
class VaahDB{ | ||
|
||
public static function isConnected() | ||
{ | ||
try { | ||
return DB::connection()->getPdo(); | ||
} catch (\Exception $e) { | ||
return false; | ||
} | ||
} | ||
|
||
public static function isTableExist($table) | ||
{ | ||
return Schema::hasTable($table); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ Add Facade in `config/app.php`: | |
``` | ||
|
||
Add env configuration: | ||
``` | ||
```env | ||
... | ||
STRIPE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | ||
|
@@ -47,27 +47,27 @@ Reference url: https://stripe.com/docs/api | |
|
||
- Stripe One Time Payment | ||
|
||
``` | ||
```php | ||
|
||
$customer => [ | ||
$customer = [ | ||
'name' => 'xxxxxx', | ||
'email' => '[email protected]' | ||
]; | ||
|
||
$card => [ | ||
$card = [ | ||
'number' => 'xxxx-xxxx-xxxx-xxxx', | ||
'exp_month' => '01', // 01-12 | ||
'exp_year' => '2021', | ||
'cvc' => 'xxx' | ||
]; | ||
|
||
$package => [ | ||
$package = [ | ||
'currency' => 'usd', // usd / USD | ||
'amount' => '01', | ||
'description' => 'xxxxxx' | ||
]; | ||
|
||
$address => [ | ||
$address = [ | ||
'city' => 'xxxxxx', // optional | ||
'country' => 'xxxxxx', | ||
'line1' => 'xxxxxx', | ||
|
@@ -76,7 +76,7 @@ Reference url: https://stripe.com/docs/api | |
'state' => 'xxxxxx' // optional | ||
]; | ||
|
||
$return_url // URL to redirect your customer back to after they authenticate or cancel their payment | ||
$return_url = ""; // URL to redirect your customer back to after they authenticate or cancel their payment | ||
|
||
\VaahStripe::pay($customer, $card, $package, $address, $return_url); | ||
|
||
|
@@ -85,19 +85,19 @@ Reference url: https://stripe.com/docs/api | |
- Stripe Subscription | ||
```php | ||
|
||
$customer => [ | ||
$customer = [ | ||
'name' => 'xxxxxx', | ||
'email' => '[email protected]' | ||
]; | ||
|
||
$card => [ | ||
$card = [ | ||
'number' => 'xxxx-xxxx-xxxx-xxxx', | ||
'exp_month' => '01', // 01-12 | ||
'exp_year' => '2021', | ||
'cvc' => 'xxx' | ||
]; | ||
|
||
$address => [ | ||
$address = [ | ||
'city' => 'xxxxxx', // optional | ||
'country' => 'xxxxxx', | ||
'line1' => 'xxxxxx', | ||
|
@@ -106,9 +106,9 @@ Reference url: https://stripe.com/docs/api | |
'state' => 'xxxxxx' // optional | ||
]; | ||
|
||
$price_id // Price define the unit cost, currency, and (optional) billing cycle for Subcription | ||
$price_id = 50; // Price define the unit cost, currency, and (optional) billing cycle for Subcription | ||
|
||
$return_url // URL to redirect your customer back to after they authenticate or cancel their payment | ||
$return_url = ""; // URL to redirect your customer back to after they authenticate or cancel their payment | ||
|
||
\VaahStripe::subscription($customer, $card, $address, $price_id, $return_url); | ||
|
||
|
@@ -117,7 +117,7 @@ Reference url: https://stripe.com/docs/api | |
- Create Product | ||
```php | ||
|
||
$request => [ | ||
$request = [ | ||
'name' => 'xxxxxx', | ||
'description' => 'xxxxxx' | ||
]; | ||
|
@@ -129,7 +129,7 @@ Reference url: https://stripe.com/docs/api | |
- Create Price | ||
```php | ||
|
||
$request => [ | ||
$request = [ | ||
'product_id' => 'xxxxxx', | ||
'currency' => 'usd', | ||
'amount' => '01', | ||
|
@@ -151,11 +151,11 @@ Reference url: https://stripe.com/docs/api | |
- Find Price | ||
```php | ||
|
||
$product_id | ||
$product_id = 1; | ||
|
||
$value //optional | ||
$value = ""; //optional | ||
|
||
$by //optional default = amount amount/currency/interval | ||
$by = ""; //optional default = amount amount/currency/interval | ||
|
||
\VaahStripe::getProductPrice($product_id, $value, $by); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters