-
Notifications
You must be signed in to change notification settings - Fork 7
Money SDK
The
Money
archetype represents an amount of a specificCurrency
.
- Standards compliance
- Business archetypes defined
- Explore other business archetype patterns
-
Currency
-
Payment
-
PaymentMethod
Standard | Contents |
---|---|
OMG Currency Specification v1.0 | A standard to support international currency. |
ISO 4217 | Three- and two-letter currency codes, currency numbers, and currency names. |
ISO 3166 | Two-letter country codes and country names. |
"A business archetype is a primordial thing that occurs consistently and universally in business domains and business software systems." (Arlow & Neustadt, Enterprise patterns and MDA: building better software with archetype patterns and UML, 2006, p. 5)
Open a Swagger-UI instance, then copy and paste the following Swagger specification URLs into the "Explore" text field and select the "Explore" button for additional APIs.
-
Locale
: http://api.swindle.net/archetypes/v1/schemas/locales/locales.yaml -
Money
: http://api.swindle.net/archetypes/v1/schemas/money/money.yaml -
Party
: http://api.swindle.net/archetypes/v1/schemas/parties/parties.yaml -
Quantity
: http://api.swindle.net/archetypes/v1/schemas/quantities/quantities.yaml
Currency
implementsMetric
and isacceptedIn
one or moreLocales
.Currency's
unique identifier is itsalphabeticCode
.
At present, there are two fundamentally different types of currency -- those that are specified by ISO and those that are not.
-
IsoCurrency
represents a type ofCurrency
with ISO 4217 definitions for
-
name
, -
alphabeticCode
, and -
numericCode
.
-
NonIsoCurrency
represents a type ofCurrency
that is not defined in any ISO specification. These types of currency might unrecognized or arbitrary "rewards," like American Airlines AAdvantage Miles.
Retrieve all currencies.
GET /currencies
Curl
curl -X GET "http://api.swindle.net/archetypes/v1/money/currencies"
Java
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CurrencyApi;
import java.io.File;
import java.util.*;
public class CurrencyApiExample {
public static void main(String[] args) {
CurrencyApi apiInstance = new CurrencyApi();
try {
array[Currency_1] result = apiInstance.getCurrencies();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CurrencyApi#getCurrencies");
e.printStackTrace();
}
}
}
Android
Java
import io.swagger.client.api.CurrencyApi;
public class CurrencyApiExample {
public static void main(String[] args) {
CurrencyApi apiInstance = new CurrencyApi();
try {
array[Currency_1] result = apiInstance.getCurrencies();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CurrencyApi#getCurrencies");
e.printStackTrace();
}
}
}
Objective-C
CurrencyApi *apiInstance = [[CurrencyApi alloc] init];
// Retrieve all currencies.
[apiInstance getCurrenciesWithCompletionHandler:
^(array[Currency_1] output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
JavaScript
const Money = require('money');
const api = new Money.CurrencyApi()
const callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getCurrencies(callback);
C#
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getCurrenciesExample
{
public void main()
{
const apiInstance = new CurrencyApi();
try
{
// Retrieve all currencies.
array[Currency_1] result = apiInstance.getCurrencies();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling CurrencyApi.getCurrencies: " + e.Message );
}
}
}
}
PHP
getCurrencies();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CurrencyApi->getCurrencies: ', $e->getMessage(), PHP_EOL;
}
?>
Perl
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CurrencyApi;
my $api_instance = WWW::SwaggerClient::CurrencyApi->new();
eval {
my $result = $api_instance->getCurrencies();
print Dumper($result);
};
if ($@) {
warn "Exception when calling CurrencyApi->getCurrencies: $@\n";
}
Python
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
## create an instance of the API class
api_instance = swagger_client.CurrencyApi()
try:
# Retrieve all currencies.
api_response = api_instance.get_currencies()
pprint(api_response)
except ApiException as e:
print("Exception when calling CurrencyApi->getCurrencies: %s\n" % e)
Retrieve a specific Currency by its alphabetic code.
GET /currencies/{alphabetic-code}
Curl
curl -X GET "http://api.swindle.net/archetypes/v1/money/currencies/{alphabetic-code}"
Java
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CurrencyApi;
import java.io.File;
import java.util.*;
public class CurrencyApiExample {
public static void main(String[] args) {
CurrencyApi apiInstance = new CurrencyApi();
String alphabeticCode = alphabeticCode_example; // String | An alphabetic code that represents the currency.
try {
Currency_1 result = apiInstance.getCurrencyByAlphabeticCode(alphabeticCode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CurrencyApi#getCurrencyByAlphabeticCode");
e.printStackTrace();
}
}
}
Android
import io.swagger.client.api.CurrencyApi;
public class CurrencyApiExample {
public static void main(String[] args) {
CurrencyApi apiInstance = new CurrencyApi();
String alphabeticCode = alphabeticCode_example; // String | An alphabetic code that represents the currency.
try {
Currency_1 result = apiInstance.getCurrencyByAlphabeticCode(alphabeticCode);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CurrencyApi#getCurrencyByAlphabeticCode");
e.printStackTrace();
}
}
}
Objective-C
String *alphabeticCode = alphabeticCode_example; // An alphabetic code that represents the currency.
CurrencyApi *apiInstance = [[CurrencyApi alloc] init];
// Retrieve a Currency by alphabetic code.
[apiInstance getCurrencyByAlphabeticCodeWith:alphabeticCode
completionHandler: ^(Currency_1 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
JavaScript
const Money = require('money');
const api = new Money.CurrencyApi()
const alphabeticCode = alphabeticCode_example; // {String} An alphabetic code that represents the currency.
const callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getCurrencyByAlphabeticCode(alphabeticCode, callback);
C#
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getCurrencyByAlphabeticCodeExample
{
public void main()
{
const apiInstance = new CurrencyApi();
const alphabeticCode = alphabeticCode_example; // String | An alphabetic code that represents the currency.
try
{
// Retrieve a Currency by alphabetic code.
Currency_1 result = apiInstance.getCurrencyByAlphabeticCode(alphabeticCode);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling CurrencyApi.getCurrencyByAlphabeticCode: " + e.Message );
}
}
}
}
PHP
getCurrencyByAlphabeticCode($alphabeticCode);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CurrencyApi->getCurrencyByAlphabeticCode: ', $e->getMessage(), PHP_EOL;
}
?>
Perl
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CurrencyApi;
my $api_instance = WWW::SwaggerClient::CurrencyApi->new();
my $alphabeticCode = alphabeticCode_example; # String | An alphabetic code that represents the currency.
eval {
my $result = $api_instance->getCurrencyByAlphabeticCode(alphabeticCode => $alphabeticCode);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CurrencyApi->getCurrencyByAlphabeticCode: $@\n";
}
Python
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.CurrencyApi()
alphabeticCode = alphabeticCode_example # String | An alphabetic code that represents the currency.
try:
# Retrieve a Currency by alphabetic code.
api_response = api_instance.get_currency_by_alphabetic_code(alphabeticCode)
pprint(api_response)
except ApiException as e:
print("Exception when calling CurrencyApi->getCurrencyByAlphabeticCode: %s\n" % e)
Path parameters
Name | Description |
---|---|
alphabetic-code* | String An alphabetic code that represents the currency. Required |
The
Payment
archetype representsMoney
paid by oneParty
to another in return for goods or services.
Retrieve all payments.
GET /payments
Curl
curl -X GET "http://api.swindle.net/archetypes/v1/money/payments"
Java
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PaymentApi;
import java.io.File;
import java.util.*;
public class PaymentApiExample {
public static void main(String[] args) {
PaymentApi apiInstance = new PaymentApi();
try {
array[Payment_1] result = apiInstance.getPayments();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentApi#getPayments");
e.printStackTrace();
}
}
}
Android
import io.swagger.client.api.PaymentApi;
public class PaymentApiExample {
public static void main(String[] args) {
PaymentApi apiInstance = new PaymentApi();
try {
array[Payment_1] result = apiInstance.getPayments();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentApi#getPayments");
e.printStackTrace();
}
}
}
Objective-C
PaymentApi *apiInstance = [[PaymentApi alloc] init];
// Retrieve all payments.
[apiInstance getPaymentsWithCompletionHandler:
^(array[Payment_1] output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
JavaScript
const Money = require('money');
const api = new Money.PaymentApi()
const callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getPayments(callback);
C#
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getPaymentsExample
{
public void main()
{
const apiInstance = new PaymentApi();
try
{
// Retrieve all payments.
array[Payment_1] result = apiInstance.getPayments();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PaymentApi.getPayments: " + e.Message );
}
}
}
}
PHP
getPayments();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PaymentApi->getPayments: ', $e->getMessage(), PHP_EOL;
}
?>
Perl
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PaymentApi;
my $api_instance = WWW::SwaggerClient::PaymentApi->new();
eval {
my $result = $api_instance->getPayments();
print Dumper($result);
};
if ($@) {
warn "Exception when calling PaymentApi->getPayments: $@\n";
}
Python
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
## create an instance of the API class
api_instance = swagger_client.PaymentApi()
try:
# Retrieve all payments.
api_response = api_instance.get_payments()
pprint(api_response)
except ApiException as e:
print("Exception when calling PaymentApi->getPayments: %s\n" % e)
A
PaymentMethod
is a medium by whichMoney
is transferred.
PaymentMethods
include (but are not limited to):
PaymentCard
CreditCard
DebitCard
GiftCard
Donation
Cash
DigitalCurrency
Check
Retrieve all payment method types.
GET /payment-methods
Curl
curl -X GET "http://api.swindle.net/archetypes/v1/money/payment-methods"
Java
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.PaymentMethodApi;
import java.io.File;
import java.util.*;
public class PaymentMethodApiExample {
public static void main(String[] args) {
PaymentMethodApi apiInstance = new PaymentMethodApi();
try {
array[Object] result = apiInstance.getPaymentMethods();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentMethodApi#getPaymentMethods");
e.printStackTrace();
}
}
}
Android
import io.swagger.client.api.PaymentMethodApi;
public class PaymentMethodApiExample {
public static void main(String[] args) {
PaymentMethodApi apiInstance = new PaymentMethodApi();
try {
array[Object] result = apiInstance.getPaymentMethods();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentMethodApi#getPaymentMethods");
e.printStackTrace();
}
}
}
Objective-C
PaymentMethodApi *apiInstance = [[PaymentMethodApi alloc] init];
// Retrieve all payment method types.
[apiInstance getPaymentMethodsWithCompletionHandler:
^(array[Object] output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
JavaScript
const Money = require('money');
const api = new Money.PaymentMethodApi()
const callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getPaymentMethods(callback);
C#
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class getPaymentMethodsExample
{
public void main()
{
const apiInstance = new PaymentMethodApi();
try
{
// Retrieve all payment method types.
array[Object] result = apiInstance.getPaymentMethods();
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling PaymentMethodApi.getPaymentMethods: " + e.Message );
}
}
}
}
PHP
getPaymentMethods();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PaymentMethodApi->getPaymentMethods: ', $e->getMessage(), PHP_EOL;
}
?>
Perl
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::PaymentMethodApi;
my $api_instance = WWW::SwaggerClient::PaymentMethodApi->new();
eval {
my $result = $api_instance->getPaymentMethods();
print Dumper($result);
};
if ($@) {
warn "Exception when calling PaymentMethodApi->getPaymentMethods: $@\n";
}
Python
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
### create an instance of the API class
api_instance = swagger_client.PaymentMethodApi()
try:
# Retrieve all payment method types.
api_response = api_instance.get_payment_methods()
pprint(api_response)
except ApiException as e:
print("Exception when calling PaymentMethodApi->getPaymentMethods: %s\n" % e)
Suggestions, contact, support and error reporting; Contact Info: [email protected]
Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html Generated 2017-09-05T07:16:36.039Z
This work is licensed under a Creative Commons Attribution 4.0 International License.
Graphic art by icons8.