mainstack-payments 0.5.22 → 0.5.24

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
@@ -67,14 +67,14 @@ The config object should contain the following properties:
67
67
 
68
68
  * `currency*`: The currency to be used for the payment
69
69
 
70
- * `reference*`: Uniquely generated identifier for this payment
71
-
72
70
  * `transactionFeesSlug*`: The slug of the transaction fees to be applied to the payment usually determined by the backend, e.g 'store-pro-plan'
73
71
 
74
72
  * `userAllowsWalletPayment*`: A boolean value that states if the merchant has allowed wallet payment
75
73
 
76
74
  * `userAllowsCardPayment*`: A boolean value that states if the merchant has allowed card payment
77
75
 
76
+ * `userAllowsCryptoPayment*`: A boolean value that states if the merchant has allowed crypto wallet payments.
77
+
78
78
  * `metadata*`: An object that contains additional information about the payment. See more on this [here](#metadata)
79
79
 
80
80
  * `baseUrl*`: The base URL of the legacy API. This API is what is used primarily to make payments. It is used initialise, charge and verify payment.
@@ -93,12 +93,16 @@ The config object should contain the following properties:
93
93
 
94
94
  * `ip`: This is for the user's ip address to determine their tax fee. Only needed if you want to collect tax fees.
95
95
 
96
- * `paymentOptions`: An array of payment options that should be enabled for the user can select from. The options are 'paystack', 'startbutton', 'wallet', 'stripe'
96
+ * `paymentOptions`: An array of payment options that should be enabled for the user can select from. The options are 'paystack', 'startbutton', 'wallet', 'stripe', 'crypto'
97
97
 
98
- * `paystackRedirectUrl`: The URL to redirect to after a successful payment with Paystack or Startbutton. this is required if paystack or startbutton is enabled. More on this can be found [here](#paystackredirecturl)
98
+ * `paymentRedirectUrl`: The URL to redirect to after a successful payment with Paystack, Startbutton or Stripe UK payments (which may require 3DS). More on this can be found [here](#paystackredirecturl)
99
+
100
+ * `cryptoRedirectUrl`: The URL to redirect to after a successful crypto wallet payment. This is different to `paymentRedirectUrl` as you are fully in control of this page and should ideally be the receipt page. The following url query parameters will be added to the url from the payment library: `reference` : payment reference generated by mainstack, `payment_intent` : generated by stripe. This is required if `userAllowsCryptoPayment` is true.
99
101
 
100
102
  * `customizations`: This is an object that takes values that adjust layout, styling or display of elements on the library. See full description [here](https://app.joggr.io/app/documents/b5b2ff2f-550d-4057-bed3-441870eaaf5d/edit#customizations).
101
103
 
104
+ * `paymentModel`: string that specifies if the payment model is 'ips' or 'default'
105
+
102
106
  #### metadata
103
107
 
104
108
  The `metadata` object should contain the following properties:
@@ -141,7 +145,7 @@ The `metadata` object should contain the following properties:
141
145
 
142
146
  * `phone`: For the PhoneNumber input. Default is false.
143
147
 
144
- The `paystackRedirectUrl` is the URL to redirect to after a successful payment with Paystack or Startbutton. This page will be created by you and should contain the following code:
148
+ The `paymentRedirectUrl` is the URL to redirect to after a successful payment with Paystack, Startbutton or Stripe UK. This page will be created by you and should contain the following code:
145
149
 
146
150
  ```typescript
147
151
  import { useEffect } from "react";
@@ -159,7 +163,7 @@ const PostMessagePage = () => {
159
163
  export default PostMessagePage;
160
164
  ```
161
165
 
162
- The aim of this is to send a postMessage to the iframe that loads Startbutton or Paystack to let them know that payment is complete and they can close the iframe and verify the payment.
166
+ The aim of this is to send a postMessage to the iframe that loads the payment option to let them know that payment is complete and they can close the iframe and verify the payment.
163
167
 
164
168
  ## Extra Props
165
169