Orientação gerada a partir de informações públicas. Apenas para referência.
O Razorpay Flutter é um plugin que integra a gateway de pagamento Razorpay em aplicativos Flutter, permitindo pagamentos internos sem problemas para Android e iOS. Ele oferece uma experiência de checkout semelhante à nativa, com suporte a cartões, UPI, bancos online, carteiras e muito mais. O plugin simplifica o processamento de pagamentos ao lidar com transações seguras e fornecer componentes de interface personalizáveis. Os desenvolvedores podem implementar fluxos de pagamento facilmente com configuração mínima usando APIs simples.
Casos de uso
Compras no aplicativo
Plataformas de comércio eletrônico
Faturamento de assinatura
Ticketing de evento
Pagamentos de serviços digitais
Principais recursos
Processamento de pagamento seguro
Interface de checkout personalizável
Suporte para múltiplos métodos de pagamento
Atualizações em tempo real do status da transação
Integração fácil com aplicativos Flutter
Indicado para
Aplicativos móveis de comércio eletrônico
Plataformas SaaS
aplicativos de gerenciamento de eventos
monetização de aplicativo freemium
Plataformas de cursos online
Considerações
Requer chaves de API válidas do Razorpay
Necessita de tratamento adequado de erros para transações falhas
Deve cumprir as regulamentações locais de pagamento
Testes no modo sandbox antes da produção
Atualizações regulares do SDK para correções de segurança
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
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: