yandex_checkout_flutter 1.0.0+2 copy "yandex_checkout_flutter: ^1.0.0+2" to clipboard
yandex_checkout_flutter: ^1.0.0+2 copied to clipboard

discontinued
outdated

Implementation Yandex Checkout SDK for Flutter.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:yandex_checkout_flutter/yandex_checkout_flutter.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _data = '';

  @override
  Widget build(BuildContext context) => MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text('Yandex checkout example'),
      ),
      body: Center(
        child: Column(
          children: <Widget>[
            Expanded(
                child: Text(_data, softWrap: true),
            ),
            OutlineButton(
                child: const Text('Buy anything...'),
                onPressed: () async {
                  final PaymentParameters param = PaymentParameters(
                      amount: Amount(currency: Currency.RUB, value: 20.99),
                      title: 'Anything',
                      subTitle: 'Subtitle anything',
                      clientApplicationKey: 'test_token',
                      paymentMethodTypes: {
                        PaymentMethodType.SBERBANK,
                        PaymentMethodType.BANK_CARD,
                        PaymentMethodType.GOOGLE_PAY,
                      },
                      googlePayParameters: {
                        GooglePayParameters.MASTERCARD,
                        GooglePayParameters.VISA
                      },
                      shopId: '000000');
                  final Result result = await YandexCheckout().startTestCheckout(param);
                  if(result.hasError)
                    setState(() => _data = 'Error');
                  else if(result.hasData){
                    final data = result.data;
                    setState(() => _data = data.token);
                  }
                  else
                    setState(() => _data = 'Checkout cancel');
                }
            )
          ],
        ),
      ),
    ),
  );
}
0
likes
0
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

Implementation Yandex Checkout SDK for Flutter.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on yandex_checkout_flutter

Packages that implement yandex_checkout_flutter