Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Dec 5, 2024
1 parent 3b0b289 commit 3488c77
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,10 @@ npm install @discue/paddle-integration-mongodb
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.

```js
'use strict'
import { SubscriptionHooks, subscriptionStorage } from '@discue/paddle-integration-mongodb'

const readApiClient = require('./lib/your-application/read-api-client')
const paddleIntegration = require('@discue/paddle-integration-mongodb')

const storage = paddleIntegration.subscriptionStorage({ url: 'mongodb://localhost:27017' })
const subscriptions = new paddleIntegration.SubscriptionHooks({ storage })
const storage = subscriptionStorage({ url: 'mongodb://localhost:27017' })
const subscriptions = new SubscriptionHooks({ storage })

module.exports = async (req, res, next) => {
// requires application to read api_client information
Expand Down

0 comments on commit 3488c77

Please sign in to comment.