Skip to content

Commit 0a3bb82

Browse files
authored
Merge pull request #171 from aspnetzero/update-stripe
update stripe documents
2 parents 2424d3c + 6bc0b6d commit 0a3bb82

4 files changed

+86
-18
lines changed

docs/en/Features-Angular-Subscription-Stripe-Integration.md

+42-9
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,64 @@ In order to configure Stripe, open `appsettings.json` file in ***.Web.Host** pro
77
- **SecretKey:** Your Stripe SecretKey.
88
- **PublishableKey:** Your Stripe PublishableKey.
99
- **WebhookSecret:** Your Stripe WebHookSecret which is used to validate WebHook requests.
10+
- **PaymentMethodTypes** (array containing strings): Supported payment method types, check [stripe payment method types](https://stripe.com/docs/payments/payment-methods)
1011

1112
Stripe supports recurring payments. If a tenant wants to pay via Stripe and accepts automatically billing the account used for the initial payment, then Stripe charges the amount from Tenants account on each subscription cycle and notifies ASP.NET Zero. Then, ASP.NET Zero extends the subscription for the paid period (either monthly or annual).
1213

1314
<img src="images/subscription-stripe-recurring-payments.png" alt="Stripe recurring payments" class="img-thumbnail" />
1415

1516
If "Automatically bill my account" option is not selected on the payment page, tenants should login to the system and manually extend their subscription by clicking the "**Extend**" button on the subscription page and pay manually.
1617

18+
19+
1720
## Testing Stripe WebHooks on Localhost
1821

19-
In order to get Stripe's WebHook request on your local environment, you need to use an external tool. [https://webhookrelay.com](https://webhookrelay.com) is one of the best tools on the web at the moment. [How to receive Stripe webhooks on localhost](https://webhookrelay.com/blog/2017/12/26/receiving-stripe-webhooks-localhost/) can be used to test Stripe's WebHooks on the localhost. Basically, you need to create an account on [https://webhookrelay.com](https://webhookrelay.com), then need to download relay.exe to your development machine.
22+
##### Stripe-Cli
23+
24+
You can use stripe-cli in order to get Stripe's WebHooks requests on your local environment. To download it, go to https://dashboard.stripe.com/webhooks page. And install stripe-cli
25+
26+
![stripe-test-stripe-cli-download](D:/GitHub/documents/docs/en/images/stripe-test-stripe-cli-download.png)
27+
28+
After you download it, login to stripe-cli https://github.com/stripe/stripe-cli/wiki/login-command
29+
30+
Then you can forward webhooks to AspNet Zero with running listener.
31+
32+
```powershell
33+
stripe listen --forward-to http://localhost:22742/Stripe/WebHooks
34+
```
35+
36+
That will forward all events to your local project. For more information check: https://github.com/stripe/stripe-cli/wiki/listen-command
37+
38+
*After you connect successfully your device will be listed.*
39+
40+
![stripe-test-stripe-cli-list](D:/GitHub/documents/docs/en/images/stripe-test-stripe-cli-list.png)
41+
42+
##### Webhookrelay
43+
44+
In order to get Stripe's webhook request on your local environment, you can also use external tools like [https://webhookrelay.com](https://webhookrelay.com).It is one of the best tools on the web at the moment. [How to receive Stripe webhooks on localhost](https://webhookrelay.com/blog/2017/12/26/receiving-stripe-webhooks-localhost/) can be used to test Stripe's webhook on the localhost. Basically, you need to create an account on [https://webhookrelay.com](https://webhookrelay.com), then need to download relay.exe to your development machine.
2045

2146
Then, you need to run relay.exe like this;
2247

23-
```./relay.exe forward --bucket stripe http://localhost:22742/Stripe/WebHooks```
48+
```powershell
49+
./relay.exe forward --bucket stripe http://localhost:22742/Stripe/WebHooks
50+
```
51+
52+
This will give you an url something like "https://my.webhookrelay.com/v1/webhooks/aa180d45-87d5-4e9c-8bfa-e535a91df3fc". You need to enter this url as an webhook endpoint on Stripe's webhook dashboard ([https://dashboard.stripe.com/account/webhooks](https://dashboard.stripe.com/account/webhooks)).
53+
54+
Don't forget to enter your production app's URL as a webhook endpoint when you publish your app to production.
55+
56+
57+
58+
**Note that;**
2459

25-
This will give you an url something like "https://my.webhookrelay.com/v1/webhooks/aa180d45-87d5-4e9c-8bfa-e535a91df3fc". You need to enter this url as an WebHook endpoint on Stripe's WebHook dashboard ([https://dashboard.stripe.com/account/webhooks](https://dashboard.stripe.com/account/webhooks)).
60+
- Tenants can disable or enable Stripe to charge their accounts automatically on the Subscription page.
2661

27-
Don't forget to enter your production app's URL as a WebHook endpoint when you publish your app to production.
62+
- When upgrading to an higher edition, AspNet Zero calculates the cost for upgrade and charges it from Tenants account(with using checkout).
2863

29-
Note that;
64+
- When a tenant subscribes to an edition using Stripe and if admin user changes the edition of the Tenant on Tenant page to a higher edition, Tenant's account will be charged on stripe automatically.
3065

31-
- Tenants can disable or enable Stripe to charge their accounts automatically on the Subscription Page.
32-
- When upgrading to an higher edition, stripe calculates the cost for upgrade and charges it from Tenants account. However, ASP.NET Zero can't show this amount during the edition upgrade process. But, this amount can be seen at the Payment History tab on Subscription page after a successful payment process.
33-
- When a tenant subscribes to an edition using Stripe and if admin user changes the edition of the Tenant on Tenant page to a higher edition, Tenant's account will be charged on stripe automatically. If the Tenant is moved to an Edition with a lower price, there will be no change or refund on Stripe.
66+
(https://stripe.com/docs/billing/subscriptions/prorations )
3467

3568
## Next
3669

37-
- [Visual Settings](Features-Angular-Visual-Settings)
70+
- [Visual Settings](Features-Angular-Visual-Settings)
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,70 @@
11
# Stripe
22

3-
In order to configure Stripe, open appsettings.json file in *.Web.Mvc project and fill the values;
3+
In order to configure Stripe, open ``appsettings.json` file in ***.Web.Mvc** project and fill the values;
44

55
- **IsActive:** This setting can be used to enable/disable Stripe. If set to false, end users will not see Stripe option during the payment process.
66
- **BaseUrl:** Url for making API calls to Stripe. You can find correct urls in your Stripe dashboard.
77
- **SecretKey:** Your Stripe SecretKey.
88
- **PublishableKey:** Your Stripe PublishableKey.
99
- **WebhookSecret:** Your Stripe WebhookSecret which is used to validate WebHook requests.
10+
- **PaymentMethodTypes** (array containing strings): Supported payment method types, check [stripe payment method types](https://stripe.com/docs/payments/payment-methods)
1011

1112
Stripe supports recurring payments. If a tenant wants to pay via Stripe and accepts automatically billing the account used for the initial payment, then Stripe charges the amount from Tenants account on each subscription cycle and notifies AspNet Zero. Then, AspNet Zero extends the subscription for the paid period (either monthly or annual).
1213

14+
<img src="images/subscription-stripe-recurring-payments.png" alt="Stripe recurring payments" class="img-thumbnail" />
15+
16+
If "Automatically bill my account" option is not selected on the payment page, tenants should login to the system and manually extend their subscription by clicking the "**Extend**" button on the subscription page and pay manually.
17+
18+
19+
1320
## Testing Stripe WebHooks on Localhost
1421

15-
In order to get Stripe's WebHook request on your local environment, you need to use an external tool. [https://webhookrelay.com](https://webhookrelay.com) is one of the best tools on the web at the moment. [How to receive Stripe webhooks on localhost](https://webhookrelay.com/blog/2017/12/26/receiving-stripe-webhooks-localhost/) can be used to test Stripe's WebHooks on the localhost. Basically, you need to create an account on [https://webhookrelay.com](https://webhookrelay.com), then need to download relay.exe to your development machine.
22+
##### Stripe-Cli
23+
24+
You can use stripe-cli in order to get Stripe's WebHooks requests on your local environment. To download it, go to https://dashboard.stripe.com/webhooks page. And install stripe-cli
25+
26+
![stripe-test-stripe-cli-download](images/stripe-test-stripe-cli-download.png)
27+
28+
After you download it, login to stripe-cli https://github.com/stripe/stripe-cli/wiki/login-command
29+
30+
Then you can forward webhooks to AspNet Zero with running listener.
31+
32+
```powershell
33+
stripe listen --forward-to http://localhost:62114/Stripe/WebHooks
34+
```
35+
36+
That will forward all events to your local project. For more information check: https://github.com/stripe/stripe-cli/wiki/listen-command
37+
38+
*After you connect successfully your device will be listed.*
39+
40+
![stripe-test-stripe-cli-list](images/stripe-test-stripe-cli-list.png)
41+
42+
##### Webhookrelay
43+
44+
In order to get Stripe's webhook request on your local environment, you can also use external tools like [https://webhookrelay.com](https://webhookrelay.com). It is one of the best tools on the web at the moment. [How to receive Stripe webhooks on localhost](https://webhookrelay.com/blog/2017/12/26/receiving-stripe-webhooks-localhost/) can be used to test Stripe's webhook on the localhost. Basically, you need to create an account on [https://webhookrelay.com](https://webhookrelay.com), then need to download relay.exe to your development machine.
1645

1746
Then, you need to run relay.exe like this;
1847

19-
```./relay.exe forward --bucket stripe http://localhost:62114/Stripe/WebHooks```
48+
```powershell
49+
./relay.exe forward --bucket stripe http://localhost:62114/Stripe/WebHooks
50+
```
2051

21-
This will give you an url something like "https://my.webhookrelay.com/v1/webhooks/aa180d45-87d5-4e9c-8bfa-e535a91df3fc". You need to enter this url as an WebHook endpoint on Stripe's WebHook dashboard ([https://dashboard.stripe.com/account/webhooks](https://dashboard.stripe.com/account/webhooks)).
52+
This will give you an url something like "https://my.webhookrelay.com/v1/webhooks/aa180d45-87d5-4e9c-8bfa-e535a91df3fc". You need to enter this url as an webhook endpoint on Stripe's webhook dashboard ([https://dashboard.stripe.com/account/webhooks](https://dashboard.stripe.com/account/webhooks)).
2253

23-
Don't forget to enter your production app's url as a WebHook endpoint when you publish your app to production.
54+
Don't forget to enter your production app's url as a webhook endpoint when you publish your app to production.
2455

25-
Note that;
56+
57+
58+
**Note that;**
2659

2760
- Tenants can disable or enable Stripe to charge their accounts automatically on the Subscription page.
2861

29-
- When upgrading to an higher edition, stripe calculates the cost for upgrade and charges it from Tenants account. However, AspNet Zero can't show this amount during the edition upgrade process. But, this amount can be seen at the Payment History tab on Subscription page after a successful payment process.
62+
- When upgrading to an higher edition, AspNet Zero calculates the cost for upgrade and charges it from Tenants account(with using checkout).
3063

3164
- When a tenant subscribes to an edition using Stripe and if admin user changes the edition of the Tenant on Tenant page to a higher edition, Tenant's account will be charged on stripe automatically.
3265

33-
## Next
66+
(https://stripe.com/docs/billing/subscriptions/prorations )
3467

35-
- [Visual Settings](Features-Mvc-Core-Visual-Settings)
68+
## Next
69+
70+
- [Visual Settings](Features-Mvc-Core-Visual-Settings)
Loading
20.5 KB
Loading

0 commit comments

Comments
 (0)