<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.

For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/tools/pub/writing-package-pages).

For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/to/develop-packages).
-->

<p align="center">
  <img src="https://bemobi.com/wp-content/uploads/2023/07/bemobi1.svg" alt="Bemobi Smart Checkout Logo" width="200"/>
</p>

# SDK Bemobi Smart Checkout Flutter


SDK Flutter para integração com o Bemobi Smart Checkout, oferecendo uma solução simples e robusta para pagamentos.

## Features

- Integração simples com Smart Checkout
- Suporte a callbacks de sucesso e erro
- Ambiente de teste e produção
- Bridge JavaScript-Flutter
- Exemplo de implementação incluso

## Getting started

1. Adicione a dependência no seu `pubspec.yaml`:

```yaml
dependencies:
  bemobi_smartcheckout_flutter: ^0.0.12
```

2. Configure as carteiras digitais (opcional):

Para Apple Pay (ios/Runner/Info.plist):
```xml
<key>com.apple.developer.in-app-payments</key>
<array>
  <string>merchant.seu.identificador</string>
</array>
```

Para Google Pay (android/app/src/main/AndroidManifest.xml):
```xml
<meta-data
  android:name="com.google.android.gms.wallet.api.enabled"
  android:value="true" />
```

3. Importe o pacote:

```dart
import 'package:bemobi_smartcheckout_flutter/bemobi_smartcheckout_flutter.dart';
```

## Usage

Exemplo básico de uso:

```dart
await BemobiSDK.startCheckout(
  context: context,
  environment: 'development',
  session_token: 'seu-codigo-de-sessao',
  onSuccess: (result) {
    print('Pagamento realizado com sucesso: $result');
  },
  onError: (error) {
    print('Erro no pagamento: $error');
  },
  onClose: () {
    print('Checkout fechado');
  },
);
```


