COWPAY FLUTTER PACKAGE
This document is a guide to the example project included in the plugin files. In addition, following the below steps will help you learn how to add and use (Cowpay plugin) in your flutter application.
REQUIREMENTS
Minimum Flutter version 2.5.0
INSTALLATION
Add the following line to pubspec.yaml file.
dependencies:
cowpay:
git:
url: https://github.com/LuminSoft/cowpay-flutter-plugin.git
ref: latest release version
IMPORT
import 'package:cowpay/cowpay.dart';
USAGE
Create a widget and just return Cowpay-plugin widget in the build function as:
return Cowpay(
localizationCode: LocalizationCode.en,
amount: amount,
customerEmail: 'customerEmail',
customerMobile: 'customerMobile',
customerLastName: 'customerName',
customerFirstName: 'customerName',
isfeesOnCustomer: true,
logoStringUrl:'logoStringUrl',
merchantMobile: 'merchantMobile',
description: 'description',
customerMerchantProfileId: 'customerMerchantProfileId',
merchantReferenceId: 'merchantReferenceId',
activeEnvironment: CowpayEnvironment.staging,
merchantHashCode: 'merchantHashCode',
merchantCode: 'merchantCode',
onSuccess: (val) {
debugPrint(val.paymentMethodName);
},
onError: (val) {
debugPrint(val.toString());
},
onClosedByUser: () {
debugPrint("closedByUser");
},
)
VALUES DESCRIPTION
Key | values |
---|---|
localizationCode | Select your language code enum value LocalizationCode.en for English, and LocalizationCode.ar if Arabic. |
amount | two decimal value like "15.60", sent in case of partial capture |
customerEmail | customer valid email |
customerMobile | internationally formatted customer mobile |
customerLastName | customer last name being charged |
customerFirstName | customer first name being charged |
isfeesOnCustomer | is fees on customer or merchant |
logoStringUrl | merchant logo url |
merchantMobile | merchant mobile |
description | charge request description that reserve the payment name |
customerMerchantProfileId | ID of the customer being charged on your system |
merchantReferenceId | Unique alphanumeric value required as identifier for the charge request |
activeEnvironment | CowpayEnvironment.staging |
merchantHashCode | Hash code that is presented in your panel. |
merchantCode | Your code that is presented in your panel. |
onSuccess | Call back function if transaction succeeds. |
onError | Call back function when an error occurres. |
onClosedByUser | Call back function if customer goes back before making a transaction. |
DOCUMENTATION
You can check the documentation.
Libraries
- core/core
- core/environment
- core/global_vars
- core/nullable
- core/packages/dartz/dartz
- core/packages/equatable/equatable
- core/packages/flutter_bloc/flutter_bloc
- core/packages/get_it/get_it
- core/packages/screen_util/screen_util
- core/usecase/usecase
- cowpay
- domain_models/domain_models
- domain_models/src/card_models/card_success_model
- domain_models/src/card_models/tokenized_card_details
- domain_models/src/cowpay_response_model
- domain_models/src/enums/environment_enum
- domain_models/src/enums/payment_methods_enum
- domain_models/src/error_model
- domain_models/src/fawry_models/fawry_success_model
- domain_models/src/success_model
- failures/failures
- failures/src/error/exceptions
- failures/src/error/failure
- failures/src/failure/enum
- failures/src/failure/failure_handler
- failures/src/failure/status_checker
- failures/src/models/error_message_response
- features/card_payment/card_payment
- features/card_payment/src/card_payment_data/car_payment_models/cowpay_js_channel_message
- features/card_payment/src/card_payment_data/car_payment_models/get_payment_methods_request_call/get_payment_methods_request
- features/card_payment/src/card_payment_data/car_payment_models/get_payment_methods_request_call/get_payment_methods_request_model
- features/card_payment/src/card_payment_data/car_payment_models/get_user_cards_request_call/get_user_cards_request
- features/card_payment/src/card_payment_data/car_payment_models/get_user_cards_request_call/get_user_cards_request_model
- features/card_payment/src/card_payment_data/card_payment_datasources/card_payment_remote_datasource
- features/card_payment/src/card_payment_data/card_payment_repository/card_payment_repository_impl
- features/card_payment/src/card_payment_di/card_payment_di
- features/card_payment/src/card_payment_domain/card_payment_repositories/card_payment_repository
- features/card_payment/src/card_payment_domain/card_payment_usecases/get_user_cards_usecase
- features/card_payment/src/card_payment_domain/card_payment_usecases/login_usecase
- features/card_payment/src/card_payment_presentation/card_payment_blocs/add_card_bloc/add_card_bloc
- features/card_payment/src/card_payment_presentation/card_payment_blocs/saved_cards_bloc/saved_cards_bloc
- features/card_payment/src/card_payment_presentation/card_payment_blocs/webview_bloc/payment_webview_bloc
- features/card_payment/src/card_payment_presentation/card_payment_ui/screens/add_card_screen
- features/card_payment/src/card_payment_presentation/card_payment_ui/screens/saved_cards_screen
- features/card_payment/src/card_payment_presentation/card_payment_ui/screens/webview_screen
- features/fawry_payment/fawry_payment
- features/fawry_payment/src/fawry_payment_data/fawry_payment_datasources/fawry_payment_remote_datasource
- features/fawry_payment/src/fawry_payment_data/fawry_payment_repository/fawry_payment_repository_impl
- features/fawry_payment/src/fawry_payment_di/fawry_payment_di
- features/fawry_payment/src/fawry_payment_domain/fawry_payment_repositories/fawry_payment_repository
- features/fawry_payment/src/fawry_payment_domain/fawry_payment_usecases/login_usecase
- features/fawry_payment/src/fawry_payment_presentation/fawry_payment_blocs/fawry_bloc/fawry_bloc
- features/fawry_payment/src/fawry_payment_presentation/fawry_payment_ui/screens/fawry_screen
- features/fawry_payment/src/fawry_payment_presentation/fawry_payment_ui/widgets/fawry_widget
- features/payment_methods/payment_methods
- features/payment_methods/src/payment_methods_data/payment_methods_datasources/payment_methods_datasource
- features/payment_methods/src/payment_methods_data/payment_methods_models/get_payment_methods_request_call/get_payment_methods_request
- features/payment_methods/src/payment_methods_data/payment_methods_models/get_payment_methods_request_call/get_payment_methods_request_model
- features/payment_methods/src/payment_methods_data/payment_methods_models/get_token_request_call/get_token_request
- features/payment_methods/src/payment_methods_data/payment_methods_models/get_token_request_call/get_token_request_model
- features/payment_methods/src/payment_methods_data/payment_methods_repository/payment_methods_repository_impl
- features/payment_methods/src/payment_methods_di/payment_methods_di
- features/payment_methods/src/payment_methods_domain/payment_methods_repositories/payment_methods_repository
- features/payment_methods/src/payment_methods_domain/payment_methods_usecases/get_payment_methods_usecase
- features/payment_methods/src/payment_methods_domain/payment_methods_usecases/get_token_usecase
- features/payment_methods/src/payment_methods_presentation/payment_methods_bloc/payment_methods_bloc
- features/payment_methods/src/payment_methods_presentation/payment_methods_ui/payment_options_extension
- features/payment_methods/src/payment_methods_presentation/payment_methods_ui/screens/payment_methods_screen
- form_fields/form_fields
- form_fields/src/card_cvv
- form_fields/src/card_expiry
- form_fields/src/card_holder_name
- form_fields/src/card_number
- form_fields/src/mobile_number
- localization/localization
- localization/src/ar
- localization/src/en
- localization/src/enum
- localization/src/localization
- network/network
- network/src/di/network_di
- network/src/network
- network/src/request/base_request
- network/src/request/request_model
- network/src/response/response_model
- payment_domain/payment_domain
- payment_domain/src/payment_data/payment_datasources/payment_remote_datasource
- payment_domain/src/payment_data/payment_models/card_data
- payment_domain/src/payment_data/payment_models/fees_model
- payment_domain/src/payment_data/payment_models/get_payment_fees_call/get_payment_fees_call_request
- payment_domain/src/payment_data/payment_models/get_payment_fees_call/get_payment_fees_call_request_model
- payment_domain/src/payment_data/payment_models/pay_call/pay_call_request
- payment_domain/src/payment_data/payment_models/pay_call/pay_call_request_model
- payment_domain/src/payment_data/payment_models/pay_call/pay_call_response_model
- payment_domain/src/payment_data/payment_models/tokenzied_card
- payment_domain/src/payment_data/payment_repository/payment_repository_impl
- payment_domain/src/payment_di/payment_di
- payment_domain/src/payment_domain/payment_repositories/payment_repository
- payment_domain/src/payment_domain/payment_usecases/generate_signature_usecase
- payment_domain/src/payment_domain/payment_usecases/get_payment_fees_usecase
- payment_domain/src/payment_domain/payment_usecases/pay_usecase
- payment_domain/src/payment_presentation/payment_ui/widgets/payment_details_widget
- routers/routers
- routers/src/app_router
- routers/src/card_payment_router
- routers/src/fawry_router
- routers/src/payment_methods_router
- scr/cowpay
- scr/di/injection_container
- ui_components/src/app_assets
- ui_components/src/app_colors
- ui_components/src/app_decorations
- ui_components/src/enums
- ui_components/src/font_family
- ui_components/src/text_styles
- ui_components/src/ui_components/app_bar_view
- ui_components/src/ui_components/background_view
- ui_components/src/ui_components/blur_widget
- ui_components/src/ui_components/dialog_view
- ui_components/src/ui_components/loader
- ui_components/src/ui_components/loading_view
- ui_components/src/ui_components/text_input_view
- ui_components/ui_components