Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/discue/paddle-test-kit
Test kit providing functions to allow for easier testing of Paddle Classic payments
https://github.com/discue/paddle-test-kit
discue nodejs paddle payments
Last synced: 10 days ago
JSON representation
Test kit providing functions to allow for easier testing of Paddle Classic payments
- Host: GitHub
- URL: https://github.com/discue/paddle-test-kit
- Owner: discue
- License: mit
- Created: 2023-09-08T21:59:18.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-15T22:45:20.000Z (about 1 month ago)
- Last Synced: 2024-10-17T09:40:24.765Z (about 1 month ago)
- Topics: discue, nodejs, paddle, payments
- Language: JavaScript
- Homepage: https://www.discue.io
- Size: 1.35 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
[![GitHub tag](https://img.shields.io/github/tag/discue/paddle-test-kit?include_prereleases=&sort=semver&color=blue)](https://github.com/discue/paddle-test-kit/releases/)
[![Latest Stable Version](https://img.shields.io/npm/v/@discue/paddle-test-kit.svg)](https://www.npmjs.com/package/@discue/paddle-test-kit)
[![License](https://img.shields.io/npm/l/@discue/paddle-test-kit.svg)](https://www.npmjs.com/package/@discue/paddle-test-kit)
[![NPM Downloads](https://img.shields.io/npm/dt/@discue/paddle-test-kit.svg)](https://www.npmjs.com/package/@discue/paddle-test-kit)
[![NPM Downloads](https://img.shields.io/npm/dm/@discue/paddle-test-kit.svg)](https://www.npmjs.com/package/@discue/paddle-test-kit)
[![contributions - welcome](https://img.shields.io/badge/contributions-welcome-blue)](/CONTRIBUTING.md "Go to contributions doc")
[![Made with Node.js](https://img.shields.io/badge/Node.js->=18-blue?logo=node.js&logoColor=white)](https://nodejs.org "Go to Node.js homepage")# paddle-test-kit
Test kit for [paddle.com](https://www.paddle.com/) payments.
This module provides
- a function to create an active paddle subscription for testing purposes## Installation
```bash
npm install @discue/paddle-test-kit
```### Creating a new subscription
The module is able to create a new Paddle subscription for a given `vendor_id`. The module will start a puppeteer instance in the background, generate a checkout page with `inline` mode and finish the checkout process.```js
'use strict'const { createActivePaddleSubscription } = require('../lib/index.js')
const productId = 36631 // the product id is vendor specific
const vendorId = process.env.VENDOR_IDconst { checkout, order } = await createActivePaddleSubscription({
productId,
vendorId
})const { subscription_id } = order
```### Removing test subscriptions
The exported function `cancelTestSubscriptions` cancels all active subscriptions created by this module.```js
'use strict'const { cancelTestSubscriptions } = require('../lib/index.js')
const vendorId = process.env.VENDOR_ID
const authCode = process.env.AUTH_CODEawait cancelTestSubscriptions({
vendorId, authCode
})
```## License
[MIT](https://choosealicense.com/licenses/mit/)