@superlogic/spree-pay 0.1.1 → 0.1.2

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
@@ -12,6 +12,7 @@ npm i @superlogic/spree-pay
12
12
 
13
13
  ```tsx
14
14
  import { useState } from 'react';
15
+
15
16
  import { SpreePay, SpreePayProvider, useSpreePay } from '@superlogic/spree-pay';
16
17
 
17
18
  const spreeEnv = {
@@ -19,8 +20,7 @@ const spreeEnv = {
19
20
  accessToken: 'demo-access-token', // Use env vars in production
20
21
  };
21
22
 
22
- const [status, setStatus] = useState<'idle' | 'processing' | 'success' | 'error'>('idle');
23
-
23
+ function Checkout() {
24
24
  return (
25
25
  <SpreePayProvider env={spreeEnv}>
26
26
  <CheckoutContent />
@@ -46,7 +46,7 @@ function CheckoutContent() {
46
46
 
47
47
  return (
48
48
  <div style={{ maxWidth: 540 }}>
49
- <SpreePay amount="$199.00" onProcess={handleProcess} />
49
+ <SpreePay amount={99} onProcess={handleProcess} />
50
50
  {status === 'success' && <p>Payment successful! Thank you for your order.</p>}
51
51
  {status === 'error' && <p>Payment failed. Please try again.</p>}
52
52
  </div>