From eadcfbcdd283dcf5e7b695098006feef432749c6 Mon Sep 17 00:00:00 2001 From: amoskeyz Date: Fri, 28 Jun 2024 13:12:26 +0100 Subject: [PATCH] add payment mode --- README.md | 4 ++++ example/src/App.tsx | 1 + package.json | 2 +- src/index.tsx | 3 ++- yarn.lock | 58 ++++++++++++++++++++++----------------------- 5 files changed, 37 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 3b6bf99..e27d286 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ export default function App() { onSuccess={(e) => onSuccess(e)} // OPTIONAL ref={hydrogenPayRef} // REQUIRED autoStart={true} // OPTIONAL + mode="TEST" /> ); @@ -122,6 +123,7 @@ export default function App() { onClose={(e) => onClose(e)} // OPTIONAL onSuccess={(e) => onSuccess(e)} // OPTIONAL ref={hydrogenPayRef} // REQUIRED + mode="TEST" /> startPayment()} @@ -189,6 +191,7 @@ export default function App() { buttonText="Hydrogen Pay Button" //OPTIONAL buttonStyle={{}} // OPTIONAL buttontextStyles={{}} // OPTIONAL + mode="TEST" /> ); @@ -216,3 +219,4 @@ export default function App() { | isRecurring | `boolean` | Optional | Recurring Payment | | frequency | `String` | Optional | Recurring Payment frequency | | autoStart | `Boolean` | Optional | Automatically start the sdk | +| mode | `String` | Required | Payment Mode e.g LIVE, TEST | diff --git a/example/src/App.tsx b/example/src/App.tsx index 0c3c9dc..e006bbe 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -55,6 +55,7 @@ export default function App() { buttonStyle={{}} // OPTIONAL buttontextStyles={{}} // OPTIONAL autoStart={false} // OPTIONAL + mode="LIVE" //REQUIRED /> startPayment()} diff --git a/package.json b/package.json index 78587d2..1e7732f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hydrogenpay-react-native-webview", - "version": "0.0.4", + "version": "0.0.5", "description": "HydrogenPay's react native webview wrapper", "main": "lib/commonjs/index", "module": "lib/module/index", diff --git a/src/index.tsx b/src/index.tsx index b1bad1c..c892ea8 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -35,6 +35,7 @@ interface PaymentPayload { buttontextStyles?: { [key: string]: string }; buttonText?: string; autoStart?: boolean; + mode: 'LIVE' | 'TEST'; } export const HydrogenCheckout = forwardRef( @@ -52,7 +53,7 @@ export const HydrogenCheckout = forwardRef( Hydrogen Pay -