@solidgate/react-sdk 1.14.0 → 1.15.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
CHANGED
|
@@ -1,15 +1,58 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Solidgate react-sdk
|
|
2
|
+
|
|
3
|
+
This repository is a React wrapper for the Solidgate Client Software Development Kit (SDK).
|
|
4
|
+
|
|
5
|
+
It supports rendering payment forms and resign forms, including custom container elements for <a href="https://docs.solidgate.com/payments/integrate/payment-form/google-pay-button/" target="_blank">Google Pay</a>, <a href="https://docs.solidgate.com/payments/integrate/payment-form/apple-pay-button/" target="_blank">Apple Pay</a>, or <a href="https://docs.solidgate.com/payments/integrate/payment-form/paypal-button/" target="_blank">PayPal</a> buttons.
|
|
6
|
+
|
|
7
|
+
Check our
|
|
8
|
+
* <a href="https://docs.solidgate.com/" target="_blank">Payment guide</a> to understand business value better
|
|
9
|
+
* <a href="https://api-docs.solidgate.com/" target="_blank">API Reference</a> to find more examples of usage
|
|
10
|
+
|
|
11
|
+
## Structure
|
|
12
|
+
|
|
13
|
+
<table style="width: 100%; background: transparent;">
|
|
14
|
+
<colgroup>
|
|
15
|
+
<col style="width: 50%;">
|
|
16
|
+
<col style="width: 50%;">
|
|
17
|
+
</colgroup>
|
|
18
|
+
<tr>
|
|
19
|
+
<th>SDK for React contains</th>
|
|
20
|
+
<th>Table of contents</th>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr>
|
|
23
|
+
<td>
|
|
24
|
+
<code>src</code> – main source code<br>
|
|
25
|
+
<code>public</code> – assets folder<br>
|
|
26
|
+
<code>playground</code> – example app<br>
|
|
27
|
+
<code>package.json</code> – project metadata and dependency definitions
|
|
28
|
+
</td>
|
|
29
|
+
<td>
|
|
30
|
+
<a href="https://github.com/solidgate-tech/react-sdk?tab=readme-ov-file#installation">Installation</a><br>
|
|
31
|
+
<a href="https://github.com/solidgate-tech/react-sdk?tab=readme-ov-file#usage">Usage</a><br>
|
|
32
|
+
<a href="https://github.com/solidgate-tech/react-sdk?tab=readme-ov-file#development-server">Development server</a><br>
|
|
33
|
+
<a href="https://github.com/solidgate-tech/react-sdk?tab=readme-ov-file#build">Build</a>
|
|
34
|
+
</td>
|
|
35
|
+
</tr>
|
|
36
|
+
</table>
|
|
37
|
+
|
|
38
|
+
<br>
|
|
2
39
|
|
|
3
40
|
## Installation
|
|
4
41
|
|
|
42
|
+
Run the following command in your React project:
|
|
43
|
+
|
|
5
44
|
```
|
|
6
45
|
npm install --save @solidgate/react-sdk
|
|
7
46
|
```
|
|
8
47
|
|
|
9
|
-
|
|
48
|
+
<br>
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
10
51
|
|
|
11
52
|
### Payment form
|
|
12
53
|
|
|
54
|
+
Render a <a href="https://docs.solidgate.com/payments/integrate/payment-form/create-your-payment-form/" target="_blank">payment form</a> component in your React project.
|
|
55
|
+
|
|
13
56
|
```tsx
|
|
14
57
|
import React from 'react'
|
|
15
58
|
import ReactDOM from 'react-dom';
|
|
@@ -100,6 +143,8 @@ ReactDOM.render(<App />, document.body);
|
|
|
100
143
|
|
|
101
144
|
### Resign form
|
|
102
145
|
|
|
146
|
+
Render a <a href="https://docs.solidgate.com/payments/integrate/payment-form/resign-payment-form/" target="_blank">resign payment form</a> component in your React project.
|
|
147
|
+
|
|
103
148
|
```tsx
|
|
104
149
|
const resignRequest = {
|
|
105
150
|
merchant: '<<--YOUR MERCHANT ID-->>',
|
|
@@ -157,13 +202,19 @@ function App () {
|
|
|
157
202
|
}
|
|
158
203
|
```
|
|
159
204
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
Run ``` npm run build ``` to build the project. The build artifacts will be stored in the dist/ directory.
|
|
205
|
+
<br>
|
|
163
206
|
|
|
164
|
-
## Development
|
|
207
|
+
## Development server
|
|
165
208
|
|
|
166
209
|
1. `cd playground`
|
|
167
210
|
2. `npm i`
|
|
168
211
|
3. `npm run start`
|
|
169
|
-
4. Navigate to http://localhost:3000
|
|
212
|
+
4. `Navigate` to http://localhost:3000/
|
|
213
|
+
|
|
214
|
+
<br>
|
|
215
|
+
|
|
216
|
+
## Build
|
|
217
|
+
|
|
218
|
+
Run ``` npm run build ``` to build the project.
|
|
219
|
+
|
|
220
|
+
The build artifacts will be stored in the `dist/` directory.
|
|
@@ -11,9 +11,9 @@ interface PaymentProps extends Partial<ClientSdkEventsProvider> {
|
|
|
11
11
|
applePayButtonParams?: Omit<InitConfig['applePayButtonParams'], 'containerId'>;
|
|
12
12
|
paypalButtonParams?: Omit<InitConfig['paypalButtonParams'], 'containerId'>;
|
|
13
13
|
onReadyPaymentInstance?: (paymentInstance: ClientSdkInstance) => void;
|
|
14
|
-
googlePayContainerRef?: RefObject<HTMLDivElement>;
|
|
15
|
-
applePayContainerRef?: RefObject<HTMLDivElement>;
|
|
16
|
-
paypalContainerRef?: RefObject<HTMLDivElement>;
|
|
14
|
+
googlePayContainerRef?: RefObject<HTMLDivElement | null>;
|
|
15
|
+
applePayContainerRef?: RefObject<HTMLDivElement | null>;
|
|
16
|
+
paypalContainerRef?: RefObject<HTMLDivElement | null>;
|
|
17
17
|
}
|
|
18
18
|
declare const Payment: {
|
|
19
19
|
(props: PaymentProps): JSX.Element;
|
|
@@ -11,9 +11,9 @@ interface PaymentProps extends Partial<ClientSdkEventsProvider> {
|
|
|
11
11
|
applePayButtonParams?: Omit<InitConfig['applePayButtonParams'], 'containerId'>;
|
|
12
12
|
paypalButtonParams?: Omit<InitConfig['paypalButtonParams'], 'containerId'>;
|
|
13
13
|
onReadyPaymentInstance?: (paymentInstance: ClientSdkInstance) => void;
|
|
14
|
-
googlePayContainerRef?: RefObject<HTMLDivElement>;
|
|
15
|
-
applePayContainerRef?: RefObject<HTMLDivElement>;
|
|
16
|
-
paypalContainerRef?: RefObject<HTMLDivElement>;
|
|
14
|
+
googlePayContainerRef?: RefObject<HTMLDivElement | null>;
|
|
15
|
+
applePayContainerRef?: RefObject<HTMLDivElement | null>;
|
|
16
|
+
paypalContainerRef?: RefObject<HTMLDivElement | null>;
|
|
17
17
|
}
|
|
18
18
|
declare const Payment: {
|
|
19
19
|
(props: PaymentProps): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidgate/react-sdk",
|
|
3
3
|
"repository": "https://github.com/solidgate-tech/react-sdk",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.15.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Solidgate",
|
|
7
7
|
"description": "Solidgate react sdk loader",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"typescript": "^4.4.2"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"react": "^17.0.2 || ^18.0.0",
|
|
66
|
-
"react-dom": "^17.0.2 || ^18.0.0"
|
|
65
|
+
"react": "^17.0.2 || ^18.0.0 || ^19.0.0",
|
|
66
|
+
"react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0"
|
|
67
67
|
}
|
|
68
68
|
}
|