@cryptocadet/react-crypto-pay 3.0.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
@@ -3,6 +3,18 @@
3
3
 
4
4
  React-Crypto-Pay is an api for evm-chain and Solana crypto payment integration.
5
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
17
+
6
18
  ## Features
7
19
 
8
20
  - Accept payments across multiple EVM networks and Solana
@@ -39,25 +51,32 @@ 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}
46
60
  lang='en'
47
61
  eth='false'
48
62
  sol='true'
63
+ redirect='http://localhost:5173'
64
+ onSuccess={doSomething}
65
+ shoppingCart='false'
66
+ noQuantity='true'
49
67
 
50
68
  />
51
69
 
52
70
  )
53
71
  }
54
72
 
73
+
55
74
  export default ComponentName;
56
75
  ```
57
76
 
58
- The pay portal defaults to 'eth' but you can set this to false. In order to add Solana, sol should be set to 'true'.
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'.
59
78
 
60
- 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:
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:
61
80
 
62
81
  - ar (Arabic)
63
82
  - de (German)
@@ -67,6 +86,12 @@ The 'email' and 'shippingAddress' variables can be required in order to request
67
86
  - pt (Portuguese)
68
87
  - zh (Chinese)
69
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
+
70
95
 
71
96
  In your page or index file, dynamically import the created component:
72
97