diff --git a/android/build.gradle b/android/build.gradle index 08d754e..a899895 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:7.1.3' } } @@ -22,10 +22,11 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - compileSdkVersion 31 - + compileSdkVersion 34 + namespace 'com.razorpay.razorpay_flutter' defaultConfig { minSdkVersion 19 + targetSdkVersion 34 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } lintOptions { diff --git a/android/gradle.properties b/android/gradle.properties index 8bd86f6..f5a5155 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1 +1,16 @@ +## For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx1024m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +#Mon May 27 12:12:58 IST 2024 +android.enableJetifier=true +android.useAndroidX=true org.gradle.jvmargs=-Xmx1536M diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index ffed3a2..2ec77e5 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/src/main/java/com/razorpay/razorpay_flutter/RazorpayDelegate.java b/android/src/main/java/com/razorpay/razorpay_flutter/RazorpayDelegate.java index fa0ea19..3e248e5 100644 --- a/android/src/main/java/com/razorpay/razorpay_flutter/RazorpayDelegate.java +++ b/android/src/main/java/com/razorpay/razorpay_flutter/RazorpayDelegate.java @@ -52,13 +52,11 @@ void setPackageName(String packageName){ void openCheckout(Map arguments, Result result) { this.pendingResult = result; - JSONObject options = new JSONObject(arguments); if (activity.getPackageName().equalsIgnoreCase(packageName)){ Intent intent = new Intent(activity, CheckoutActivity.class); intent.putExtra("OPTIONS", options.toString()); intent.putExtra("FRAMEWORK", "flutter"); - activity.startActivityForResult(intent, Checkout.RZP_REQUEST_CODE); } diff --git a/android/src/main/java/com/razorpay/razorpay_flutter/RazorpayFlutterPlugin.java b/android/src/main/java/com/razorpay/razorpay_flutter/RazorpayFlutterPlugin.java index 6a3f945..bfcc3d0 100644 --- a/android/src/main/java/com/razorpay/razorpay_flutter/RazorpayFlutterPlugin.java +++ b/android/src/main/java/com/razorpay/razorpay_flutter/RazorpayFlutterPlugin.java @@ -1,5 +1,7 @@ package com.razorpay.razorpay_flutter; +import android.util.Log; + import androidx.annotation.NonNull; import org.json.JSONException; @@ -53,6 +55,7 @@ public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { */ private RazorpayFlutterPlugin(Registrar registrar) { this.razorpayDelegate = new RazorpayDelegate(registrar.activity()); + this.razorpayDelegate.setPackageName(registrar.activity().getPackageName()); registrar.addActivityResultListener(razorpayDelegate); } @@ -67,10 +70,6 @@ public void onMethodCall(MethodCall call, Result result) { razorpayDelegate.openCheckout((Map) call.arguments, result); break; - case "setPackageName": - razorpayDelegate.setPackageName((String)call.arguments); - break; - case "resync": razorpayDelegate.resync(result); break; @@ -86,6 +85,7 @@ public void onMethodCall(MethodCall call, Result result) { public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { this.razorpayDelegate = new RazorpayDelegate(binding.getActivity()); this.pluginBinding = binding; + razorpayDelegate.setPackageName(binding.getActivity().getPackageName()); binding.addActivityResultListener(razorpayDelegate); } diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index 759fb16..154a3e5 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/fluttertoast-8.2.2/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/package_info_plus-4.0.1/","native_build":true,"dependencies":[]},{"name":"razorpay_flutter","path":"/Users/vivek.shindhe/Razorpay/Flutter/razorpay-flutter/","native_build":true,"dependencies":["fluttertoast","package_info_plus"]}],"android":[{"name":"fluttertoast","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/fluttertoast-8.2.2/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/package_info_plus-4.0.1/","native_build":true,"dependencies":[]},{"name":"razorpay_flutter","path":"/Users/vivek.shindhe/Razorpay/Flutter/razorpay-flutter/","native_build":true,"dependencies":["fluttertoast","package_info_plus"]}],"macos":[{"name":"package_info_plus","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/package_info_plus-4.0.1/","native_build":true,"dependencies":[]}],"linux":[{"name":"package_info_plus","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/package_info_plus-4.0.1/","native_build":false,"dependencies":[]}],"windows":[{"name":"package_info_plus","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/package_info_plus-4.0.1/","native_build":false,"dependencies":[]}],"web":[{"name":"fluttertoast","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/fluttertoast-8.2.2/","dependencies":[]},{"name":"package_info_plus","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/package_info_plus-4.0.1/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"razorpay_flutter","dependencies":["fluttertoast","package_info_plus"]}],"date_created":"2024-01-10 16:42:19.459133","version":"3.13.6"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"fluttertoast","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/fluttertoast-8.2.5/","native_build":true,"dependencies":[]},{"name":"razorpay_flutter","path":"/Users/vivek.shindhe/Razorpay/Flutter/razorpay-flutter/","native_build":true,"dependencies":["fluttertoast"]}],"android":[{"name":"fluttertoast","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/fluttertoast-8.2.5/","native_build":true,"dependencies":[]},{"name":"razorpay_flutter","path":"/Users/vivek.shindhe/Razorpay/Flutter/razorpay-flutter/","native_build":true,"dependencies":["fluttertoast"]}],"macos":[],"linux":[],"windows":[],"web":[{"name":"fluttertoast","path":"/Users/vivek.shindhe/.pub-cache/hosted/pub.dev/fluttertoast-8.2.5/","dependencies":[]}]},"dependencyGraph":[{"name":"fluttertoast","dependencies":[]},{"name":"razorpay_flutter","dependencies":["fluttertoast"]}],"date_created":"2024-05-27 12:19:23.874930","version":"3.22.0"} \ No newline at end of file diff --git a/example/.fvm/flutter_sdk b/example/.fvm/flutter_sdk new file mode 120000 index 0000000..6c54ade --- /dev/null +++ b/example/.fvm/flutter_sdk @@ -0,0 +1 @@ +/Users/vivek.shindhe/fvm/versions/3.22.0 \ No newline at end of file diff --git a/example/.fvm/fvm_config.json b/example/.fvm/fvm_config.json new file mode 100644 index 0000000..6a56dfc --- /dev/null +++ b/example/.fvm/fvm_config.json @@ -0,0 +1,4 @@ +{ + "flutterSdkVersion": "3.22.0", + "flavors": {} +} \ No newline at end of file diff --git a/example/android/.gradle/7.4/checksums/checksums.lock b/example/android/.gradle/7.4/checksums/checksums.lock new file mode 100644 index 0000000..bdc068b Binary files /dev/null and b/example/android/.gradle/7.4/checksums/checksums.lock differ diff --git a/example/android/.gradle/7.4/checksums/md5-checksums.bin b/example/android/.gradle/7.4/checksums/md5-checksums.bin new file mode 100644 index 0000000..b065efe Binary files /dev/null and b/example/android/.gradle/7.4/checksums/md5-checksums.bin differ diff --git a/example/android/.gradle/7.4/checksums/sha1-checksums.bin b/example/android/.gradle/7.4/checksums/sha1-checksums.bin new file mode 100644 index 0000000..c090272 Binary files /dev/null and b/example/android/.gradle/7.4/checksums/sha1-checksums.bin differ diff --git a/example/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock b/example/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock new file mode 100644 index 0000000..0174156 Binary files /dev/null and b/example/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock differ diff --git a/example/android/.gradle/7.4/dependencies-accessors/gc.properties b/example/android/.gradle/7.4/dependencies-accessors/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/example/android/.gradle/7.4/executionHistory/executionHistory.bin b/example/android/.gradle/7.4/executionHistory/executionHistory.bin new file mode 100644 index 0000000..73df270 Binary files /dev/null and b/example/android/.gradle/7.4/executionHistory/executionHistory.bin differ diff --git a/example/android/.gradle/7.4/executionHistory/executionHistory.lock b/example/android/.gradle/7.4/executionHistory/executionHistory.lock new file mode 100644 index 0000000..eeaeeef Binary files /dev/null and b/example/android/.gradle/7.4/executionHistory/executionHistory.lock differ diff --git a/example/android/.gradle/7.4/fileChanges/last-build.bin b/example/android/.gradle/7.4/fileChanges/last-build.bin new file mode 100644 index 0000000..f76dd23 Binary files /dev/null and b/example/android/.gradle/7.4/fileChanges/last-build.bin differ diff --git a/example/android/.gradle/7.4/fileHashes/fileHashes.bin b/example/android/.gradle/7.4/fileHashes/fileHashes.bin new file mode 100644 index 0000000..be162f5 Binary files /dev/null and b/example/android/.gradle/7.4/fileHashes/fileHashes.bin differ diff --git a/example/android/.gradle/7.4/fileHashes/fileHashes.lock b/example/android/.gradle/7.4/fileHashes/fileHashes.lock new file mode 100644 index 0000000..a5537ce Binary files /dev/null and b/example/android/.gradle/7.4/fileHashes/fileHashes.lock differ diff --git a/example/android/.gradle/7.4/fileHashes/resourceHashesCache.bin b/example/android/.gradle/7.4/fileHashes/resourceHashesCache.bin new file mode 100644 index 0000000..9695414 Binary files /dev/null and b/example/android/.gradle/7.4/fileHashes/resourceHashesCache.bin differ diff --git a/example/android/.gradle/7.4/gc.properties b/example/android/.gradle/7.4/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/example/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/example/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock new file mode 100644 index 0000000..8cfaf60 Binary files /dev/null and b/example/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/example/android/.gradle/buildOutputCleanup/cache.properties b/example/android/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..19dfb77 --- /dev/null +++ b/example/android/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Sun May 26 15:05:25 IST 2024 +gradle.version=7.4 diff --git a/example/android/.gradle/buildOutputCleanup/outputFiles.bin b/example/android/.gradle/buildOutputCleanup/outputFiles.bin new file mode 100644 index 0000000..545f3cf Binary files /dev/null and b/example/android/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/example/android/.gradle/config.properties b/example/android/.gradle/config.properties new file mode 100644 index 0000000..f1440e6 --- /dev/null +++ b/example/android/.gradle/config.properties @@ -0,0 +1,2 @@ +#Sun May 26 14:54:26 IST 2024 +java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home diff --git a/example/android/.gradle/file-system.probe b/example/android/.gradle/file-system.probe new file mode 100644 index 0000000..b1b6862 Binary files /dev/null and b/example/android/.gradle/file-system.probe differ diff --git a/example/android/.gradle/vcs-1/gc.properties b/example/android/.gradle/vcs-1/gc.properties new file mode 100644 index 0000000..e69de29 diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index acb0285..8cdf78b 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -47,7 +47,7 @@ android { applicationId "com.razorpay.razorpay_flutter.example" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. - minSdkVersion 19 + minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName @@ -70,5 +70,6 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.5.0' + implementation 'com.android.support:multidex:1.0.3' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' } diff --git a/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java new file mode 100644 index 0000000..752fc18 --- /dev/null +++ b/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java @@ -0,0 +1,25 @@ +// Generated file. +// +// If you wish to remove Flutter's multidex support, delete this entire file. +// +// Modifications to this file should be done in a copy under a different name +// as this file may be regenerated. + +package io.flutter.app; + +import android.app.Application; +import android.content.Context; +import androidx.annotation.CallSuper; +import androidx.multidex.MultiDex; + +/** + * Extension of {@link android.app.Application}, adding multidex support. + */ +public class FlutterMultiDexApplication extends Application { + @Override + @CallSuper + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } +} diff --git a/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java index 2765e30..a5369ce 100644 --- a/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java +++ b/example/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java @@ -20,11 +20,6 @@ public static void registerWith(@NonNull FlutterEngine flutterEngine) { } catch (Exception e) { Log.e(TAG, "Error registering plugin fluttertoast, io.github.ponnamkarthik.toast.fluttertoast.FlutterToastPlugin", e); } - try { - flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin()); - } catch (Exception e) { - Log.e(TAG, "Error registering plugin package_info_plus, dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin", e); - } try { flutterEngine.getPlugins().add(new com.razorpay.razorpay_flutter.RazorpayFlutterPlugin()); } catch (Exception e) { diff --git a/example/android/gradle/wrapper/gradle-wrapper.jar b/example/android/gradle/wrapper/gradle-wrapper.jar new file mode 100755 index 0000000..13372ae Binary files /dev/null and b/example/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/example/android/gradlew b/example/android/gradlew new file mode 100755 index 0000000..9d82f78 --- /dev/null +++ b/example/android/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/example/android/gradlew.bat b/example/android/gradlew.bat new file mode 100755 index 0000000..8a0b282 --- /dev/null +++ b/example/android/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/example/android/local.properties b/example/android/local.properties index d8052f0..54bd75a 100644 --- a/example/android/local.properties +++ b/example/android/local.properties @@ -1,5 +1,5 @@ sdk.dir=/Users/vivek.shindhe/Library/Android/sdk -flutter.sdk=/Users/vivek.shindhe/fvm/versions/3.3.4 +flutter.sdk=/Users/vivek.shindhe/fvm/versions/3.22.0 flutter.buildMode=debug flutter.versionName=1.0.0 flutter.versionCode=1 \ No newline at end of file diff --git a/example/ios/Flutter/Generated.xcconfig b/example/ios/Flutter/Generated.xcconfig index 89c2b06..ace63c7 100644 --- a/example/ios/Flutter/Generated.xcconfig +++ b/example/ios/Flutter/Generated.xcconfig @@ -1,6 +1,6 @@ // This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/ramprasad.a/Developer/flutter -FLUTTER_APPLICATION_PATH=/Users/ramprasad.a/Documents/RamprasadA/project/razorpay-flutter/example +FLUTTER_ROOT=/Users/vivek.shindhe/fvm/versions/3.22.0 +FLUTTER_APPLICATION_PATH=/Users/vivek.shindhe/Razorpay/Flutter/razorpay-flutter/example COCOAPODS_PARALLEL_CODE_SIGN=true FLUTTER_TARGET=lib/main.dart FLUTTER_BUILD_DIR=build diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh index 43746ee..5c3f27c 100755 --- a/example/ios/Flutter/flutter_export_environment.sh +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -1,7 +1,7 @@ #!/bin/sh # This is a generated file; do not edit or check into version control. -export "FLUTTER_ROOT=/Users/ramprasad.a/Developer/flutter" -export "FLUTTER_APPLICATION_PATH=/Users/ramprasad.a/Documents/RamprasadA/project/razorpay-flutter/example" +export "FLUTTER_ROOT=/Users/vivek.shindhe/fvm/versions/3.22.0" +export "FLUTTER_APPLICATION_PATH=/Users/vivek.shindhe/Razorpay/Flutter/razorpay-flutter/example" export "COCOAPODS_PARALLEL_CODE_SIGN=true" export "FLUTTER_TARGET=lib/main.dart" export "FLUTTER_BUILD_DIR=build" diff --git a/example/ios/Runner/GeneratedPluginRegistrant.m b/example/ios/Runner/GeneratedPluginRegistrant.m index a3ecf99..7ea97af 100644 --- a/example/ios/Runner/GeneratedPluginRegistrant.m +++ b/example/ios/Runner/GeneratedPluginRegistrant.m @@ -12,12 +12,6 @@ @import fluttertoast; #endif -#if __has_include() -#import -#else -@import package_info_plus; -#endif - #if __has_include() #import #else @@ -28,7 +22,6 @@ @implementation GeneratedPluginRegistrant + (void)registerWithRegistry:(NSObject*)registry { [FluttertoastPlugin registerWithRegistrar:[registry registrarForPlugin:@"FluttertoastPlugin"]]; - [FLTPackageInfoPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTPackageInfoPlusPlugin"]]; [RazorpayFlutterPlugin registerWithRegistrar:[registry registrarForPlugin:@"RazorpayFlutterPlugin"]]; } diff --git a/example/pubspec.lock b/example/pubspec.lock index 5e916e4..4bcb4d1 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -37,18 +37,18 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 url: "https://pub.dev" source: hosted - version: "1.0.5" + version: "1.0.8" eventify: dependency: transitive description: @@ -65,14 +65,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 - url: "https://pub.dev" - source: hosted - version: "2.0.2" flutter: dependency: "direct main" description: flutter @@ -92,89 +84,73 @@ packages: dependency: transitive description: name: fluttertoast - sha256: "474f7d506230897a3cd28c965ec21c5328ae5605fc9c400cd330e9e9d6ac175c" + sha256: "81b68579e23fcbcada2db3d50302813d2371664afe6165bc78148050ab94bf66" + url: "https://pub.dev" + source: hosted + version: "8.2.5" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" url: "https://pub.dev" source: hosted - version: "8.2.2" - http: + version: "10.0.4" + leak_tracker_flutter_testing: dependency: transitive description: - name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + name: leak_tracker_flutter_testing + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" url: "https://pub.dev" source: hosted - version: "0.13.6" - http_parser: + version: "3.0.3" + leak_tracker_testing: dependency: transitive description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.dev" source: hosted - version: "4.0.2" + version: "3.0.1" matcher: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - package_info_plus: - dependency: transitive - description: - name: package_info_plus - sha256: "28386bbe89ab5a7919a47cea99cdd1128e5a6e0bbd7eaafe20440ead84a15de3" - url: "https://pub.dev" - source: hosted - version: "4.0.1" - package_info_plus_platform_interface: - dependency: transitive - description: - name: package_info_plus_platform_interface - sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "1.12.0" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "1.9.0" razorpay_flutter: dependency: "direct main" description: path: ".." relative: true source: path - version: "1.3.5" + version: "1.3.6" sky_engine: dependency: transitive description: flutter @@ -192,18 +168,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -224,18 +200,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.0" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" + version: "0.7.0" vector_math: dependency: transitive description: @@ -244,22 +212,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - web: - dependency: transitive - description: - name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 - url: "https://pub.dev" - source: hosted - version: "0.1.4-beta" - win32: + vm_service: dependency: transitive description: - name: win32 - sha256: "6ca3aaab1790eeb1f5cad232e33d9c53ba66e884dd3e7686c4e730bffc45f1a3" + name: vm_service + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" url: "https://pub.dev" source: hosted - version: "5.0.2" + version: "14.2.1" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=3.3.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index d484ea7..d8076f2 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -20,7 +20,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.17.6 <3.0.0" + sdk: ">=3.3.0 <4.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions diff --git a/lib/razorpay_flutter.dart b/lib/razorpay_flutter.dart index 65b7343..5fd357f 100644 --- a/lib/razorpay_flutter.dart +++ b/lib/razorpay_flutter.dart @@ -1,7 +1,5 @@ import 'package:flutter/services.dart'; import 'package:eventify/eventify.dart'; -import 'package:package_info_plus/package_info_plus.dart'; -import 'dart:io' show Platform; class Razorpay { // Response codes from platform @@ -45,10 +43,6 @@ class Razorpay { }); return; } - if (Platform.isAndroid) { - PackageInfo packageInfo = await PackageInfo.fromPlatform(); - _channel.invokeMethod('setPackageName', packageInfo.packageName); - } var response = await _channel.invokeMethod('open', options); _handleResult(response); diff --git a/pubspec.lock b/pubspec.lock index c22d200..626b80d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -105,14 +105,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 - url: "https://pub.dev" - source: hosted - version: "2.0.2" file: dependency: transitive description: @@ -160,14 +152,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" - http: - dependency: transitive - description: - name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" - url: "https://pub.dev" - source: hosted - version: "0.13.6" http_multi_server: dependency: transitive description: @@ -256,22 +240,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.0" - package_info_plus: - dependency: "direct main" - description: - name: package_info_plus - sha256: "28386bbe89ab5a7919a47cea99cdd1128e5a6e0bbd7eaafe20440ead84a15de3" - url: "https://pub.dev" - source: hosted - version: "4.0.1" - package_info_plus_platform_interface: - dependency: transitive - description: - name: package_info_plus_platform_interface - sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" - url: "https://pub.dev" - source: hosted - version: "2.0.1" path: dependency: transitive description: @@ -280,14 +248,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" - url: "https://pub.dev" - source: hosted - version: "2.1.4" pool: dependency: transitive description: @@ -477,14 +437,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" - win32: - dependency: transitive - description: - name: win32 - sha256: "6ca3aaab1790eeb1f5cad232e33d9c53ba66e884dd3e7686c4e730bffc45f1a3" - url: "https://pub.dev" - source: hosted - version: "5.0.2" yaml: dependency: transitive description: @@ -495,4 +447,4 @@ packages: version: "3.1.2" sdks: dart: ">=3.1.0-185.0.dev <4.0.0" - flutter: ">=3.3.0" + flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 7a779a3..69e899f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,6 @@ dependencies: sdk: flutter eventify: ^1.0.0 fluttertoast: ^8.0.7 - package_info_plus: ^4.0.1 dev_dependencies: flutter_test: