hyperpay_flutter 0.1.0+1 copy "hyperpay_flutter: ^0.1.0+1" to clipboard
hyperpay_flutter: ^0.1.0+1 copied to clipboard

A Flutter plugin for HyperPay payment gateway with enhanced features including Apple Pay and card payments. Created by Sahibzada Arham Anwaar Bugvi.

HyperPay Flutter #

pub package style: very good analysis License: MIT

A Flutter plugin for integrating HyperPay payment gateway with enhanced features including Apple Pay and card payments.

Features #

  • πŸ’³ Credit Card Payments
  • 🏦 MADA Support
  • 🍎 Apple Pay Integration
  • πŸ”„ Automatic Checkout ID Creation
  • 🎨 Beautiful UI Components
  • ✨ Type-safe API
  • πŸ”’ Secure Payment Processing
  • πŸ“± Example App Included

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  hyperpay_flutter: ^0.1.0+1

Usage #

Initialize HyperPay #

await HyperPay.init(
  config: HyperPayConfig.test( // or HyperPayConfig.live for production
    merchantIdentifier: 'YOUR_MERCHANT_ID',
    companyName: 'YOUR_COMPANY_NAME',
    authToken: 'YOUR_AUTH_TOKEN',
    entityId: 'YOUR_ENTITY_ID',
  ),
);

Process a Payment #

try {
  final result = await HyperPay.I.pay(
    amount: 100.0,
    currency: 'SAR',
    method: PaymentMethod.card, // or PaymentMethod.applePay
  );

  switch (result.status) {
    case PaymentStatus.success:
      print('Payment successful! Transaction ID: ${result.transactionId}');
    case PaymentStatus.failed:
      print('Payment failed: ${result.error}');
    case PaymentStatus.canceled:
      print('Payment was canceled');
    case PaymentStatus.pending:
      print('Payment is pending');
  }
} catch (e) {
  print('Error processing payment: $e');
}

Check Apple Pay Availability #

if (await HyperPay.I.hasApplePay) {
  // Show Apple Pay button
}

Test Cards #

Credit Cards (Success) #

Card Number: 4440 0000 0990 0010
Cardholder Name: Any Name
Expiry Date: 01/39
CVV: 100
Result: Success

Card Number: 5123 4500 0000 0008
Cardholder Name: Any Name
Expiry Date: 01/39
CVV: 100
Result: Success

Credit Cards (Failure) #

Card Number: 5204 7300 0000 2514
Cardholder Name: Any Name
Expiry Date: 01/39
CVV: 251
Result: Fail

MADA Cards #

Card Number: 5360 2301 5942 7034
Cardholder Name: Any Name
Expiry Date: 11/24
CVV: 850

Example App #

Check out the example directory for a complete sample app demonstrating all features.

Payment Methods Card Payment Apple Pay

API Documentation #

HyperPay #

The main class for interacting with the payment gateway.

  • HyperPay.I - Singleton instance
  • HyperPay.init() - Initialize the SDK
  • HyperPay.isInitialized - Check if SDK is initialized
  • HyperPay.config - Current configuration

Payment Methods #

enum PaymentMethod {
  applePay,
  card,
  mada,
}

Payment Status #

enum PaymentStatus {
  success,
  failed,
  canceled,
  pending,
}

Configuration #

// Test Environment
final config = HyperPayConfig.test(
  merchantIdentifier: 'YOUR_MERCHANT_ID',
  companyName: 'YOUR_COMPANY_NAME',
  authToken: 'YOUR_AUTH_TOKEN',
  entityId: 'YOUR_ENTITY_ID',
);

// Live Environment
final config = HyperPayConfig.live(
  merchantIdentifier: 'YOUR_LIVE_MERCHANT_ID',
  companyName: 'YOUR_COMPANY_NAME',
  authToken: 'YOUR_LIVE_AUTH_TOKEN',
  entityId: 'YOUR_LIVE_ENTITY_ID',
);

Contributing #

Contributions are welcome! Please read our contributing guidelines to get started.

License #

This project is licensed under the MIT License - see the LICENSE file for details.

1
likes
160
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for HyperPay payment gateway with enhanced features including Apple Pay and card payments. Created by Sahibzada Arham Anwaar Bugvi.

Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

flutter, http, json_annotation

More

Packages that depend on hyperpay_flutter

Packages that implement hyperpay_flutter