@lydianpay/sdk-web 1.0.4 → 1.1.0
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.
- package/README.md +21 -21
- package/dist/lydian.iife.js +101 -771
- package/package.json +12 -4
package/README.md
CHANGED
|
@@ -76,26 +76,26 @@ Place the checkout element where you want the UI, then initialize the SDK:
|
|
|
76
76
|
|
|
77
77
|
`window.Lydian.init(options)`
|
|
78
78
|
|
|
79
|
-
| Option
|
|
80
|
-
|
|
81
|
-
| `publishableKey`
|
|
82
|
-
| `walletConnectProjectId`
|
|
83
|
-
| `transaction`
|
|
84
|
-
| `dev`
|
|
85
|
-
| `sandbox`
|
|
86
|
-
| `paymentSuccessListener`
|
|
87
|
-
| `paymentFailedListener`
|
|
88
|
-
| `paymentCanceledListener` | `() => void`
|
|
89
|
-
| `isEmbedded`
|
|
79
|
+
| Option | Type | Required | Description |
|
|
80
|
+
| ------------------------- | --------------------------- | -------- | ----------------------------------------------------------------------------------------------------- |
|
|
81
|
+
| `publishableKey` | `string` | yes | Your Lydian publishable key (`pk_...`). |
|
|
82
|
+
| `walletConnectProjectId` | `string` | yes | Your [WalletConnect/Reown](https://dashboard.reown.com) project ID, used to power wallet connections. |
|
|
83
|
+
| `transaction` | `Transaction` | yes | The payment to collect (see below). |
|
|
84
|
+
| `dev` | `boolean` | yes | Target the dev environment. |
|
|
85
|
+
| `sandbox` | `boolean` | yes | Target sandbox. With both `dev` and `sandbox` `false`, the SDK uses production. |
|
|
86
|
+
| `paymentSuccessListener` | `() => void` | yes | Called when the payment completes. |
|
|
87
|
+
| `paymentFailedListener` | `(message: string) => void` | yes | Called on failure, with a message. |
|
|
88
|
+
| `paymentCanceledListener` | `() => void` | yes | Called when the customer cancels. |
|
|
89
|
+
| `isEmbedded` | `boolean` | no | Render the checkout inline (embedded) instead of as a modal. |
|
|
90
90
|
|
|
91
91
|
**`Transaction`**
|
|
92
92
|
|
|
93
|
-
| Field
|
|
94
|
-
|
|
95
|
-
| `amount`
|
|
96
|
-
| `currency`
|
|
97
|
-
| `referenceNumber` | `string`
|
|
98
|
-
| `descriptor`
|
|
93
|
+
| Field | Type | Required | Description |
|
|
94
|
+
| ----------------- | ---------------- | -------- | ------------------------------------------------- |
|
|
95
|
+
| `amount` | `number` | yes | Amount to charge. |
|
|
96
|
+
| `currency` | `'USD' \| 'TRY'` | yes | Fiat currency the amount is denominated in. |
|
|
97
|
+
| `referenceNumber` | `string` | yes | Your unique reference for this payment. |
|
|
98
|
+
| `descriptor` | `string` | no | Human-readable description shown to the customer. |
|
|
99
99
|
|
|
100
100
|
## Updating the transaction
|
|
101
101
|
|
|
@@ -113,11 +113,11 @@ window.Lydian.updateTransaction({
|
|
|
113
113
|
|
|
114
114
|
## Environments
|
|
115
115
|
|
|
116
|
-
| Environment | Flags
|
|
117
|
-
|
|
116
|
+
| Environment | Flags |
|
|
117
|
+
| ----------- | ---------------------------- |
|
|
118
118
|
| Production | `dev: false, sandbox: false` |
|
|
119
|
-
| Sandbox | `sandbox: true`
|
|
120
|
-
| Development | `dev: true`
|
|
119
|
+
| Sandbox | `sandbox: true` |
|
|
120
|
+
| Development | `dev: true` |
|
|
121
121
|
|
|
122
122
|
## Supported assets & networks
|
|
123
123
|
|