Flutter library for Moyasar. Supports Apple Pay, STC Pay and Credit Card.

Overview

πŸš€ Installation

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

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

moyasar_payment : latest_version

πŸ”– Usage

Import moyasar_payment.dart

import 'package:moyasar_payment/moyasar_payment.dart';

Import paymodel.dart

import 'package:moyasar_payment/model/paymodel.dart';

Integrate Apple Pay

Import applepaymodel.dart

import 'package:moyasar_payment/model/source/applepaymodel.dart';
var items = <String,double>{
              'Item 1': 20.0,
              'Item 2' : 80.0
            };
                          
PayModel res = await MoyasarPayment().applePay(
    amount: 100.0, 
    publishableKey: 'publishable_key', 
    applepayMerchantId: 'applepay_merchant_id', 
    paymentItems: items, 
    currencyCode: 'SAR', 
    countryCode: 'SA',
    description: 'description');

if (res.type != null) { // User Cancelled The Payment
        print(res.message);
    } else {
        ApplePayModel applePayModel = ApplePayModel.fromJson(res.source);
    
    }

Integrate Credit Card

Import creditcardmodel.dart

import 'package:moyasar_payment/model/source/creditcardmodel.dart';
PayModel res = await MoyasarPayment().creditCard(
    description :'description', 
    amount: 100.0, 
    publishableKey: 'publishable_key', 
    cardHolderName: 'cardHolderName', 
    cardNumber: 'cardNumber', 
    cvv: 'cvv', 
    expiryManth: 'expiryDate_manth', 
    expiryYear: 'expiryDate_yar', 
    callbackUrl: 'https://example.com/orders');

CreditcardModel creditcardModel = CreditcardModel.fromJson(res.source);
    print(creditcardModel.toJson());

Integrate STC Pay

Import creditcardmodel.dart

import 'package:moyasar_payment/model/source/creditcardmodel.dart';
PayModel res = await MoyasarPayment().stcPay(
    amount: 100.0, 
    phoneNumber: 'phoneNumber', 
    publishableKey: 'publishable_key',
    description: 'description');

STCPayModel stcPayModel = STCPayModel.fromJson(res.source);
            print(stcPayModel.toJson())
STC Pay OTP Verification
var resdata = await MoyasarPayment().StcPayOtp(
    otpValue: 'otp Value',
    transactionUrl: 'transaction_url';

❀️ Found this project useful?

If you found this project useful, then please consider giving it a ⭐ on Github and sharing it with your friends via social media.


: πŸͺ„ : Contributing, 😞 Issues and πŸ› Bug Reports

The project is open to public contribution. Please feel very free to contribute. Experienced an issue or want to report a bug? Please, report it here. Remember to be as descriptive as possible.

Comments
  • Validation Error with CreditCard

    Validation Error with CreditCard

    i'm getting message "Validation Error" i can not get where the error

    my payload is :

    I/flutter ( 4379): svfdsb dfvfdb // name
    I/flutter ( 4379): 4111111111111111 // card number
    I/flutter ( 4379): 123 // cvv
    I/flutter ( 4379): 12 // month
    I/flutter ( 4379): 24 // year
    I/flutter ( 4379): 10.0 // amount
    I/flutter ( 4379): Validation Failed // error message
    

    This is my code :

        print(creditModel.cardHolderName);
        print(creditModel.cardNumber);
        print(creditModel.cvv);
        print(creditModel.month);
        print(creditModel.year);
        print(amount);
        PayModel res = await _moyasarPayment.creditCard(
          description: 'Paying for a service with Credit/Mastercard.',
          amount: amount,
          publishableKey: _publishableKey,
          cardHolderName: creditModel.cardHolderName,
          cardNumber: creditModel.cardNumber,
          cvv: creditModel.cvv,
          expiryManth: creditModel.month,
          expiryYear: creditModel.year,
          callbackUrl: 'https://example.com/orders',
        );
        print(res.message);
    
    opened by AhmedAbogameel 3
  • apple pay return field validation

    apple pay return field validation

    PayModel res = await MoyasarPayment().applePay(
            amount: 100.0,
            publishableKey: MoyasarPaymentGateway.publishableApiKey,
            applepayMerchantId: applepayMerchantId,
            paymentItems: items,
            currencyCode: 'SAR',
            countryCode: 'SA',
            description: 'description');
    

    the function return field validation

    opened by farhioussama1969 3
  • Wrong Number of paramters

    Wrong Number of paramters

    I'm facing issue testing apple pay the message of the following code is "Wrong Number of paramters" i can not understand what does that mean and what paramters it means?

    PayModel res = await _moyasarPayment.applePay(
          amount: amount,
          publishableKey: _publishableKey,
          applepayMerchantId: _applePayMerchantID,
          paymentItems: {'Service Cost' : amount, 'Total Cost': amount},
          currencyCode: 'SAR',
          countryCode: 'SA',
          description: 'Paying for a service with apple pay.',
        );
    
    opened by AhmedAbogameel 3
  • Can't run project & run pod install / pod update after adding moyasar_payment package

    Can't run project & run pod install / pod update after adding moyasar_payment package

    When I execute the command pod install / pod update the error occurs, how to solve this:

    image

    Output when try to run my project

    Launching lib/main.dart on iPhone 11 in debug mode...

    CocoaPods' output: ↳ Preparing Analyzing dependencies Inspecting targets to integrate Using ARCHS setting to build architectures of target Pods-Runner: (``) Finding Podfile changes A moyasar_payment - Flutter - better_player - connectivity - device_info - firebase_core - firebase_dynamic_links - firebase_messaging - flutter_custom_tabs - flutter_local_notifications - flutter_native_timezone - flutter_statusbarcolor_ns - flutter_webview_plugin - geocoding - geolocator_apple - google_maps_flutter_ios - image_picker_ios - notification_permissions - onesignal_flutter - open_file - package_info - package_info_plus - path_provider_ios - pay_ios - permission_handler - sensors - share - share_plus - shared_preferences_ios - sqflite - uni_links - url_launcher_ios - vibration - wakelock - webview_flutter_wkwebview Fetching external sources -> Fetching podspec for Flutter from Flutter -> Fetching podspec for better_player from .symlinks/plugins/better_player/ios -> Fetching podspec for connectivity from .symlinks/plugins/connectivity/ios -> Fetching podspec for device_info from .symlinks/plugins/device_info/ios -> Fetching podspec for firebase_core from .symlinks/plugins/firebase_core/ios firebase_core: Using Firebase SDK version '9.6.0' defined in 'firebase_core' -> Fetching podspec for firebase_dynamic_links from .symlinks/plugins/firebase_dynamic_links/ios firebase_dynamic_links: Using Firebase SDK version '9.6.0' defined in 'firebase_core' -> Fetching podspec for firebase_messaging from .symlinks/plugins/firebase_messaging/ios firebase_messaging: Using Firebase SDK version '9.6.0' defined in 'firebase_core' -> Fetching podspec for flutter_custom_tabs from .symlinks/plugins/flutter_custom_tabs/ios -> Fetching podspec for flutter_local_notifications from .symlinks/plugins/flutter_local_notifications/ios -> Fetching podspec for flutter_native_timezone from .symlinks/plugins/flutter_native_timezone/ios -> Fetching podspec for flutter_statusbarcolor_ns from .symlinks/plugins/flutter_statusbarcolor_ns/ios -> Fetching podspec for flutter_webview_plugin from .symlinks/plugins/flutter_webview_plugin/ios -> Fetching podspec for geocoding from .symlinks/plugins/geocoding/ios -> Fetching podspec for geolocator_apple from .symlinks/plugins/geolocator_apple/ios -> Fetching podspec for google_maps_flutter_ios from .symlinks/plugins/google_maps_flutter_ios/ios -> Fetching podspec for image_picker_ios from .symlinks/plugins/image_picker_ios/ios -> Fetching podspec for moyasar_payment from .symlinks/plugins/moyasar_payment/ios -> Fetching podspec for notification_permissions from .symlinks/plugins/notification_permissions/ios -> Fetching podspec for onesignal_flutter from .symlinks/plugins/onesignal_flutter/ios -> Fetching podspec for open_file from .symlinks/plugins/open_file/ios -> Fetching podspec for package_info from .symlinks/plugins/package_info/ios -> Fetching podspec for package_info_plus from .symlinks/plugins/package_info_plus/ios -> Fetching podspec for path_provider_ios from .symlinks/plugins/path_provider_ios/ios -> Fetching podspec for pay_ios from .symlinks/plugins/pay_ios/ios -> Fetching podspec for permission_handler from .symlinks/plugins/permission_handler/ios -> Fetching podspec for sensors from .symlinks/plugins/sensors/ios -> Fetching podspec for share from .symlinks/plugins/share/ios -> Fetching podspec for share_plus from .symlinks/plugins/share_plus/ios -> Fetching podspec for shared_preferences_ios from .symlinks/plugins/shared_preferences_ios/ios -> Fetching podspec for sqflite from .symlinks/plugins/sqflite/ios -> Fetching podspec for uni_links from .symlinks/plugins/uni_links/ios -> Fetching podspec for url_launcher_ios from .symlinks/plugins/url_launcher_ios/ios -> Fetching podspec for vibration from .symlinks/plugins/vibration/ios -> Fetching podspec for wakelock from .symlinks/plugins/wakelock/ios -> Fetching podspec for webview_flutter_wkwebview from .symlinks/plugins/webview_flutter_wkwebview/ios Resolving dependencies of Podfile CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: all_pods_versions_a_b_0.txt exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/a/b/0/Cache/6.0.0/Cache.podspec.json exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: all_pods_versions_7_2_d.txt exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/7/2/d/GCDWebServer/3.5.4/GCDWebServer.podspec.json exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: all_pods_versions_4_0_4.txt exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/4/0/4/HLSCachingReverseProxyServer/0.1.0/HLSCachingReverseProxyServer.podspec.json exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: all_pods_versions_b_f_d.txt exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/b/f/d/PINCache/3.0.3/PINCache.podspec.json exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: all_pods_versions_c_7_9.txt exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/c/7/9/Reachability/3.2/Reachability.podspec.json exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: all_pods_versions_0_3_5.txt exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/0/3/5/Firebase/9.6.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/0/3/5/Firebase/9.6.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/0/3/5/Firebase/9.6.0/Firebase.podspec.json exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: all_pods_versions_a_d_d.txt exists! Returning local because checking is only performed in repo update CDN: trunk Relative path: Specs/a/d/d/GoogleMaps/7.1.0/GoogleMaps.podspec.json exists! Returning local because checking is only performed in repo update [!] CocoaPods could not find compatible versions for pod "moyasar_payment": In Podfile: moyasar_payment (from .symlinks/plugins/moyasar_payment/ios) Specs satisfying the moyasar_payment (from.symlinks/plugins/moyasar_payment/ios) dependency were found, but they required a higher minimum deployment target. /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:317:in raise_error_unless_state' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:299:inblock in unwind_for_conflict' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in tap' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:inunwind_for_conflict' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:682:in attempt_to_activate' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:inprocess_topmost_state' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in resolve' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:inresolve' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in resolve' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1078:inblock in resolve_dependencies' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in section' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:1076:inresolve_dependencies' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:124:in analyze' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:inanalyze' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in block in resolve_dependencies' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:insection' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in resolve_dependencies' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:ininstall!' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in run' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/claide-1.1.0/lib/claide/command.rb:334:inrun' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in run' /usr/local/Cellar/cocoapods/1.11.3/libexec/gems/cocoapods-1.11.3/bin/pod:55:in<top (required)>' /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in load' /usr/local/Cellar/cocoapods/1.11.3/libexec/bin/pod:23:in

    ' Error output from CocoaPods: ↳ Ignoring ffi-1.15.5 because its extensions are not built. Try: gem pristine ffi --version 1.15.5 Error running pod install Error launching application on iPhone 11. Exited (sigterm)

    Flutter version: 2.10.2 Dart SDK version: 2.18.2 CocoaPods version: 1.11.3

    Flutter Doctor :

    utrodus@192 ~ % flutter doctor -v

    [βœ“] Flutter (Channel stable, 2.10.2, on macOS 11.7 20G817 darwin-x64, locale en-ID)

    β€’ Flutter version 2.10.2 at /Users/utrodus/fvm/versions/2.10.2

    β€’ Upstream repository https://github.com/flutter/flutter.git

    β€’ Framework revision 097d3313d8 (8 months ago), 2022-02-18 19:33:08 -0600

    β€’ Engine revision a83ed0e5e3

    β€’ Dart version 2.16.1

    β€’ DevTools version 2.9.2

    [βœ—] Android toolchain - develop for Android devices

    βœ— Unable to locate Android SDK.

    Install Android Studio from: https://developer.android.com/studio/index.html

    On first launch it will assist you in installing the Android SDK components.

    (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

    If the Android SDK has been installed to a custom location, please use

    flutter config --android-sdk to update to that location.

    [βœ“] Xcode - develop for iOS and macOS (Xcode 13.2.1)

    β€’ Xcode at /Applications/Xcode.app/Contents/Developer

    β€’ CocoaPods version 1.11.3

    [βœ“] Chrome - develop for the web

    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

    [!] Android Studio (not installed)

    β€’ Android Studio not found; download from https://developer.android.com/studio/index.html

    (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

    [βœ“] VS Code (version 1.72.0)

    β€’ VS Code at /Applications/Visual Studio Code.app/Contents

    β€’ Flutter extension version 3.50.0

    [βœ“] Connected device (2 available)

    β€’ iPhone 11 (mobile) β€’ C87C7F59-CD9B-4D19-8306-19FA7D449199 β€’ ios β€’

    com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)

    β€’ Chrome (web) β€’ chrome β€’ web-javascript β€’ Google Chrome 106.0.5249.91

    [βœ“] HTTP Host Availability

    β€’ All required HTTP hosts are available

    ! Doctor found issues in 2 categories.

    opened by utrodus 2
  • creditcard return Validation Failed

    creditcard return Validation Failed

    { "amount": 1000.0, "source": { "type": "creditcard", "name": "yousef madhoun", "number": 4111111111111111, "cvc": 123, "month": 12, "year": 24 }, "callback_url": "https://example.com/orders", "description": "description" }

    return

    { "type": "invalid_request_error", "message": "Validation Failed", "errors": { "company": [ "is not supported. Only Mastercard, Visa, MADA and American Express card numbers are supported" ] } }

    Screen Shot 2022-10-03 at 4 32 21 PM
    opened by yousef-almadhoun 1
Maps for Flutter developers. Supports Apple, Bing, and Google APIs.

Overview Cross-platform geographic maps for Flutter applications. Pull requests are welcome! The packages are licensed under the Apache License 2.0. P

Dint 17 Oct 13, 2022
Plist parser - A Plist parser for Flutter supports XML and binary Apple Property list (plist) formats

Plist Parser for Flutter ?? A Flutter Plugin for Plist parser supporting XML and

dirablue ( gaku ) 4 Nov 17, 2022
This Country Selector UI Library written by Dart and Fluter and supports three locales with country's name, achieves lazy loading, and country card animation on listview

Country Selector Widget This Country Selector Widget UI Library written by Dart and Fluter and supports three locales with country's name, achieves la

Klaus 6 Nov 15, 2022
Flutter widget library containing buttons for authenticating with popular social networks: Apple, Google, Facebook, Twitter and Microsoft.

Flutter Auth Buttons This library is now in maintenance mode I'm no longer actively using Flutter and don't have the time to keep this library maintai

Duncan Jones 115 Nov 3, 2022
Business Card - Business Card App Built With Flutter

Business Card app. Basic single page app with functionality. For now you can cha

buraktaha 5 Apr 20, 2022
A Flutter library for work with Apple Wallet passes.

pass-flutter A Flutter library for work with Apple Wallet passes. How use it Getting pass from URL to internal memory import 'package:pass_flutter/pas

Alexey Lepskii 16 Dec 30, 2022
Google Pay Using Stripe Payment Gateway in Flutter

Accept Payments Using Google Pay With Stripe In Flutter Use the Stripe to start accepting Google Pay in your Android apps. Setup Firebase CLI To imple

Jaimil Patel 24 May 1, 2022
Developed a Clone of the "Google Pay" mobile application.

Google Pay Clone ?? Description: Developed a Clone of the "Google Pay" mobile application. This is a Cross-Platform application, so it can be used for

null 0 May 5, 2022
This is a UI created in FLUTTER. credit ~mitch koko youtuber

project_smarthomeui A new Flutter project. Getting Started This is the image of above code[UI] A few resources to get you started if this is your firs

Vipul Kumawat 3 Nov 17, 2022
[Flutter package] An easy and quick way to check if the local app is updated with the same version in their respective stores (Play Store / Apple Store ).

Retrieve version and url for local app update against store app Android and iOS Features Using as reference packages like in_app_update , version_chec

KauΓͺ Murakami 11 Nov 9, 2022
πŸš— Apple CarPlay for Flutter Apps. Aims to make it safe to use apps made with Flutter in the car by integrating with CarPlay.

CarPlay with Flutter ?? Flutter Apps now on Apple CarPlay! flutter_carplay aims to make it safe to use iPhone apps made with Flutter in the car by int

Oğuzhan Atalay 156 Dec 26, 2022
A music player component for Flutter (i.e. Spotify, Apple Music, etc.) [AGPL/example/no longer maintaining]

This is an example I currently have no plans of putting this on Pub. Originally, I did, but I lost interest. However, I think this is a good example,

Tobe Osakwe 215 Dec 12, 2022
Authentication API client with Flutter (Login, Register, Google Login, Facebook Login, Apple Login)

Flutter Auth App (Login, Register, Google Login, Facebook Login, Apple Login) To use this client, get the server up and running. Try it out now! App S

Denzel Giraldo 50 Jan 4, 2023
A lightweight flutter plugin to check if your app is up-to-date on Google Play Store or Apple App Store

App Version Checker this package is used to check if your app has a new version on playstore or apple app store. or you can even check what is the lat

Iheb Briki 6 Dec 14, 2022
A beautiful, secure and simple authenticator app that supports multiple protocols and services. Free and open source. Written in Flutter and Dart.

OpenAuth A beautiful, secure and simple authenticator app that supports multiple protocols and services. Free and open source. Written in Flutter and

Isaiah Collins Abetong 31 Oct 5, 2022
A new Flutter project. Use of Padding Class(Widget) and Card Class (Widget)

Use_Of_Card_And_Padding_Class A new Flutter project. Use of Padding Class(Widget) and Card Class (Widget) Getting Started This project is a starting p

Avinandan Bose 1 Mar 18, 2022
A Flutter package for Offers, Promo and Invites banners. Supports Android and Web.

flat_banners A Flutter package for Offers, Promo and Invites banners. Android support Android and Web. Usage To use this plugin, add flat_banners as a

Omprakash Chauhan 3 Apr 13, 2022
Flutter Downloader - A plugin for creating and managing download tasks. Supports iOS and Android.

Flutter Downloader A plugin for creating and managing download tasks. Supports iOS and Android. This plugin is based on WorkManager in Android and NSU

Flutter Community 789 Jan 3, 2023
A Video Player For Vimeo Videos in Flutter. This plugin allows us to play video from Vimeo and it supports Android and iOS platforms.

vimeo_video_player A Video Player For Vimeo Videos in Flutter. This plugin allow us to play video from vimeo and it's supports Android and iOS platfor

MindInventory 26 Dec 8, 2022