@cryptocadet/react-crypto-pay 2.3.0 → 4.0.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,18 +1,30 @@
1
1
  # React-Crypto-Pay
2
2
 
3
3
 
4
- React-Crypto-Pay is an api for evm-chain crypto payment integration.
4
+ React-Crypto-Pay is an api for evm-chain and Solana crypto payment integration.
5
+
6
+ ## Updates
7
+
8
+ React-Crypto-Pay v4.0.0 now has the following additional features!
9
+
10
+ - DisplayName property so buyers can easily recognize what they purchased
11
+ - onSuccess method added for post-transaction actions such as automatic downloads and mints
12
+ - shoppingcart for multiple items
13
+ - noQuantity flag for one-off purchases
14
+ - API available
15
+ - SUSDT test environment token available for Solana Devnet testing
16
+ - Phantom wallet support added
5
17
 
6
18
  ## Features
7
19
 
8
- - Accept payments across multiple EVM networks
20
+ - Accept payments across multiple EVM networks and Solana
9
21
  - Accept any token you want
10
22
  - Integrates with Web3Modal
11
23
  - Create affiliate codes for your own referral program
12
24
 
13
25
  ## Installation
14
26
 
15
- React-Crypto-Pay requires [Node.js](https://nodejs.org/) v16+ to run.
27
+ React-Crypto-Pay requires [Node.js](https://nodejs.org/) v17+ to run.
16
28
 
17
29
  Install the dependencies and devDependencies and start the server.
18
30
 
@@ -39,20 +51,47 @@ const ComponentName = () => {
39
51
  <CryptoPayButton
40
52
  apiKey={'YOUR_API_KEY'}
41
53
  productId={'YOUR_PRODUCT_ID'}
54
+ displayName={'ITEM_DISPLAY_NAME'}
42
55
  email='required'
43
56
  shippingAddress='required'
44
57
  label='BUTTON TITLE'
45
58
  style={null}
59
+ cartStyle={null}
60
+ lang='en'
61
+ eth='false'
62
+ sol='true'
63
+ redirect='http://localhost:5173'
64
+ onSuccess={doSomething}
65
+ shoppingCart='false'
66
+ noQuantity='true'
46
67
 
47
68
  />
48
69
 
49
70
  )
50
71
  }
51
72
 
73
+
52
74
  export default ComponentName;
53
75
  ```
54
76
 
55
- The 'email' and 'shippingAddress' variables can be required in order to request the user's email and shipping address upon payment. Styles can be input via the style variable to change the button style.
77
+ The pay portal defaults to `eth` but you can set this to false. In order to add Solana, `sol` should be set to 'true'.
78
+
79
+ The `email` and `shippingAddress` variables can be required in order to request the user's email and shipping address upon payment. Styles can be input via the style variable to change the button style. The lang property corresponds to the ISO 639-1 Code for the following supported languages:
80
+
81
+ - ar (Arabic)
82
+ - de (German)
83
+ - en (English)
84
+ - es (Spanish)
85
+ - fr (French)
86
+ - pt (Portuguese)
87
+ - zh (Chinese)
88
+
89
+ The `onSuccess` property determines what happens after a transaction is successfully completed. For instance, it can trigger a download or a mint, or some other action. The `redirect` property can be used to redirect the user after a successful transaction.
90
+
91
+ `shoppingCart` when set true enables a shopping cart button that appears alongside the main button. Multiple items can be added to the cart before a final sale is made. `noQuantity` property is for one-off sales that don't need to ask the buyer for a quantity, because they can only purchase one at a time, or the item being purchases is unique. If the 'noQuantity' property is set to `true` then the shoppingCart property should be set to false, and vice-versa.
92
+
93
+
94
+
56
95
 
57
96
  In your page or index file, dynamically import the created component:
58
97