Skip to content

Commit

Permalink
fixes to support fragment viewgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
Subhash703 committed Jul 24, 2024
1 parent 9536d53 commit 71a5ccd
Show file tree
Hide file tree
Showing 7 changed files with 300 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<html>
<head>
<title>MYSTIQUE</title>
</head>
<body>
</body>
<script type="text/javascript">
window.__OS = "ANDROID";
window.JBridge = top.JBridge;
window.Android = top.Android;
window.DUIGatekeeper = JBridge;
window.__DEVICE_DETAILS = top.__DEVICE_DETAILS;
window.__payload.client_id = window.__payload.client_id || window.__payload.payload.clientId;
window.JOS.addEventListener("onMerchantEvent")();
</script>
<script type="text/javascript">
var bundleLoad = function() {
var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.id = 'mystique';
newScript.innerHTML = DUIGatekeeper.loadFileInDUI('payments/in.juspay.hyperpay/index_bundle.js');
headID.appendChild(newScript);
}
var serverLoad = function() {
var ip = "10.10.25.170";
var port = "8089";
var url = "http://" + ip + ":" + port;
console.warn("loading from: ", url);
var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.id = 'mystique';
newScript.src = url + "/index_bundle.js";
headID.appendChild(newScript);
}

var devqaLoad = function() {
var headID = document.getElementsByTagName("head")[0];
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
newScript.id = 'mystique';
newScript.src = "https://sandbox.assets.juspay.in/hyper/bundles/app/in.juspay.hyperpay/devqa-PICAF-27665-paymentWidgetFix/common/android/index_bundle.js";
headID.appendChild(newScript);
}

devqaLoad()
</script>
</html>
1 change: 1 addition & 0 deletions example/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">HyperSdkReact Example</string>
<bool name="use_local_assets">false</bool>
</resources>
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
// Hyper SDK
clientId = 'geddit'
hyperSDKVersion = "2.1.25"
excludedMicroSDKs = []
excludedMicroSDKs = ["hyperapay"]
}
repositories {
google()
Expand Down
6 changes: 6 additions & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import HomeScreen from './HomeScreen';
import ProcessScreen from './ProcessScreen';
import OfferScreen from './OfferScreen';

const AppNavigator = createStackNavigator();

Expand All @@ -26,6 +27,11 @@ const App = () => (
component={ProcessScreen}
options={{ title: 'Process Screen' }}
/>
<AppNavigator.Screen
name="OfferScreen"
component={OfferScreen}
options={{ title: 'Offer Screen' }}
/>
</AppNavigator.Navigator>
</NavigationContainer>
);
Expand Down
4 changes: 2 additions & 2 deletions example/src/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { useNavigation } from '@react-navigation/native';
class HomeScreen extends React.Component {
state = {
animation: new Animated.Value(0),
pickerSelected: 'ec',
pickerSelected: 'pp',
};

navigation: any;
Expand Down Expand Up @@ -170,8 +170,8 @@ class HomeScreen extends React.Component {
console.log(val, index);
}}
>
<Picker.Item label="Express Checkout" value="ec" />
<Picker.Item label="Payment Page" value="pp" />
<Picker.Item label="Express Checkout" value="ec" />
</Picker>
</View>

Expand Down
10 changes: 10 additions & 0 deletions example/src/OfferScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react';
import { Text, View } from 'react-native';

export default function OfferScreen() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Offer Screen</Text>
</View>
);
}
Loading

0 comments on commit 71a5ccd

Please sign in to comment.