paperless-client 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +4 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -25,14 +25,14 @@ import PaperlessClient, { formatDescription } from 'paperless-client'
25
25
  const client = new PaperlessClient(
26
26
  'YOUR_MUID',
27
27
  'YOUR_APP_ACCESS_KEY',
28
- 'YOUR_MERCHANT_REF_ID',
29
28
  'https://payment-sandbox.paperlessltd.com' // or production URL
30
29
  )
31
30
 
32
31
  // 2. Generate a Payment URL
33
32
  async function initiate() {
34
- const url = await client.getPaymentUrl({
33
+ const { url, token } = await client.newPayment({
35
34
  merchant_order_id: '105',
35
+ merchant_ref_id: 'REF_105',
36
36
  customer_name: 'John Doe',
37
37
  customer_email: 'john@example.com',
38
38
  customer_phone: '01700000000',
@@ -47,11 +47,12 @@ async function initiate() {
47
47
  })
48
48
 
49
49
  console.log('Redirect user to ->', url)
50
+ console.log('Save this token for later use ->', token)
50
51
  }
51
52
 
52
53
  // 3. Check Payment Status
53
54
  async function checkStatus(token: string) {
54
- const status = await client.checkPaymentStatus(token)
55
+ const status = await client.checkPayment(token)
55
56
  console.log('Transaction Status:', status.txn_status)
56
57
  }
57
58
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paperless-client",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A client for interacting with the Paperless payment API.",
5
5
  "author": "Rifat Mahmud",
6
6
  "license": "MIT",