PayWay

PayWay REST API Elixir wrapper. API documentation.

Usage

The library stores PayWay options such as the api_key in an Elixir agent, this is so that any actual calls can be made from anywhere within an application without having to pipe through the same options over and over again. Due to this, only one instance of PayWay is ever allowed.

PayWay.init(
  secret_key:      "PAYWAY_SECRET_API_KEY",
  publishable_key: "PAYWAY_PUBLISHABLE_API_KEY"
)

PayWay.get("/")

Configuration

Option Type Default Value Description

| :api_endpoint | string | "https://api.payway.com.au/rest/v1" | The base URL of the PayWay API endpoint. | :secret_key | string | "" | The secret API key. | :publishable_key | string | "" | The publishable API key.

APIs

The intention of the APIs is to simplify the interface to PayWay, and to support Xplor's payment process.

Tests

Copy config/credentials.exs.template into config/credentials.exs and fill out the secret key and publishable key values. These keys are used to communicate to the PayWay API with ExVCR (see below).

ExVCR is used to record PayWay API responses, when a test is added or changed, you will need to remove the corresponding cassettes when necessary.

Make sure you check and update config.exs to filter out any sensitive data from the recorded cassettes.

Fast Tests

Runs only the test suite, and uses VCR cassettes when available.

mix test

Full Tests

Runs type checking via Dialzyer, test coverage via Coveralls, and the test suite with VCR cassettes removed so real HTTP calls are made to the PayWay sandbox API.

mix full_test

Author

License

Licensed under MIT.