@superlogic/spree-pay 0.1.2 → 0.1.4

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
@@ -16,8 +16,10 @@ import { useState } from 'react';
16
16
  import { SpreePay, SpreePayProvider, useSpreePay } from '@superlogic/spree-pay';
17
17
 
18
18
  const spreeEnv = {
19
- environment: 'dev', // 'stg' or 'prod' for other environments
20
- accessToken: 'demo-access-token', // Use env vars in production
19
+ tenantId: 'moca' // Keep moca for crypto payments on BASE network
20
+ environment: 'dev',
21
+ accessToken: 'eyJhbGciOiJSUzI1NiIs...', // Use user JWT token
22
+ redirect3dsURI: '/3ds' // Any valid URI in your app that captures 3ds redirect
21
23
  };
22
24
 
23
25
  function Checkout() {
@@ -52,4 +54,19 @@ function CheckoutContent() {
52
54
  </div>
53
55
  );
54
56
  }
57
+
58
+ import { useCapture3DS } from '@superlogic/spree-pay';
59
+
60
+ // example 3DS redirect page hosted on /3ds
61
+ export default function ThreeDSRedirectPage() {
62
+ // take payment intent from search params as payment_intent
63
+ const searchParams = exampleGetSearchParams();
64
+
65
+ // place that hook, it will take paymentIntent and close 3ds modal
66
+ useCapture3DS({ paymentIntent: searchParams['payment_intent'] });
67
+
68
+ // Render null or any other UI/Loader
69
+ return null;
70
+ }
71
+
55
72
  ```