Skip to content

Commit e4678f3

Browse files
author
Mostafa Kamal
committed
plan doc
1 parent d052cd8 commit e4678f3

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ php artisan vendor:publish --provider="Code4mk\LaraStripe\LaraStripeServiceProvi
2323
* [Charge doc](https://github.com/code4mk/lara-stripe/blob/master/doc/charge.md)
2424
* [Checkout doc](https://github.com/code4mk/lara-stripe/blob/master/doc/payment-checkout.md)
2525
* [Customer doc](https://github.com/code4mk/lara-stripe/blob/master/doc/customer.md)
26+
* [Plan doc](https://github.com/code4mk/lara-stripe/blob/master/doc/plan.md)
2627

2728
# Demo repo
2829

doc/plan.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Plan
2+
3+
lara-stripe has `LaraStripePlan` alias for plan related task.
4+
5+
#Methods
6+
7+
## setup() `required`
8+
9+
setup method as usual setup secret key
10+
11+
* `secret_key` required
12+
13+
```php
14+
setup([
15+
'secret_key' => '********'
16+
])
17+
```
18+
19+
## product() `required`
20+
21+
Plan for which product.
22+
23+
* `name` required
24+
25+
```php
26+
product(['name' => 'Sass Software Laravel'])
27+
```
28+
29+
## amount() `required`
30+
31+
How much price for the plan.
32+
33+
```php
34+
amount(20.50)
35+
```
36+
37+
## currency() `required`
38+
39+
* [stripe supported currency](https://stripe.com/docs/currencies)
40+
41+
```php
42+
currency('usd')
43+
```
44+
45+
## interval() `required`
46+
47+
Plan recurring interval. `[day,week,month,year]`
48+
49+
```php
50+
interval('week')
51+
```
52+
53+
## extra `optional`
54+
55+
Add optional attributes which are not include this package for creating plan.
56+
57+
* [all attributes lists](https://stripe.com/docs/api/plans/create)
58+
59+
```php
60+
extra([
61+
'tiers_mode' => 'volume'
62+
.....
63+
])
64+
```
65+
66+
## trial() `optional`
67+
68+
Set trial period for the plan. `integer value`
69+
70+
```php
71+
trial(5)
72+
```
73+
74+
## get() `required`
75+
76+
* create the plan and retrive created plan data.
77+
* return `object`
78+
79+
```php
80+
get()
81+
```
82+
# `Create a plan -> Full code`
83+
84+
```php
85+
LaraStripePlan::setup(['secret_key' => '****'])
86+
->product(['name' => 'Sass Software Laravel'])
87+
->amount(20.50)
88+
->currency('usd')
89+
->interval('month')
90+
->trial(3)
91+
->get();
92+
```
93+
94+
# `Retrive a plan`
95+
96+
* return `object`
97+
98+
```php
99+
LaraStripePlan::setup(['secret_key' => '****'])
100+
->retrieve('plan_id');
101+
```
102+
103+
# `Deactived the plan`
104+
105+
```php
106+
LaraStripePlan::setup(['secret_key' => '****'])
107+
->deactive('plan_id');
108+
```
109+
110+
# `Actived the plan`
111+
112+
```php
113+
LaraStripePlan::setup(['secret_key' => '****'])
114+
->active('plan_id');
115+
```
116+
117+
# `Delete the plan`
118+
119+
```php
120+
LaraStripePlan::setup(['secret_key' => '****'])
121+
->delete('plan_id');
122+
```

0 commit comments

Comments
 (0)