Razorpay Flutter는 Flutter 애플리케이션에 Razorpay 결제 게이트웨이를 통합하는 플러그인으로, 안드로이드 및 iOS용 원활한 앱 내 결제를 가능하게 합니다. 카드, UPI, 인터넷 뱅킹, 월렛 등 다양한 결제 수단을 지원하며, 네이티브와 유사한 체크아웃 경험을 제공합니다. 이 플러그인은 안전한 거래 처리와 사용자 정의 가능한 UI 컴포넌트를 통해 결제 프로세스를 간소화합니다. 개발자는 간단한 API를 사용해 최소한의 설정으로 결제 흐름을 쉽게 구현할 수 있습니다.
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:
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.
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.
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)] UnhandledException: type 'PaymentFailureResponse'is not a subtype of type 'PaymentSuccessResponse' of 'response'
#0Razorpay.on.<anonymous closure> (package:razorpay_flutter/razorpay_flutter.dart:87:14)
#1EventEmitter.emit.<anonymous closure> (package:eventify/src/event_emitter.dart:94:14)
#2List.forEach (dart:core-patch/growable_array.dart:278:8)
#3EventEmitter.emit (package:eventify/src/event_emitter.dart:90:15)
#4Razorpay._handleResult (package:razorpay_flutter/razorpay_flutter.dart:81:19)
#5Razorpay.open (package:razorpay_flutter/razorpay_flutter.dart:49:5)
Class Registrar not found
Please update to version 1.4.0 to fix this issue.
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.
eventName: The name of the event.
listener: The function to be called. The listener should accept a single argument of the following type: