currency_cloud 0.2.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 80

Currency Cloud Dart API

Gitlab Status Pub Status

A dart library for the Currency Cloud service

Usage

A simple usage example

Changelog

0.2.0

  • add missing pub dependency
  • PaymentsApi.create() now uses PaymentType instead of a String
  • API calls with currencies as arguments use Currency from money now instead of String

0.1.0

  • add grinder for formatting and testing
  • add ci for gitlab
  • remove defunct authentication test
  • remove integration tests
  • remove debug output
  • update gitignore

0.0.8

  • switch to new api url

0.0.7

  • add balance api (retrieve)

0.0.1

  • Initial version, created by Stagehand

example/example.dart

import 'package:currency_cloud/currency_cloud.dart';

main() async {
  final cc = new CurrencyCloud('loginId', 'apiKey');

  // 1. Authenticate
  await cc.authApi.authenticate();

  // 2. Get a Quote
  final buyCurrency = new Currency('EUR');
  final sellCurrency = new Currency('GBP');
  final fixedSide = FixedSide.buy;
  final amount = '1000.00';

  final rates = await cc.ratesApi.detailed(buyCurrency, sellCurrency, fixedSide, amount);
  print(rates);

  // 3. Convert
  final reason = 'Invoice Payment';
  final termAgreement = true;

  final conversion = await cc.conversionApi.create(buyCurrency, sellCurrency, fixedSide, amount, reason, termAgreement);

  // 4. Add a Beneficiary
  final bankAccountHolderName = 'Acme GmbH';
  final bankCountry = 'DE';
  final currency = new Currency('EUR');
  final name = '';
  final iban = 'DE89370400440532013000';
  final bicSwift = 'COBADEFF';

  final beneficiary = await cc.beneficiariesApi
      .create(bankAccountHolderName, bankCountry, currency, name, iban: iban, bicSwift: bicSwift);

  // 5. Pay
  final money = new Money.fromString(amount, buyCurrency);
  final reference = 'Invoice 1234';

  final payment =
      await cc.paymentsApi.create(money, beneficiary['id'], reason, reference, conversionId: conversion['id']);
  print(payment);
}

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  currency_cloud: "^0.2.1"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:currency_cloud/currency_cloud.dart';
        
Version Uploaded Documentation Archive
0.2.1 Apr 23, 2018 Go to the documentation of currency_cloud 0.2.1 Download currency_cloud 0.2.1 archive
0.2.0 Feb 14, 2018 Go to the documentation of currency_cloud 0.2.0 Download currency_cloud 0.2.0 archive
0.1.0 Feb 9, 2018 failed Download currency_cloud 0.1.0 archive
0.0.8 Feb 27, 2017 failed Download currency_cloud 0.0.8 archive
0.0.7 Nov 28, 2016 failed Download currency_cloud 0.0.7 archive
0.0.6 Sep 19, 2016 failed Download currency_cloud 0.0.6 archive
0.0.5 Sep 19, 2016 failed Download currency_cloud 0.0.5 archive
0.0.4 Sep 16, 2016 failed Download currency_cloud 0.0.4 archive
0.0.3 Sep 16, 2016 failed Download currency_cloud 0.0.3 archive

Analysis

We analyzed this package on Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
62 / 100
Health:
Code health derived from static analysis. [more]
98 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
80
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:currency_cloud/currency_cloud.dart.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 7 hints.

    Run dartfmt to format lib/src/api/beneficiaries.dart.

    Run dartfmt to format lib/src/api/conversion.dart.

    Similar analysis of the following files failed:

    • lib/src/api/payments.dart (hint)
    • lib/src/api/rates.dart (hint)
    • lib/src/api/reference_data.dart (hint)
    • lib/src/base/currency_cloud_base.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.0 <2.0.0
http ^0.11.3+15 0.11.3+16
logging ^0.11.0 0.11.3+1
money ^0.1.6 0.1.6
Transitive dependencies
async 2.0.6
charcode 1.1.1
collection 1.14.9
http_parser 3.1.1
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
Dev dependencies
glob ^1.1.0
grinder ^0.8.0+3
mockito ^2.2.0
path ^1.5.0 1.5.1
test ^0.12.24+8
yaml ^2.1.0