Skip to content

Commit

Permalink
Merge pull request #10 from HydrogenAfrica/develop
Browse files Browse the repository at this point in the history
add payment mode
  • Loading branch information
folafunmi-db authored Jun 28, 2024
2 parents aea325e + eadcfbc commit 9e1ce49
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 31 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default function App() {
onSuccess={(e) => onSuccess(e)} // OPTIONAL
ref={hydrogenPayRef} // REQUIRED
autoStart={true} // OPTIONAL
mode="TEST"
/>
</View>
);
Expand Down Expand Up @@ -122,6 +123,7 @@ export default function App() {
onClose={(e) => onClose(e)} // OPTIONAL
onSuccess={(e) => onSuccess(e)} // OPTIONAL
ref={hydrogenPayRef} // REQUIRED
mode="TEST"
/>
<TouchableOpacity
onPress={() => startPayment()}
Expand Down Expand Up @@ -189,6 +191,7 @@ export default function App() {
buttonText="Hydrogen Pay Button" //OPTIONAL
buttonStyle={{}} // OPTIONAL
buttontextStyles={{}} // OPTIONAL
mode="TEST"
/>
</View>
);
Expand Down Expand Up @@ -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 |
1 change: 1 addition & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default function App() {
buttonStyle={{}} // OPTIONAL
buttontextStyles={{}} // OPTIONAL
autoStart={false} // OPTIONAL
mode="LIVE" //REQUIRED
/>
<TouchableOpacity
onPress={() => startPayment()}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ interface PaymentPayload {
buttontextStyles?: { [key: string]: string };
buttonText?: string;
autoStart?: boolean;
mode: 'LIVE' | 'TEST';
}

export const HydrogenCheckout = forwardRef(
Expand All @@ -52,7 +53,7 @@ export const HydrogenCheckout = forwardRef(
<title>Hydrogen Pay</title>
</head>
<body>
<script src="https://hydrogenshared.blob.core.windows.net/paymentgateway/paymentGatewayIntegration_v1PROD.js" module>
<script src="${payload.mode === 'LIVE' ? 'https://hydrogenshared.blob.core.windows.net/paymentgateway/paymentGatewayIntegration_v1PROD.js' : 'https://hydrogenshared.blob.core.windows.net/paymentgateway/paymentGatewayIntegration_v1.js'}" module>
</script>
<script>
let paymentResponse;
Expand Down
58 changes: 29 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9322,35 +9322,6 @@ __metadata:
languageName: node
linkType: hard

"h-webview@workspace:.":
version: 0.0.0-use.local
resolution: "h-webview@workspace:."
dependencies:
"@commitlint/config-conventional": ^17.0.2
"@evilmartians/lefthook": ^1.5.0
"@react-native/eslint-config": ^0.73.1
"@release-it/conventional-changelog": ^5.0.0
"@types/jest": ^29.5.5
"@types/react": ^18.2.44
commitlint: ^17.0.2
del-cli: ^5.1.0
eslint: ^8.51.0
eslint-config-prettier: ^9.0.0
eslint-plugin-prettier: ^5.0.1
jest: ^29.7.0
prettier: ^3.0.3
react: 18.2.0
react-native: 0.74.2
react-native-builder-bob: ^0.20.0
react-native-webview: ^13.10.4
release-it: ^15.0.0
typescript: ^5.2.2
peerDependencies:
react: "*"
react-native: "*"
languageName: unknown
linkType: soft

"handle-thing@npm:^2.0.0":
version: 2.0.1
resolution: "handle-thing@npm:2.0.1"
Expand Down Expand Up @@ -9756,6 +9727,35 @@ __metadata:
languageName: unknown
linkType: soft

"hydrogenpay-react-native-webview@workspace:.":
version: 0.0.0-use.local
resolution: "hydrogenpay-react-native-webview@workspace:."
dependencies:
"@commitlint/config-conventional": ^17.0.2
"@evilmartians/lefthook": ^1.5.0
"@react-native/eslint-config": ^0.73.1
"@release-it/conventional-changelog": ^5.0.0
"@types/jest": ^29.5.5
"@types/react": ^18.2.44
commitlint: ^17.0.2
del-cli: ^5.1.0
eslint: ^8.51.0
eslint-config-prettier: ^9.0.0
eslint-plugin-prettier: ^5.0.1
jest: ^29.7.0
prettier: ^3.0.3
react: 18.2.0
react-native: 0.74.2
react-native-builder-bob: ^0.20.0
react-native-webview: ^13.10.4
release-it: ^15.0.0
typescript: ^5.2.2
peerDependencies:
react: "*"
react-native: "*"
languageName: unknown
linkType: soft

"hyphenate-style-name@npm:^1.0.3":
version: 1.1.0
resolution: "hyphenate-style-name@npm:1.1.0"
Expand Down

0 comments on commit 9e1ce49

Please sign in to comment.