currency_cloud 1.0.2

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

Currency Cloud Dart API

Gitlab Status Pub Status

A dart library for the Currency Cloud service

Usage

A simple usage example

Changelog

1.0.2

  • Add missing underscore for certain Beneficiary keys

1.0.1

  • Fix wrong cast in the references data API call
  • Switch to json_serialize instead of codable for JSON (de)serialization

1.0.0

  • Use classes instead of maps for all API messages
  • Remove money dependency
  • Revert to use String of currency codes again

0.3.0

  • Fix all implicit type casts and cleanup for dart 2.0

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';
import 'package:decimal/decimal.dart';

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

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

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

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

  // 3. Convert
  final createConversion = new CreateConversion(
    buyCurrency: buyCurrency,
    sellCurrency: sellCurrency,
    fixedSide: fixedSide,
    amount: amount,
    termAgreement: true,
    reason: 'Invoice Payment',
  );

  final conversion = await cc.conversionApi.create(createConversion);
  print(conversion);

  // 4. Add a Beneficiary
  final createBeneficiary = new CreateBeneficiary(
    name: 'My Test Beneficiary',
    bankAccountHolderName: 'My Test Account Holder',
    bankCountry: 'DE',
    currency: buyCurrency,
    iban: 'DE89370400440532013000',
    bicSwift: 'COBADEFF',
  );

  final beneficiary = await cc.beneficiariesApi.create(createBeneficiary);
  print(beneficiary);

  // 5. Pay
  final createPayment = new CreatePayment(
    currency: buyCurrency,
    beneficiaryId: '9b40b6e7-5d18-42ac-87bc-5c5f774e91ab',
    amount: amount,
    reason: 'This is a test payment.',
    reference: 'This is a test reference.',
  );

  final payment = await cc.paymentsApi.create(createPayment);
  print(payment);
}

Use this package as a library

1. Depend on it

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


dependencies:
  currency_cloud: ^1.0.2

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 flutter 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
1.0.2 Oct 16, 2018 Go to the documentation of currency_cloud 1.0.2 Download currency_cloud 1.0.2 archive
1.0.1 Aug 29, 2018 Go to the documentation of currency_cloud 1.0.1 Download currency_cloud 1.0.1 archive
1.0.0 Aug 7, 2018 Go to the documentation of currency_cloud 1.0.0 Download currency_cloud 1.0.0 archive
0.3.0 Aug 1, 2018 Go to the documentation of currency_cloud 0.3.0 Download currency_cloud 0.3.0 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 Go to the documentation of currency_cloud 0.1.0 Download currency_cloud 0.1.0 archive
0.0.8 Feb 27, 2017 Go to the documentation of currency_cloud 0.0.8 Download currency_cloud 0.0.8 archive
0.0.7 Nov 28, 2016 Go to the documentation of currency_cloud 0.0.7 Download currency_cloud 0.0.7 archive
0.0.6 Sep 19, 2016 Go to the documentation of currency_cloud 0.0.6 Download currency_cloud 0.0.6 archive

All 13 versions...

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

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

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, web, other

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

Health issues and suggestions

Document public APIs (-9.43 points)

366 out of 388 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.0 <3.0.0
decimal ^0.3.2 0.3.2
http ^0.11.3+15 0.11.3+17 0.12.0
json_annotation ^1.1.0 1.2.0 2.0.0
logging ^0.11.0 0.11.3+2
meta ^1.1.6 1.1.6
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
rational 0.3.1
source_span 1.4.1
string_scanner 1.0.4
typed_data 1.1.6
Dev dependencies
build_runner ^0.10.1
glob ^1.1.0
grinder ^0.8.3
json_serializable ^1.1.0
mockito ^3.0.0
path ^1.6.0 1.6.2
test ^1.0.0
yaml ^2.1.0