yookassa_client 1.0.5 copy "yookassa_client: ^1.0.5" to clipboard
yookassa_client: ^1.0.5 copied to clipboard

A Dart client for Yookassa Payments APIs, simplifying payment integration and transaction processing for web,desktop and mobile applications.

example/main.dart

import 'package:dio/dio.dart';
import 'package:yookassa_client/yookassa_client.dart';

void main() async {
  final dio = Dio();

  final yookassaClient = YookassaClient(
    dio,
    credentials: const YookassaAuthCredentials(
      shopId: 'your_shop_id',
      secretKey: 'your_secret_key',
    ),
  );

  const createdPaymentRequest = CreatePaymentRequest(
    amount: Amount(
      value: '100.00',
      currency: 'RUB',
    ),
    paymentMethodData: YookassaPaymentMethod.sbp(),
    confirmation: YookassaConfirmation.qr(),
    capture: true,
    description: 'Заказ #1',
  );

  try {
    final payment = await yookassaClient.createPayment(
      paymentRequest: createdPaymentRequest,
    );

    payment.map(
      pending: (payment) {
        print(payment);
      },
      waitingForCapture: (payment) {
        print(payment);
      },
      succeeded: (payment) {
        print(payment);
      },
      canceled: (payment) {
        print(payment);
      },
    );
  } on YookassaException catch (e) {
    print(e);
  }
}
5
likes
110
points
52
downloads

Publisher

verified publisherdev.selamapp.ru

Weekly Downloads

A Dart client for Yookassa Payments APIs, simplifying payment integration and transaction processing for web,desktop and mobile applications.

Repository (GitHub)
View/report issues

Topics

#payments #yookassa

Documentation

API reference

License

MIT (license)

Dependencies

dio, freezed_annotation, json_annotation, retrofit, stack_trace, uuid

More

Packages that depend on yookassa_client