omise_flutter 0.1.6 copy "omise_flutter: ^0.1.6" to clipboard
omise_flutter: ^0.1.6 copied to clipboard

A package for integrating to Omise REST API. It targets only for a client-side usage to create a token, create a source and retrieve a capability of your account.

example/example.dart

import 'package:omise_flutter/omise_flutter.dart';

/// Get your public key on Omise Dashboard
const publicKey = "YOUR_PUBLIC_KEY";
OmiseFlutter omise = OmiseFlutter(publicKey);

/// OmiseFlutter provides direct access to Omise REST API
exampleCreateToken() async {
  // See Omise API documentation for details
  // https://www.omise.co/tokens-api
  // ignore: unused_local_variable
  final token = await omise.token
      .create("John Doe", "4242424242424242", "12", "2020", "123");

  // ignore: todo
  // TODO: You have to send the given token id back to your server.
}

exampleCreateSource() async {
  // See Omise API documentation for details
  // https://www.omise.co/sources-api
  final source =
      await omise.source.create(10000, "thb", "internet_banking_bay");

  print(source.id);
}

exampleRetrieveCapability() async {
  // See Omise API documentation for details
  // https://www.omise.co/capability-api
  final capability = await omise.capability.retrieve();

  print(capability.paymentMethods);
}
14
likes
130
pub points
72%
popularity

Publisher

verified publisheropn.ooo

A package for integrating to Omise REST API. It targets only for a client-side usage to create a token, create a source and retrieve a capability of your account.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

crypto, flutter, http

More

Packages that depend on omise_flutter