payluk-escrow-inline-checkout 0.2.2 → 0.2.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 -15
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -21,7 +21,6 @@ import { initEscrowCheckout, pay } from 'payluk-escrow-inline-checkout';
21
21
 
22
22
  // 1) Initialize once at app startup
23
23
  initEscrowCheckout({
24
- apiBaseUrl: 'https://api.example.com', // your backend base URL
25
24
  publicKey: '<YOUR_PUBLISHABLE_KEY>' // publishable key only
26
25
  });
27
26
 
@@ -29,12 +28,11 @@ initEscrowCheckout({
29
28
  async function onPayClick() {
30
29
  try {
31
30
  await pay({
32
- paymentToken: '<PAYMENT_TOKEN_FROM_YOUR_BACKEND_OR_PROVIDER>',
31
+ paymentToken: '<PAYMENT_TOKEN>',
33
32
  reference: '<ORDER_OR_REFERENCE_ID>',
34
33
  redirectUrl: 'https://your-app.example.com/checkout/complete',
35
34
  logoUrl: 'https://your-cdn.example.com/logo.png', // optional
36
35
  brand: 'YourBrand', // optional
37
- extra: { theme: 'dark' }, // optional
38
36
  callback: (result) => {
39
37
  console.log('Checkout result:', result);
40
38
  },
@@ -51,12 +49,11 @@ async function onPayClick() {
51
49
  ## React Usage
52
50
 
53
51
  ```tsx
54
- // CheckoutButton.tsx
55
52
  import React from 'react';
56
53
  import { useEscrowCheckout } from 'payluk-escrow-inline-checkout/react';
57
54
 
58
55
  export function CheckoutButton() {
59
- const { pay, loading, error, ready } = useEscrowCheckout();
56
+ const { pay } = useEscrowCheckout();
60
57
 
61
58
  const handleClick = async () => {
62
59
  try {
@@ -76,9 +73,7 @@ export function CheckoutButton() {
76
73
 
77
74
  return (
78
75
  <button onClick={handleClick} disabled={loading || !ready}>
79
- {loading ? 'Processing…' : 'Pay now'}
80
- {!ready && <span>Preparing checkout…</span>}
81
- {error && <small style={{ color: 'red' }}>{error.message}</small>}
76
+ Pay Now
82
77
  </button>
83
78
  );
84
79
  }
@@ -97,7 +92,6 @@ export function CheckoutButton() {
97
92
  Initializes the SDK. Must be called before any `pay(...)`.
98
93
 
99
94
  **Required:**
100
- - `apiBaseUrl`: `string` — your backend base URL (no trailing slash required)
101
95
  - `publicKey`: `string` — publishable key only
102
96
 
103
97
  **Advanced (optional):**
@@ -111,11 +105,7 @@ Initializes the SDK. Must be called before any `pay(...)`.
111
105
  import { initEscrowCheckout } from 'payluk-escrow-inline-checkout';
112
106
 
113
107
  initEscrowCheckout({
114
- apiBaseUrl: 'https://api.example.com',
115
- publicKey: '<YOUR_PUBLISHABLE_KEY>',
116
- // scriptUrlOverride: 'https://cdn.example.com/custom-widget.js',
117
- // globalName: 'EscrowCheckout',
118
- // crossOrigin: 'anonymous'
108
+ publicKey: '<YOUR_PUBLISHABLE_KEY>'
119
109
  });
120
110
  ```
121
111
 
@@ -131,7 +121,6 @@ Creates a checkout session via your backend and opens the widget.
131
121
  **Optional:**
132
122
  - `logoUrl?`: `string`
133
123
  - `brand?`: `string`
134
- - `extra?`: `Record<string, unknown>`
135
124
  - `callback?`: `(result: unknown) => void`
136
125
  - `onClose?`: `() => void`
137
126
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payluk-escrow-inline-checkout",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "TypeScript escrow checkout wrapper with built-in script loader and session creation, ready for React/Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",