Skip to content

Commit

Permalink
version 3.0.0 code update with newer gradle support versions
Browse files Browse the repository at this point in the history
  • Loading branch information
shahfaizalpayu committed Nov 7, 2022
1 parent b92fb84 commit 6009bee
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 34 deletions.
65 changes: 39 additions & 26 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
const [udf3, setUdf3] = useState('udf3');
const [udf4, setUdf4] = useState('udf4');
const [udf5, setUdf5] = useState('udf5');
const [merchantSalt, setMerchantSalt] = useState('wia56q6O');
const [merchantSalt, setMerchantSalt] = useState('4R38IvwiV57FwVpsgOvTXBdLE4tHUXFW');

const [userCredential, setUserCredential] = useState('umang:arya');

Expand Down Expand Up @@ -252,85 +252,85 @@
return (
<ScrollView style={styles.container}>
<View >
<Text style={styles.welcome}>☆PayUCheckoutPro Sample App</Text>
<Text style={styles.welcome}> PayUCheckoutPro {'\n'}Sample App</Text>
</View>
<View style={styles.cell}>
<Text style={styles.category}>Merchant Key</Text>
<TextInput style={styles.values} defaultValue={key} onChangeText={text => { setKey(text)}} />
<TextInput style={styles.valuesTextInput} defaultValue={key} onChangeText={text => { setKey(text)}} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>Merchant Salt</Text>
<TextInput style={styles.values} defaultValue={merchantSalt} onChangeText={text => { setMerchantSalt(text) }} />
<TextInput style={styles.valuesTextInput} defaultValue={merchantSalt} onChangeText={text => { setMerchantSalt(text) }} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>Environment</Text>
<TextInput style={styles.values} defaultValue={environment} onChangeText={text => { setEnvironment(text) }} />
<TextInput style={styles.valuesTextInput} defaultValue={environment} onChangeText={text => { setEnvironment(text) }} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>Enter transcation amount</Text>
<TextInput style={styles.values} defaultValue={amount} onChangeText={text => { setAmount(text) }} />
<Text style={styles.category}>Enter Transcation{'\n'}Amount</Text>
<TextInput style={styles.valuesTextInput} defaultValue={amount} onChangeText={text => { setAmount(text) }} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>Email</Text>
<TextInput style={styles.values} defaultValue={email} onChangeText={text => { setEmail(text) }} />
<TextInput style={styles.valuesTextInput} defaultValue={email} onChangeText={text => { setEmail(text) }} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>User Credential</Text>
<TextInput style={styles.values} defaultValue={userCredential} onChangeText={text => { setUserCredential(text) }} />
<TextInput style={styles.valuesTextInput} defaultValue={userCredential} onChangeText={text => { setUserCredential(text) }} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>UDF1</Text>
<TextInput style={styles.values} defaultValue={udf1} onChangeText={text => { setUdf1(text) }} />
<TextInput style={styles.valuesTextInput} defaultValue={udf1} onChangeText={text => { setUdf1(text) }} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>UDF2</Text>
<TextInput style={styles.values} defaultValue={udf2} onChangeText={text => { setUdf2(text)}} />
<TextInput style={styles.valuesTextInput} defaultValue={udf2} onChangeText={text => { setUdf2(text)}} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>UDF3</Text>
<TextInput style={styles.values} defaultValue={udf3} onChangeText={text => { setUdf3(text)}} />
<TextInput style={styles.valuesTextInput} defaultValue={udf3} onChangeText={text => { setUdf3(text)}} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>UDF4</Text>
<TextInput style={styles.values} defaultValue={udf4} onChangeText={text => { setUdf4(text)}} />
<TextInput style={styles.valuesTextInput} defaultValue={udf4} onChangeText={text => { setUdf4(text)}} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>UDF5</Text>
<TextInput style={styles.values} defaultValue={udf5} onChangeText={text => { setUdf5(text) }} />
<TextInput style={styles.valuesTextInput} defaultValue={udf5} onChangeText={text => { setUdf5(text) }} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>Merchant Surl/Furl Timeout</Text>
<TextInput style={styles.values} defaultValue={String(merchantResponseTimeout)} onChangeText={text => { setMerchantResponseTimeout( parseInt(text)) }} />
<Text style={styles.category}>Merchant Surl/Furl{'\n'}Timeout</Text>
<TextInput style={styles.valuesTextInput} defaultValue={String(merchantResponseTimeout)} onChangeText={text => { setMerchantResponseTimeout( parseInt(text)) }} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>Auto Select Otp</Text>
<Switch style={styles.values} value={autoSelectOtp} onValueChange={toggleSelectOTP} />
<Switch style={styles.valuesSwitch} value={autoSelectOtp} onValueChange={toggleSelectOTP} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>Enable enforce Payment</Text>
<Switch style={styles.values} value={enforcePaymentEnable} onValueChange={toggleEnforcePaymentEnable} />
<Text style={styles.category}>Enable enforce{'\n'}Payment</Text>
<Switch style={styles.valuesSwitch} value={enforcePaymentEnable} onValueChange={toggleEnforcePaymentEnable} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>SMS Permission</Text>
<Switch style={styles.values} value={merchantSMSPermission} onValueChange={togglePermission} />
<Switch style={styles.valuesSwitch} value={merchantSMSPermission} onValueChange={togglePermission} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>Auto Approve Otp</Text>
<Switch style={styles.values} value={autoApprove} onValueChange={toggleAutoApproveOTP} />
<Switch style={styles.valuesSwitch} value={autoApprove} onValueChange={toggleAutoApproveOTP} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>Enable SI</Text>
<Switch style={styles.values} value={enableSI} onValueChange={toggleEnableSI} />
<Switch style={styles.valuesSwitch} value={enableSI} onValueChange={toggleEnableSI} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>SurePay (0-3)</Text>
<TextInput style={styles.values} defaultValue={String(surePayCount)} onChangeText={text => { setSurePayCount(parseInt(text) )}} />
<TextInput style={styles.valuesTextInput} defaultValue={String(surePayCount)} onChangeText={text => { setSurePayCount(parseInt(text) )}} />
</View>
<View style={styles.cell}>
<Text style={styles.category}>Merchant Name</Text>
<TextInput style={styles.values} defaultValue={merchantName} onChangeText={text => { setMerchantName(text) }} />
<TextInput style={styles.valuesTextInput} defaultValue={merchantName} onChangeText={text => { setMerchantName(text) }} />
</View>
<Button title={'Pay Now'} onPress={()=>{launchPayU()}} />
<Button title={'Pay Now'} onPress={()=>{launchPayU()}} />
</ScrollView>
);
}
Expand All @@ -351,7 +351,7 @@
marginBottom: 20,
padding:10,
backgroundColor: '#6495DD',

fontWeight:"bold"
},
category: {
fontSize: 14,
Expand All @@ -362,6 +362,19 @@
fontSize: 14,
textAlign: 'right'
},
valuesTextInput: {
fontSize: 14,
textAlign: 'right',
width:180,
borderWidth: .5,
borderRadius: 5,
padding: 10,
backgroundColor:'#F2F3F4'
},
valuesSwitch: {
fontSize: 14,
textAlign: 'right'
},
instructions: {
textAlign: 'center',
color: '#333333',
Expand Down
33 changes: 29 additions & 4 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
pickFirst 'lib/armeabi-v7a/libfbjni.so'
pickFirst 'lib/arm64-v8a/libc++_shared.so'
pickFirst 'lib/arm64-v8a/libfbjni.so'
pickFirst 'lib/x86_64/libfbjni.so'
pickFirst 'lib/x86/libfbjni.so'
pickFirst 'lib/x86/libc++_shared.so'
pickFirst 'lib/x86_64/libc++_shared.so'
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
}

defaultConfig {
applicationId "com.example"
Expand Down Expand Up @@ -158,16 +168,31 @@ android {

dependencies {
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
//noinspection GradleDynamicVersion
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
} else {
implementation jscFlavor
}
implementation project(':payu-non-seam-less-react')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation ("com.facebook.react:react-native:+") {
exclude group:'com.facebook.fbjni'
}
implementation('com.facebook.flipper:flipper:0.173.0') {
exclude group:'com.facebook.fbjni'
}
implementation('com.facebook.flipper:flipper-network-plugin:0.173.0') {
exclude group:'com.facebook.fbjni'
exclude group:'com.facebook.flipper'
}
implementation('com.facebook.flipper:flipper-fresco-plugin:0.173.0') {
exclude group:'com.facebook.fbjni'
exclude group:'com.facebook.flipper'
}

}

// Run this once to be able to run the application with BUCK
Expand Down
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
Expand Down
8 changes: 4 additions & 4 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

buildscript {
ext {
buildToolsVersion = "28.0.3"
buildToolsVersion = "30.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
compileSdkVersion = 33
targetSdkVersion = 33
supportLibVersion = "28.0.0"
}
repositories {
Expand All @@ -30,6 +30,6 @@ allprojects {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
jcenter()//Since we are using older react version which has artifacts on JCenter
// jcenter()//Since we are using older react version which has artifacts on JCenter
}
}
1 change: 1 addition & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2048m
android.useAndroidX=true
android.enableJetifier=true
MYAPP_UPLOAD_STORE_FILE=my-upload-key.keystore
Expand Down

0 comments on commit 6009bee

Please sign in to comment.