Flutter Fawry Pay는 FawryPay의 네이티브 결제 SDK를 Flutter 애플리케이션에 통합하는 플러터 플러그인으로, 안드로이드, iOS 및 웹에서 원활한 앱 내 결제를 가능하게 합니다. 이 플러그인은 이집트 및 기타 지원 지역에서 거래를 위해 FawryPay의 안전한 결제 게이트웨이를 활용할 수 있도록 해줍니다. 개발자는 결제 시작, 콜백 처리, 거래 상태 관리를 Flutter 앱 내에서 간편하게 수행할 수 있습니다. 기존 FawryPay 인프라와 호환되도록 설계되어 최신 보안 및 결제 기준을 충족합니다.
사용 사례
이집트 시장의 앱 내 구매
FawryPay를 수락하는 전자상거래 플랫폼
로컬 결제 통합이 필요한 모바일 앱
디지털 서비스 구독
온라인 청구서 결제
주요 기능
Android, iOS 및 웹 플랫폼을 지원합니다
FawryPay SDK와의 안전한 통합
결제 콜백 및 상태 업데이트를 처리합니다
거래를 시작하기 위한 간단한 API
내장된 오류 처리 및 로깅
적합한 대상
이집트 사용자를 대상으로 하는 개발자
결제 수단으로 FawryPay가 필요한 앱
Flutter를 사용한 크로스 플랫폼 앱
전자상거래 및 구독 서비스
로컬 결제 게이트웨이가 필요한 프로젝트
고려 사항
FawryPay 계정 및 자격 증명이 필요합니다
FawryPay가 운영되는 지역에 한정
각 플랫폼에 대해 적절한 구성이 필요합니다
추가적인 백엔드 검증이 필요할 수 있습니다
새로운 기능을 위해 FawryPay SDK 업데이트에 의존합니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
Flutter FawryPay
Explain
This plugin is for FawryPay. It's implemented the native SDKs of Mobile, and Web to work on Flutter environment.
It works for Android fine. iOS works fine on Real Device only (FawryPay Requirements).
FlutterFawryPay.instance.init(
// Set the merchant ID here for one time only.
merchantID: Keys.merchantID,
style: Style.STYLE1,
// If set to true, you must set username and email.
skipCustomerInput: true,
// Must be a phone number.
username: "01234567890",
email: "abc@test.com",
// For web how you show the Fawry screen.
webDisplayMode: DisplayMode.SIDE_PAGE,
// You should set environment here.
environment: Environment.TEST,
);
And when you are ready for production you have to set the environment to LIVE.
Now, you can stream the result data that from SDK.
Let's now make our first payment initialize, you must set your merchantID that token from FawryPay system, and set your FawryItems that the user will pay for.
Note that: there's error in native FawryPay SDK for Android and iOS to retrieve again customParam.
FlutterFawryPay.instance.initialize(
returnUrl: "test.com", // For Web use only.
items: [
FawryItem(sku: "1", description: "Item 1", qty: 1, price: 20.0),
],
customParam: {
"order_id": "123213",
"price": 231.0,
},
);
You can set some parameters like: merchantRefNumber, customParam.
So now, it was initialized well, how to start payment? You have TWO ways.
First way: Native Fawry Button
You can use the native button for FawryPay SDK. through this only widget.
FawryButton()
Second way: Your custom widget
You can use your own widget with a function to call with FlutterFawryPay.instance.startProcess().
Last function you can use is reset the initialization (Android & Web only), doing that:
FlutterFawryPay.instance.reset();
Objects
classFawryItem{
String sku;
String description;
int qty;
double price;
double? originalPrice;
int? height;
int? length;
double? weight;
int? width;
String? variantCode;
List<String>? reservationCodes;
String? earningRuleID;
String? imageUrl; // For Web only.
}
classFawryResponse{
/// Parameters for payment process.String transactionID;
DateTime expiryDate;
/// Parameters for card tokenizer process.String cardToken;
DateTime creationDate;
String lastFourDigits;
/// Common parameters for all process.Map<String, dynamic> customParam;
String errorMessage;
}
Enums
/// Enums for DisplayMode configuration.////// [POPUP] show a popup dialog./// [SIDE_PAGE] show side screen dialog.enumDisplayMode { POPUP, SIDE_PAGE }
/// Enums for Environment configuration.////// [TEST] for test stage atfawry.fawrystaging endpoint./// [LIVE] for production stage atfawry endpoint.enumEnvironment { TEST, LIVE }
/// Enums for Environment configuration.////// [EN] for English language./// [AR] for Arabic language.enumLanguage { EN, AR }
/// Enums for Environment configuration.////// [STYLE1] for first styling./// [STYLE2] for second styling.enumStyle { STYLE1, STYLE2 }
Copyright (c) 2021 Shady Boshra. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.