Code Monkey home page Code Monkey logo

razorpay-flutter's Introduction

Razorpay Flutter

Flutter plugin for Razorpay SDK.

pub package

Getting Started

This flutter plugin is a wrapper around our Android and iOS SDKs.

The following documentation is only focused on the wrapper around our native Android and iOS SDKs. To know more about our SDKs and how to link them within the projects, refer to the following documentation:

Android: https://razorpay.com/docs/checkout/android/

iOS: https://razorpay.com/docs/ios/

To know more about Razorpay payment flow and steps involved, read up here: https://razorpay.com/docs/

Prerequisites

  • Learn about the Razorpay Payment Flow.
  • Sign up for a Razorpay Account and generate the API Keys from the Razorpay Dashboard. Using the Test keys helps simulate a sandbox environment. No actual monetary transaction happens when using the Test keys. Use Live keys once you have thoroughly tested the application and are ready to go live.

Installation

This plugin is available on Pub: https://pub.dev/packages/razorpay_flutter

Add this to dependencies in your app's pubspec.yaml

razorpay_flutter: ^1.3.5

Note for Android: Make sure that the minimum API level for your app is 19 or higher.

Proguard rules

If you are using proguard for your builds, you need to add following lines to proguard files

-keepattributes *Annotation*
-dontwarn com.razorpay.**
-keep class com.razorpay.** {*;}
-optimizations !method/inlining/
-keepclasseswithmembers class * {
  public void onPayment*(...);
}

Follow this for more details.

Note for iOS: Make sure that the minimum deployment target for your app is iOS 10.0 or higher. Also, don't forget to enable bitcode for your project.

Run flutter packages get in the root directory of your app.

Usage

Sample code to integrate can be found in example/lib/main.dart.

Import package

import 'package:razorpay_flutter/razorpay_flutter.dart';

Create Razorpay instance

_razorpay = Razorpay();

Attach event listeners

The plugin uses event-based communication, and emits events when payment fails or succeeds.

The event names are exposed via the constants EVENT_PAYMENT_SUCCESS, EVENT_PAYMENT_ERROR and EVENT_EXTERNAL_WALLET from the Razorpay class.

Use the on(String event, Function handler) method on the Razorpay instance to attach event listeners.

_razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
_razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError);
_razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);

The handlers would be defined somewhere as

void _handlePaymentSuccess(PaymentSuccessResponse response) {
  // Do something when payment succeeds
}

void _handlePaymentError(PaymentFailureResponse response) {
  // Do something when payment fails
}

void _handleExternalWallet(ExternalWalletResponse response) {
  // Do something when an external wallet was selected
}

To clear event listeners, use the clear method on the Razorpay instance.

_razorpay.clear(); // Removes all listeners

Setup options

var options = {
  'key': '<YOUR_KEY_HERE>',
  'amount': 100,
  'name': 'Acme Corp.',
  'description': 'Fine T-Shirt',
  'prefill': {
    'contact': '8888888888',
    'email': '[email protected]'
  }
};

A detailed list of options can be found here.

Open Checkout

_razorpay.open(options);

Troubleshooting

Enabling Bitcode

Open ios/Podfile and find this section:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

Set config.build_settings['ENABLE_BITCODE'] = 'YES'.

Setting Swift version

Add the following line below config.build_settings['ENABLE_BITCODE'] = 'YES':

config.build_settings['SWIFT_VERSION'] = '5.0'

CocoaPods could not find compatible versions for pod "razorpay_flutter" when running pod install

Specs satisfying the `razorpay_flutter (from
    `.symlinks/plugins/razorpay_flutter/ios`)` dependency were found, but they
    required a higher minimum deployment target.

This is due to your minimum deployment target being less than iOS 10.0. To change this, open ios/Podfile in your project and add/uncomment this line at the top:

# platform :ios, '9.0'

and change it to

platform :ios, '10.0'

and run pod install again in the ios directory.

iOS build fails with 'razorpay_flutter/razorpay_flutter-Swift.h' file not found

Add use_frameworks! in ios/Podfile and run pod install again in the ios directory.

Gradle build fails with Error: uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:razorpay_flutter]

This is due to your Android minimum SDK version being less than 19. To change this, open android/app/build.gradle, find minSdkVersion in defaultConfig and set it to at least 19.

A lot of errors saying xxxx is not defined for the class 'Razorpay'

We export a class Razorpay from package:razorpay_flutter/razorpay_flutter.dart. Check if your code is redeclaring the Razorpay class.

Type 'xxxx' is not a subtype of type 'xxxx' of 'response' in Razorpay.on.<anonymous closure>

[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: type 'PaymentFailureResponse' is not a subtype of type 'PaymentSuccessResponse' of 'response'
#0      Razorpay.on.<anonymous closure> (package:razorpay_flutter/razorpay_flutter.dart:87:14)
#1      EventEmitter.emit.<anonymous closure> (package:eventify/src/event_emitter.dart:94:14)
#2      List.forEach (dart:core-patch/growable_array.dart:278:8)
#3      EventEmitter.emit (package:eventify/src/event_emitter.dart:90:15)
#4      Razorpay._handleResult (package:razorpay_flutter/razorpay_flutter.dart:81:19)
#5      Razorpay.open (package:razorpay_flutter/razorpay_flutter.dart:49:5)

Check the signatures of the callbacks for payment events. They should match the ones described here.

API

Razorpay

open(map<String, dynamic> options)

Open Razorpay Checkout.

The options map has key as a required property. All other properties are optional. For a complete list of options, please see the Checkout documentation.

on(String eventName, Function listener)

Register event listeners for payment events.

clear()

Clear all event listeners.

Error Codes

The error codes have been exposed as integers by the Razorpay class.

The error code is available as the code field of the PaymentFailureResponse instance passed to the callback.

Error Code Description
NETWORK_ERROR There was a network error, for example loss of internet connectivity
INVALID_OPTIONS An issue with options passed in Razorpay.open
PAYMENT_CANCELLED User cancelled the payment
TLS_ERROR Device does not support TLS v1.1 or TLS v1.2
UNKNOWN_ERROR An unknown error occurred.

Event names

The event names have also been exposed as Strings by the Razorpay class.

Event Name Description
EVENT_PAYMENT_SUCCESS The payment was successful.
EVENT_PAYMENT_ERROR The payment was not successful.
EVENT_EXTERNAL_WALLET An external wallet was selected.

PaymentSuccessResponse

Field Name Type Description
paymentId String The ID for the payment.
orderId String The order ID if the payment was for an order, null otherwise.
signature String The signature to be used for payment verification. (Only valid for orders, null otherwise)

PaymentFailureResponse

Field Name Type Description
code int The error code.
message String The error message.

ExternalWalletResponse

Field Name Type Description
walletName String The name of the external wallet selected.

razorpay-flutter's People

Contributors

amitbhave avatar atifqezetap avatar ayush-razorpay avatar chandansunag avatar chintanacharya avatar javeeth avatar m0nusingh avatar mayur-wadpalliwar avatar nautiyalsachin avatar pr-1 avatar prem-razorpay avatar priyaj28 avatar pronav avatar pshibu000 avatar ramprasadanand avatar shibu000 avatar sumedht avatar swati31196 avatar umanghome avatar vivekshindhe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

razorpay-flutter's Issues

iOS build fails

flutter run works fine on android build, but on iOS it gives the following error:

  'razorpay_flutter/razorpay_flutter-Swift.h' file not found

Here's my flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.3, on Mac OS X 10.14.5 18F132, locale
    en-IN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.36.1)
[✓] Connected device (1 available)

• No issues found!

Module 'Razorpay' has no member named 'initWithKey'

while running app on ios simulator or even on running on real device getting this issue
on xcode 11.0 with latest release of razorpay_flutter 1.1.2

razorpay_flutter-1.1.2/ios/Classes/RazorpayDelegate.swift:57:24: error: module 'Razorpay' has no member named
'initWithKey'
let razorpay = Razorpay.initWithKey(key ?? "", andDelegateWithData: self)

PlatformException after implementing firebase messaging in app

StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter ( 6264): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter ( 6264):
E/flutter ( 6264): #2 Razorpay.open (package:nemar_app/RazorPay.dart:48:35)
E/flutter ( 6264): #3 _CheckRazorState.payData (package:nemar_app/checkRazor.dart:17:17)
E/flutter ( 6264): #4 _CheckRazorState.build (package:nemar_app/checkRazor.dart:92:19)
E/flutter ( 6264): #5 StatefulElement.build (package:flutter/src/widgets/framework.dart:4334:27)
E/flutter ( 6264): #6 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4223:15)
E/flutter ( 6264): #7 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
E/flutter ( 6264): #8 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
E/flutter ( 6264): #9 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11)
E/flutter ( 6264): #10 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
E/flutter ( 6264): #11 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter ( 6264): #12 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter ( 6264): #13 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)
E/flutter ( 6264): #14 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter ( 6264): #15 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter ( 6264): #16 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
E/flutter ( 6264): #17 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
E/flutter ( 6264): #18 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
E/flutter ( 6264): #19 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
E/flutter ( 6264): #20 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter ( 6264): #21 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter ( 6264): #22 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)
E/flutter ( 6264): #23 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter ( 6264): #24 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter ( 6264): #25 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5445:14)
E/flutter ( 6264): #26 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter ( 6264): #27 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter ( 6264): #28 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
E/flutter ( 6264): #29 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
E/flutter ( 6264): #30 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
E/flutter ( 6264): #31 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11)
E/flutter ( 6264): #32 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
E/flutter ( 6264): #33 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter ( 6264): #34 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5551:32)
E/flutter ( 6264): #35 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter ( 6264): #36 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter ( 6264): #37 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4243:16)
E/flutter ( 6264): #38 Element.rebuild (package:flutter/src/widgets/framework.dart:3947:5)
E/flutter ( 6264): #39 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4206:5)
E/flutter ( 6264): #40 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4381:11)
E/flutter ( 6264): #41 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4201:5)
E/flutter ( 6264): #42 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3194:14)
E/flutter ( 6264): #43 Element.updateChild (package:flutter/src/widgets/framework.dart:2988:12)
E/flutter ( 6264): #44 SingleChildRenderObjectElement.mount (package:flutter/src/widgets

_razorpay.open(options); gives an error

I am getting following error @ _razorpay.open(options);

Exception has occurred.
PlatformException (PlatformException(error, Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference, null))

I tried few other tutorials of razorpay plugin and I am facing the same issue everywhere
Can someone please help?

App crashes on device only

I am trying to run release build on Android device and it is crashing as soon as I click on payment. I am unable to get any log for this as it is happening only on release.
If I connect device with system and run directly from IntelliJ it never crashes.

razorpay_flutter: ^1.1.2

Razorpay Build failed (razorpay_flutter: 1.1.4)

Description

I tried to install razorpay_flutter: ^1.1.4 and it failed with this error while running the app:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':razorpay_flutter'.
> Could not open cp_proj remapped class cache for eii7mfeilb85f6s74q7cms80e (/Users/user/.gradle/caches/5.6.4/scripts-remapped/build_4xbmhjxaqg2nekw3e91dq2fd7/eii7mfeilb85f6s74q7cms80e/cp_projb88fbed980d87867994e661e74c75e1f).
   > Could not open cp_proj generic class cache for build file '/Users/user/apps/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.1.4/android/build.gradle' (/Users/user/.gradle/caches/5.6.4/scripts/eii7mfeilb85f6s74q7cms80e/cp_proj/cp_projb88fbed980d87867994e661e74c75e1f).
      > Build file '/Users/user/apps/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.1.4/android/build.gradle' should not contain a package statement.
> Could not get unknown property 'android' for project ':razorpay_flutter' of type org.gradle.api.Project.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

Flutter Version :

1.17.0-3.4.pre

Xcode Version :

11.4

Steps To Reproduce

Install the latest version of razorpay_flutter

Expected Results

The app works just fine with the razorpay_flutter version 1.1.3, something in 1.1.4 is breaking it

Currency not supported error

When I switched the option for currency to USD
and when I proceed to pay.
payment fails and then error pops up as currency not supported

refer the image
image

I am using test version of razor pay
My options looks like shown below

options = {
      'key': ConstantValues.getGatewayTestKey(),
      'amount': 100,
      'currency': 'USD', // INR
      'name': 'XXXX',
      'description': 'XXXX',
      'prefill': {'contact': _phone, 'email': _email},
      'external': {
        'wallets': ['paytm']
      }

I have used all test cards numbers mentioned for international payments.

have no issue with Domestic payment (in testing phase)

plz have a look and help me resolve the issue.

Thank you :)

Error while running the example

I am getting a toast regarding Your onPaymentError method is throwing an error. Wrap the entire code of the method in try and catch while running this example mentioned here.

I have already set the minSdkVersion to 20.

Plugin Upgrade for breaking changes in Latest stable SDK 1.12

If I integrate this plugin with other plugins created with SDK 1.12 it gives the below error as there are breaking changes introduced in the latest Flutter SDK release.

Please find below the Flutter links specifying this.
https://flutter.dev/docs/development/packages-and-plugins/plugin-api-migration
https://flutter.dev/docs/development/packages-and-plugins/developing-packages

The error I'm getting

E/MethodChannel#razorpay_flutter(20284): Failed to handle method call
E/MethodChannel#razorpay_flutter(20284): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference
E/MethodChannel#razorpay_flutter(20284): 	at android.content.ComponentName.<init>(ComponentName.java:131)
E/MethodChannel#razorpay_flutter(20284): 	at android.content.Intent.<init>(Intent.java:6522)
E/MethodChannel#razorpay_flutter(20284): 	at com.razorpay.razorpay_flutter.RazorpayDelegate.openCheckout(RazorpayDelegate.java:51)
E/MethodChannel#razorpay_flutter(20284): 	at com.razorpay.razorpay_flutter.RazorpayFlutterPlugin.onMethodCall(RazorpayFlutterPlugin.java:42)
E/MethodChannel#razorpay_flutter(20284): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:231)
E/MethodChannel#razorpay_flutter(20284): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)
E/MethodChannel#razorpay_flutter(20284): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)
E/MethodChannel#razorpay_flutter(20284): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#razorpay_flutter(20284): 	at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#razorpay_flutter(20284): 	at android.os.Looper.loop(Looper.java:174)
E/MethodChannel#razorpay_flutter(20284): 	at android.app.ActivityThread.main(ActivityThread.java:7682)
E/MethodChannel#razorpay_flutter(20284): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#razorpay_flutter(20284): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
E/MethodChannel#razorpay_flutter(20284): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
E/flutter (20284): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'java.lang.String android.content.Context.getPackageName()' on a null object reference, null) 

ios build fail

Build failed on ios but works perfectly on android.
Please help needed to integrate in ios as soon as possible.

CocoaPods' output:


Preparing
Analyzing dependencies
Inspecting targets to integrate
Using ARCHS setting to build architectures of target Pods-Runner: (``)
Finding Podfile changes
- Flutter
- fluttertoast
- path_provider
- razorpay_flutter
- shared_preferences
Fetching external sources
-> Fetching podspec for Flutter from `.symlinks/flutter/ios`
-> Fetching podspec for `fluttertoast` from `.symlinks/plugins/fluttertoast/ios`
-> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
-> Fetching podspec for `razorpay_flutter` from `.symlinks/plugins/razorpay_flutter/ios`
-> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: all_pods_versions_f_9_d.txt exists! Returning local because checking is only perfomed in repo update
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
### Command
/usr/local/bin/pod install --verbose plugin = line.split(pattern=separator) if plugin.length == 2 podname = plugin[0].strip() path = plugin[1].strip() podpath = File.expand_path("#{path}", file_abs_path) pods_ary.push({:name => podname, :path => podpath}); else puts "Invalid plugin specification: #{line}" end } return pods_ary end target 'Runner' do use_frameworks! # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock # referring to absolute paths on developers' machines. system('rm -rf .symlinks') system('mkdir -p .symlinks/plugins') # Flutter Pods generated_xcode_build_settings = parse_KV_file('./Flutter/Generated.xcconfig') if generated_xcode_build_settings.empty? puts "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first." end generated_xcode_build_settings.map { |p| if p[:name] == 'FLUTTER_FRAMEWORK_DIR' symlink = File.join('.symlinks', 'flutter') File.symlink(File.dirname(p[:path]), symlink) pod 'Flutter', :path => File.join(symlink, File.basename(p[:path])) end } /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:746:in `require_nested_dependencies_for' /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:729:in `activate_new_spec' /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:686:in `attempt_to_activate' /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state' /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve' /Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/resolver.rb:94:in `resolve' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:986:in `block in resolve_dependencies' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:984:in `resolve_dependencies' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer/analyzer.rb:124:in `analyze' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:410:in `analyze' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:234:in `block in resolve_dependencies' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/user_interface.rb:64:in `section' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:233:in `resolve_dependencies' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/installer.rb:156:in `install!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command/install.rb:52:in `run' /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/lib/cocoapods/command.rb:52:in `run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.8.4/bin/pod:55:in `<top (required)>' /usr/local/bin/pod:23:in `load' /usr/local/bin/pod:23:in `<main>'
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=invalid+byte+sequence+in+US-ASCII&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
- Pod install fails on invalid byte sequence while having LANG=en_US.UTF-8 in profile
CocoaPods/CocoaPods#5780 [closed] [6 comments]
2 weeks ago
- Pod Install failed
CocoaPods/CocoaPods#9222 [closed] [3 comments]
7 weeks ago
- Error while setting up CocoaPods
CocoaPods/CocoaPods#5979 [closed] [23 comments]
06 Dec 2018
and 15 more at:
https://github.com/cocoapods/cocoapods/search?q=invalid%20byte%20sequence%20in%20US-ASCII&type=Issues&utf8=✓
Error output from CocoaPods:

WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8

Error running pod install

flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.15.1 19B88, locale en-IN)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.40.2)
[✓] Connected device (2 available)

! Doctor found issues in 1 category.

Support for Razorpay Subscriptions

I am not able to find any support for Razorpay subscriptions in this plugin. Is is planned for any future update or is there any workaround available for the same in the current plugin which I might have missed. Please guide. Thanks

Paytm Wallet Integration

How do i make the app open Paytm to complete the Payment and come back to RazorPay after Successful Payment. In Nutshell, how do i integrate Paytm Wallet ?
Thank You

SDK on iOS is not able to download pod files on v1.1.2

I am getting the following error on pod install

[!] CocoaPods could not find compatible versions for pod "razorpay-pod":
  In snapshot (Podfile.lock):
    razorpay-pod (= 1.1.2)

  In Podfile:
    razorpay_flutter (from `.symlinks/plugins/razorpay_flutter/ios`) was resolved to 1.1.1, which depends on
      razorpay-pod (~> 1.1.4)

Module compiled with Swift 5.0 cannot be imported by the Swift 5.1 compiler

iOS build is failing with below exception with new XCODE release Version 11.0.
Please update your iOS SDK to 5.1 in Flutter Project.
Module compiled with Swift 5.0 cannot be imported by the Swift 5.1 compiler: /ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64.swiftmodule

currency is not supported

currency is not supported

var options = { 'key': 'my_key', 'amount': 399 * 100, 'name': 'kastana', 'description': 'test payment', 'currency': 'USD', 'prefill': {'contact': '', 'email': ''}, 'external': { 'wallets': [''] } };

autocapture enabled by default ? where to add orderid ?

Web code:

var options = {
        key: "rzp_test_123455",
        amount: amount,  
       name: "example name",
        currency: "INR", 
        description: “desc”,
        image: "https://example.url", 
        handler:  (response) =>{
          this.verifySignature(response,this.ptype);
        },
        prefill: {
            name: this.cusName,
            email:   this.cusEmail,
             contact: this.cusPhone,
        },
        notes: {
            address: this.locationId
        },
        theme: {
            color: "#007bf9"
        }
      };

//smid got from orders capture api
 var rzp1 = new Razorpay({...options,order_id:smid});
        rzp1.open();

what is the similar code for flutter please update in docs or auto-capture in flutter is automated?(https://razorpay.com/docs/payment-gateway/orders/)
what is the solution for flutter ? like belove we should pass capture API order_id?

void openCheckout() async {
    var options = {
      'key': 'rzp_test_12345',
      'amount': 2000,
      **'order_id': 'order_DUK12346hdh',**
      'name': 'Acme Corp.',
      'description': 'Fine T-Shirt',
      'prefill': {'contact': 'xxxx', 'email': '[email protected]'},
      'external': {
        'wallets': ['paytm']
      }
    };

    try {
      _razorpay.open(options);
    } catch (e) {
      debugPrint(e);
    }
  }

any other solution available?

App crashes in release but works fine in debug mode

App works fine (even without proguard rules) with flutter run --release but once we build apk & run the app, it didn't work

here is build gradle

buildTypes { release { signingConfig signingConfigs.release //shrinkResources true //minifyEnabled true useProguard true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }

Here is the Proguard rules

-keepclassmembers class * { @android.webkit.JavascriptInterface ; } -keepattributes JavascriptInterface -keepattributes Annotation -dontwarn com.razorpay.** -keep class com.razorpay.** {;} -optimizations !method/inlining/ -keepclasseswithmembers class * { public void onPayment*(...); }
I even tried by removing proguard rules, read & tried all the razorpay official documents, but still the app crashes.

_handlePaymentError not called after setting timeout in options

After setting timeout in options variable

 options = {
            "key": APIEndPoint.RAZORPAY_KEY,
            "amount": createOrderModel.amount,
            "currency": "INR",
            "name": APIEndPoint.RAZORPAY_NAME,
            "order_id": createOrderModel.id,
            "timeout" : 60*5,
          };

it does not call _handlePaymentError method on timeout completion and shows plain white screen.
it does not even pops using

 Navigator.pop(context);     //not popping that white screen

Problem to get callback after successfully payment.

hi,

some time not getting callback after payment success.

_razorpay = Razorpay();
_razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
_razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError);
_razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);

void _handlePaymentSuccess(PaymentSuccessResponse response) {

Fluttertoast.showToast(
msg: "SUCCESS: " + response.paymentId, timeInSecForIos: 4);

}

flutter Doctor:-

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale en-IN)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] iOS tools - develop for iOS devices
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.35.1)
[✓] Connected device (3 available)

• No issues found!

Payment Page gets Crashed as soon as it opens!

RazorPay Payment page gets crashed without displaying anything on the screen. The Debug Console reports:

Error in Emulator:

D/skia    ( 7521): ------------------------
D/skia    ( 7521): Errors:
D/skia    ( 7521):
D/skia    ( 7521): Shader compilation error
D/skia    ( 7521): ------------------------
D/skia    ( 7521): Errors:
D/skia    ( 7521):
D/EGL_emulation( 7521): eglMakeCurrent: 0xe9385c00: ver 3 1 (tinfo 0xd2925400)
D/skia    ( 7521): Shader compilation error
D/skia    ( 7521): ------------------------
D/skia    ( 7521): Errors:
D/skia    ( 7521):
D/EGL_emulation( 7521): eglMakeCurrent: 0xe9385c00: ver 3 1 (tinfo 0xd2925400)

Error in Real Device:

W/ActivityThread(  900): handleWindowVisibility: no activity for token android.os.BinderProxy@8def69c
I/Choreographer(  900): Skipped 2 frames!  The application may be doing too much work on its main thread.
E/Parcel  (  900): Reading a NULL string not supported here.
I/Choreographer(  900): Skipped 2 frames!  The application may be doing too much work on its main thread.
I/ved.pubg_avata(  900): Background concurrent copying GC freed 162551(7MB) AllocSpace objects, 63(2MB) LOS objects, 73% free, 4MB/16MB, paused 342us total 102.263ms
W/ved.pubg_avata(  900): constructJavaHashMap: start
W/ved.pubg_avata(  900): constructJavaHashMap: end
W/ved.pubg_avata(  900): sendCommonDcs: start
W/ved.pubg_avata(  900): sendCommonDcs: end
W/ved.pubg_avata(  900): Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (light greylist, linking)
D/skia    (  900): --- Failed to create image decoder with message 'unimplemented'
D/skia    (  900): --- Failed to create image decoder with message 'unimplemented'

My Code:

import 'package:flutter/material.dart';
import 'package:razorpay_flutter/razorpay_flutter.dart';
import 'package:flutter/services.dart';

class Payment extends StatefulWidget {
  @override
  _PaymentState createState() => _PaymentState();
}

class _PaymentState extends State<Payment> {
  Razorpay _razorpay;

  @override
  void initState() {
    super.initState();
    _razorpay = Razorpay();
    _razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
    _razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError);
    _razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);
  }

  @override
  void dispose() {
    super.dispose();
    _razorpay.clear();
  }

  void _handlePaymentSuccess(PaymentSuccessResponse response) {
    // Do something when payment succeeds
    print('Payment Sucessful');
  }

  void _handlePaymentError(PaymentFailureResponse response) {
    // Do something when payment fails
    print('Payment Failed');
  }

  void _handleExternalWallet(ExternalWalletResponse response) {
    // Do something when an external wallet was selected
    print('Payment Wallet');
  }

  void openCheckOut() async {
    var options = {
      'key': '**Hiden for security reasons**', // Added a Generated test key here
      'amount': 50,
      'name': 'Pubg Avatar',
      'description': 'Buy a Pubg Avatar!',
      'prefill': {'contact': '', 'email': ''},
      'external': {
        'wallets': ['paytm']
      }
    };
    try {
      print('opened');
      _razorpay.open(options);
    } catch (e) {
      debugPrint(e.toString());
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        child: Center(
          child: RaisedButton(
            child: Text('Pay'),
            onPressed: () => openCheckOut(),
          ),
        ),
      ),
    );
  }
}

Also, In debug Console it Prints: "Payment Failed". Meaning _handlePaymentError() gets called tho nothing no payment option or error is displayed on the screen. Just a RazorPay Loading logo and page gets crashed.

IOS Flutter, build failing

** BUILD FAILED **
Xcode's output:

~/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.1.2/ios/Classes/RazorpayDelegate.swift:4:42: error: use of undeclared type 'RazorpayPaymentCompletionProtocolwithData'
public class RazorpayDelegate: NSObject, RazorpayPaymentCompletionProtocolwithData, ExternalWalletSelectionProtocol {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.1.2/ios/Classes/RazorpayDelegate.swift:4:85: error: 'ExternalWalletSelectionProtocol' is unavailable: cannot find Swift declaration for this protocol
public class RazorpayDelegate: NSObject, RazorpayPaymentCompletionProtocolwithData, ExternalWalletSelectionProtocol {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Razorpay.ExternalWalletSelectionProtocol:2:17: note: 'ExternalWalletSelectionProtocol' has been explicitly marked unavailable here
public protocol ExternalWalletSelectionProtocol {
^
~/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.1.2/ios/Classes/RazorpayDelegate.swift:57:24: error: 'Razorpay' is unavailable: cannot find Swift declaration for this class
let razorpay = Razorpay.initWithKey(key ?? "", andDelegateWithData: self)
^~~~~~~~
Razorpay.Razorpay:2:14: note: 'Razorpay' has been explicitly marked unavailable here
public class Razorpay : NSObject {
^

RazorPay Screen hangs

Dear Team,

Congratulations and thank you very much for the much needed library for flutter. We are currently integrating this library with our application, which we are soon planning to take it to production.

However we are facing an issue where the RazorPay activity hangs (screenshot attached) with below workflow.

Tested on Emulator (Google Pixel 3, API 28)

  1. Open RazoryPay payment screen
  2. Select Netbanking -> HDFC bank -> Pay
  3. In the success/failure screen, press back button
  4. Close the RazorPay payment screen.
  5. Reopen the RazorPay payment screen.
  6. Payment screen hangs and do not even close with back button.

Log:

I/chromium(  777): [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'track' of undefined", source: https://checkout.razorpay.com/v1/checkout-frame.js (1)
I/chromium(  777): [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'r' of undefined", source: https://checkout.razorpay.com/v1/checkout-frame.js (1)

Please note I tested the same on a real device, it works neatly. However I still wanted to bring this to your attention, so that if anything wrong, it could be fixed.

Please let me know if you need any more details.

Regards,
Adarsha HD

Module compiled with Swift 5.0 cannot be imported by the Swift 5.1 compiler. SDK v1.1.2

Getting the following error In RazorpayDeligate.swift on the line:2
Module compiled with Swift 5.0 cannot be imported by the Swift 5.1 compiler

Already changed the podfile to include:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'YES'
      config.build_settings['SWIFT_VERSION'] = '5.1'
    end
  end
end

Payment Gateway response successfull even when i cancelled the payment ?

Hello,

#Issue - 1

I have implemented the code described on official plugin package. but, when i test with my testkey and when i click on pay button and try to pay with googlepay. after then click on pay button.

Then if i do not complete the payment and click on back button it says payment successful. 
Even it is showing on the razorpay dashboard.

Can you please help me to resolve the issue?

#Issue - 2

Also, Another issue is if i go to card payment and if i add some payment details and continue and then if i press back without completing payment process. I come back to main screen and if i now again make payment using card successfully it doesn't give me any kind of callback(success, failure or external wallet).

@ChintanAcharya I think these are very heavy and serious issues which must be resolved very soon.

Thanks.

[Docs] Use pubspec's ref attribute maybe?

Hi!
In the user's guide,

razorpay_flutter:
  git:
    url: git://github.com/razorpay/razorpay-flutter.git#f7ea14a

This is the format given to import the package to the flutter project. However, this ends up in error message:

Running "flutter packages get" in dole-flutter-app...           
Git error. Command: git fetch
fatal: not a git repository (or any of the parent directories): .git

On MacOS, with everything else to latest.

Please consider using ref: attribute as mentioned in the official pub docs.
https://dart.dev/tools/pub/dependencies#git-packages

Also, this works fine:

  razorpay_flutter:
    git:
      url: git://github.com/razorpay/razorpay-flutter.git
      ref: "f7ea14a"

App crashes in release but works fine in debug mode.

This problem with solution is mentioned already in issue #42

However the solution didn't work for me.

App works fine (even without proguard rules) with flutter run --release but once we build apk & run the app, it didn't work

here is build gradle

buildTypes {
        release {            
            signingConfig signingConfigs.release
            //shrinkResources true
            //minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),  'proguard-rules.pro' 
        }
    }

Here is the Proguard rules

-keepclassmembers class * {
@android.webkit.JavascriptInterface ;
}
-keepattributes JavascriptInterface
-keepattributes Annotation
-dontwarn com.razorpay.**
-keep class com.razorpay.** {;}
-optimizations !method/inlining/
-keepclasseswithmembers class * {
public void onPayment*(...);
}

I even tried by removing proguard rules, read & tried all the razorpay official documents, but still the app crashes.

Any workaround is highly appreciated.

Module 'razorpay_flutter' not found

I've just added RazorPay to my flutter module (add-to-app) in pubspec.yaml file:

razorpay_flutter: ^1.1.3

When I run the iOS app from Xcode, I'm getting Module 'razorpay_flutter' not found in GeneratedPluginRegistrant.h file. I'm not sure whats going wrong, guess there is an issue when we add flutter as module to the existing native app.

Screenshot 2020-04-25 at 9 04 14 PM

App crashes instead of open razorpay payment page in flutter

flutter run is working fine in the emulator and real device.
but after flutter build apk, the app Crashed on _razorpay.open(options);
and the plugin is not showing a crash report or any error in the visual studio code terminal.

  final _razorpay = Razorpay();
 _razorpay.on(Razorpay.EVENT_PAYMENT_SUCCESS, _handlePaymentSuccess);
  _razorpay.on(Razorpay.EVENT_PAYMENT_ERROR, _handlePaymentError);
 _razorpay.on(Razorpay.EVENT_EXTERNAL_WALLET, _handleExternalWallet);

  var options = {
      'key': 'rzp_test_xxxxxxx',
      'amount': 100, //in the smallest currency sub-unit.
      'name': 'Acme Corp.',
      'description': 'Fine T-Shirt',
      'prefill': {'contact': '9123456789', 'email': '[email protected]'}
    };

    print('0');
 try {
      print('1');
      _razorpay.open(options);
      print('2');
    } catch (e) {
      print('error');
      debugPrint(e);
    }

in the visual studio code terminal

11-05 00:22:29.197 21170 21209 I flutter : 0
11-05 00:22:29.197 21170 21209 I flutter : 1
11-05 00:22:29.197 21170 21209 I flutter : 2

In the Andoid studio logcat
java.lang.ClassNotFoundException: Didn't find class "com.razorpay.d__1_"

2019-11-05 11:59:49.168 30159-30159/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.my_task, PID: 30159
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.my_task/com.razorpay.CheckoutActivity}: 
java.lang.ClassNotFoundException: Didn't find class "com.razorpay.d__1_" on path: DexPathList[[zip file "/data/app/com.example.my_task-OX9pWhAo1dl4QP0DQBF58w==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.my_task-OX9pWhAo1dl4QP0DQBF58w==/lib/arm64, /data/app/com.example.my_task-OX9pWhAo1dl4QP0DQBF58w==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6944)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.razorpay.d__1_" on path: DexPathList[[zip file "/data/app/com.example.my_task-OX9pWhAo1dl4QP0DQBF58w==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.my_task-OX9pWhAo1dl4QP0DQBF58w==/lib/arm64, /data/app/com.example.my_task-OX9pWhAo1dl4QP0DQBF58w==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at com.razorpay.Y_$B$.Q_$2$(:1112)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.razorpay.A.<clinit>(:204)
        at com.razorpay.A.a(Unknown Source:0)
        at com.razorpay.c.b(:189)
        at com.razorpay.h.b(:412)
        at com.razorpay.ja.onCreate(:82)
        at com.razorpay.u.onCreate(:23)
        at com.razorpay.CheckoutActivity.onCreate(:8)
        at android.app.Activity.performCreate(Activity.java:7183)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)

Add Kotlin support

With Flutter 1.9 released, flutter has kotlin support instead of java by default. I just noticed that razorpay_flutter package doesn't work with kotlin.

It's necessary to add support for it asap, since everyone will use kotlin instead of java in flutter now.

iOS App not building - module 'Razorpay' has no member named 'initWithKey'

Hello All,

Yesterday i run pod update in my flutter project , after which it has started giving me this below error, if i remove razor-pay plugin then App is building properly for iOS.
I am using razorpay_flutter: 1.1.2
Thankfully my app was submitted to App Store before updating. App was building successfully till i run pod update.

Please help.

Developer/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.1.2/ios/Classes/RazorpayDelegate.swift:57:24: error: module 'Razorpay' has no member named 'initWithKey'
let razorpay = Razorpay.initWithKey(key ?? "", andDelegateWithData: self)
^~~~~~~~ ~~~~~~~~~~~
Command CompileSwift failed with a nonzero exit code
note: Using new build system
note: Planning build
note: Constructing build description

Thanks in advance.

razorpay_flutter issue

I have implemented razorpay_flutter.It is working fine in android .But in ios ,when i making bitcode enable then other libraries are effecting.How to fix these one?

error

企业微信20190710055141

I had these problems

Unable to find explicit activity class com.razorpay.CheckoutActivity}; have you declared this activity in your AndroidManifest.xml?

hi ,
iam using flutter
getting error when _razorpay.open(options);

void openCheckout() async {

var options = {
  'key': 'rzp_test_1DP5mmOlF5G5ag',
  'amount': 2000,
  'name': 'Acme Corp.',
  'description': 'Fine T-Shirt',
  'prefill': {
    'contact': '8888888888',
    'email': '[email protected]'
  },
  'external': {
    'wallets': ['paytm']
  }
};

try {
  _razorpay.open(options);
} catch (e) {
  debugPrint(e);
}

}

error stack: -
E/MethodChannel#razorpay_flutter( 1109): Failed to handle method call
E/MethodChannel#razorpay_flutter( 1109): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.foodmonk.androidapp/com.razorpay.CheckoutActivity}; have you declared this activity in your AndroidManifest.xml?
E/MethodChannel#razorpay_flutter( 1109): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2012)
E/MethodChannel#razorpay_flutter( 1109): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1675)
E/MethodChannel#razorpay_flutter( 1109): at android.app.Activity.startActivityForResult(Activity.java:4586)
E/MethodChannel#razorpay_flutter( 1109): at android.app.Activity.startActivityForResult(Activity.java:4544)
E/MethodChannel#razorpay_flutter( 1109): at com.razorpay.razorpay_flutter.RazorpayDelegate.openCheckout(RazorpayDelegate.java:55)
E/MethodChannel#razorpay_flutter( 1109): at com.razorpay.razorpay_flutter.RazorpayFlutterPlugin.onMethodCall(RazorpayFlutterPlugin.java:43)
E/MethodChannel#razorpay_flutter( 1109): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201)
E/MethodChannel#razorpay_flutter( 1109): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:88)
E/MethodChannel#razorpay_flutter( 1109): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:219)
E/MethodChannel#razorpay_flutter( 1109): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#razorpay_flutter( 1109): at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#razorpay_flutter( 1109): at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#razorpay_flutter( 1109): at android.app.ActivityThread.main(ActivityThread.java:6762)
E/MethodChannel#razorpay_flutter( 1109): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#razorpay_flutter( 1109): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#razorpay_flutter( 1109): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

RazorPay 1.1.3 - Build Failing Yet Again on Xcode 11.4

** BUILD FAILED **
Xcode's output:

Command CompileSwift failed with a nonzero exit code
/Users/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.1.3/ios/Classes/RazorpayDelegate.swift:4:42: error:
'RazorpayPaymentCompletionProtocolWithData' is unavailable: cannot find Swift declaration for this protocol
public class RazorpayDelegate: NSObject, RazorpayPaymentCompletionProtocolWithData, ExternalWalletSelectionProtocol {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Razorpay.RazorpayPaymentCompletionProtocolWithData:2:17: note: 'RazorpayPaymentCompletionProtocolWithData' has been explicitly marked unavailable here
public protocol RazorpayPaymentCompletionProtocolWithData {
^
/Users/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.1.3/ios/Classes/RazorpayDelegate.swift:4:85: error:
'ExternalWalletSelectionProtocol' is unavailable: cannot find Swift declaration for this protocol
public class RazorpayDelegate: NSObject, RazorpayPaymentCompletionProtocolWithData, ExternalWalletSelectionProtocol {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Razorpay.ExternalWalletSelectionProtocol:2:17: note: 'ExternalWalletSelectionProtocol' has been explicitly marked unavailable here
public protocol ExternalWalletSelectionProtocol {
^
/Users/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.1.3/ios/Classes/RazorpayDelegate.swift:57:24: error: use of
unresolved identifier 'RazorpayCheckout'
let razorpay = RazorpayCheckout.initWithKey(key ?? "", andDelegateWithData: self)
^~~~~~~~~~~~~~~~
note: Using new build system
note: Building targets in parallel
note: Planning build

Undefined symbols for architecture armv7: / arm64 : In IOS

hi,
I am using flutter v1.5.4-hotfix.2, and razorpay_flutter: ^1.1.1
getting error when create ios release build. its working fine on ios simulator on debug mode. In Android its working fine .

Error is produce after add razorpay_flutter: ^1.1.1 plugin .

Error:-

ld: warning: Could not find auto-linked framework 'Flutter'
Undefined symbols for architecture armv7:
"_FlutterMethodNotImplemented", referenced from:
-[FLTAndroidIntentPlugin handleMethodCall:result:] in AndroidIntentPlugin.o
"OBJC_CLASS$_FlutterMethodChannel", referenced from:
objc-class-ref in AndroidIntentPlugin.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Podfile:-

target 'Runner' do
use_frameworks!

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'YES'
config.build_settings['SWIFT_VERSION'] = '5.0'
end
end
end

flutter doctor summary:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale en-IN)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.35.1)
[✓] Connected device (2 available)

• No issues found!

[BUG] contact and email fields are cached

Razorpay caches contact and email fields, calling Razorpay.open with different contact or email in options does not reflect in the checkout screen. It shows the one called in previous request.

I've been passing like below:

      'prefill': {
        'name': user.name,
        'email': user.email,
        'contact': user.phone
      },
      'readonly': {'email': true, 'contact': true},

[API Design][No Orders API] Review from a first test

Hi! I reviewed the plugin live, as I was trying to implement a client project,
Here are my key findings:

  1. Current API surface does not have any way to deal with the orders API
    -> PaymentSuccessResponse has only payment_id, not the best way to deal with this
  2. Callbacks are good, but we could have designed the API in a little better way(promises / async / await)

I have archived the video, but if interested can make it available.
At the same time, am open to discuss a better API surface.

Bests,
Raveesh.

App crashes with Segmentation fault on iOS devices. Works fine on Android.

App crashes on launch with the following error.
com.apple.CoreSimulator.SimDevice.00824A43-86CE-47F2-BE72-E409EF4D1018[46735] (UIKitApplication:in.wup.ios[0xde7b][46756][80689]): Service exited due to Segmentation fault: 11

If I remove user_frameworks! I get the following error.

error: module map file '/Users/akasantony/Library/Developer/Xcode/DerivedData/Runner-fkvindakxlzttigznzvgapmpievl/Build/Products/Debug-iphonesimulator/razorpay_flutter/razorpay_flutter.modulemap' not found

Error while adding in ios

HI,
I am getting the below error while compiling the code for ios. Please, anyone, guide me on how to fix this.
Screenshot 2020-04-27 at 12 49 00 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.