You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 8, 2024. It is now read-only.
Copy file name to clipboardexpand all lines: README.md
+71-12
Original file line number
Diff line number
Diff line change
@@ -24,11 +24,12 @@
24
24
[paddle.com](https://www.paddle.com/) payments integration for [Google Cloud Firestore](https://cloud.google.com/firestore).
25
25
26
26
This module provides
27
-
- a middleware function
28
27
- a body parser function
29
-
- a component that stores payment-related information.
28
+
- a middleware function to receive and store [Paddle Webhooks](https://developer.paddle.com/getting-started/ef9af9f700849-working-with-paddle-webhooks)
30
29
31
-
It does **not** provide a component or methods to query payment-related information.
30
+
It does **not**
31
+
- validate webhook content. Use and register [paddle-webhook-validator](https://github.com/discue/paddle-webhook-validator) in your application to validate webhooks before storing them.
32
+
- provide a component or methods to query payment-related information.
32
33
33
34
The module stores payment-related information in aollection of the target application like e.g. `api-clients`, or `api-users` and expects the application to read this information anyhow for every request. Therefore, no extra costly read is required.
Necessary to receive and store payment related hooks from [paddle.com](https://www.paddle.com/). Currently supported hooks are
43
+
The middleware component is necessary to receive and store payment related hooks from [paddle.com](https://www.paddle.com/). Currently supported hooks are:
43
44
- subscription_created
44
45
- subscription_updated
45
46
- subscription_cancelled
@@ -59,7 +60,7 @@ const port = process.env.PORT || 3456
For the webhooks integration to work and to be able to correlate incoming hooks with the correct subscription, a placeholder needs to be created **first**. Additionally, a specific value must be passed via the `passthrough` parameter to the [Checkout API](https://developer.paddle.com/guides/ZG9jOjI1MzU0MDQz-pass-parameters-to-the-checkout). This value will be returned by the `addSubscriptionPlaceholder` method.
73
+
For the webhooks integration to work and to be able to correlate incoming hooks with the correct subscription, a placeholder needs to be created **before the checkout** and - afterward - a specific value must be passed to the [Checkout API](https://developer.paddle.com/guides/ZG9jOjI1MzU0MDQz-pass-parameters-to-the-checkout) via the `passthrough` parameter. This value will be returned by the `addSubscriptionPlaceholder` method.
73
74
74
-
To create a subscription placeholder, you need to pass the id of the target parent document. The placeholder will be created and the method will return the required `passthrough` value.
75
+
You can see in the example below, the Subscriptions constructor is called with the name of the target `collection` and the id of the target document. The id could be your `user` or `api_client` id. Remember: the target document must exist before creating the placeholder.
Expects the parent application to read the actual subscription from the database. The subscription object can then be passed without modification to the `isSubscriptionActive` method.
101
+
Will return the status for all subscriptions associated with the given user/api_client.
0 commit comments