youcan_pay 1.0.1 copy "youcan_pay: ^1.0.1" to clipboard
youcan_pay: ^1.0.1 copied to clipboard

A Dart/Flutter client SDK for YouCan pay gateway, which allows you to integrate Youcan pay payment gateway into your Dart/Flutter project.

example/main.dart

import 'dart:math';

import 'package:youcan_pay/youcan_pay.dart';

void main() async {
  final random = Random().nextInt(99999999);

  final email = "example$random@gmail.com";
  final phone = "+2126$random";
  final password = "12345678";

  try {
    final res = await YouCanPay.instance.account.register(
      email: email,
      firstName: "John",
      lastName: "Doe",
      password: password,
      phone: phone,
    );

    print(res.message);
  } on YouCanPayException catch (e) {
    print(e);
  }
  late String token;

  try {
    final res = await YouCanPay.instance.account.login(
      emailOrPhone: email,
      password: password,
    );
    token = res.token;
    print(res.token);
  } on YouCanPayException catch (e) {
    print(e.message);
    print(e.statusCode);
  }

  try {
    final res = await YouCanPay.instance.currencies.conversionRates(
      token: token,
    );

    print(res.baseCurrency);
    print(res.conversionRates["MAD"]);
    print(res.conversionRates["USD"]);
  } on YouCanPayException catch (e) {
    print(e.message);
    print(e.statusCode);
  }
}
2
likes
140
points
78
downloads

Publisher

verified publishergwhyyy.com

Weekly Downloads

A Dart/Flutter client SDK for YouCan pay gateway, which allows you to integrate Youcan pay payment gateway into your Dart/Flutter project.

Repository (GitHub)
View/report issues

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

equatable, flutter, http, webview_flutter

More

Packages that depend on youcan_pay