Sha256: b2dc3368e103b3db3a27a9759efc723bfb6df30a55465fcf389e383e635507d4

Contents?: true

Size: 1.75 KB

Versions: 2

Compression:

Stored size: 1.75 KB

Contents

# Tango::Client

HTTP client to ease using Tango API

## Installation

Add this line to your application's Gemfile:

    gem 'tango-client'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install tango-client

## Usage

### Use Tango class methods

```ruby

require 'tango'

Tango.get_available_balance
# => 539694976

Tango.purchase_card(cardSku: 'tango-card',
                    cardValue: 100,
                    tcSend: false,
                    recipientName: nil,
                    recipientEmail: nil,
                    giftMessage: nil,
                    giftFrom: nil)
# => {
#   :referenceOrderId=>"112-12226603-04",
#   :cardToken=>"50bdb8ce341848.92673903",
#   :cardNumber=>"7001-5040-0198-7543-015",
#   :cardPin=>"971642",
#   :claimUrl=>nil,
#   :challengeKey=>"7001504001987543015"
# }

```

### Use Client instance

```ruby
require 'tango'

client = Tango::Client.new(:username => 'myaccount', :password => 'mypassword')

client.get_available_balance
client.purchase_card({})
```

### Configuration

-   `Tango` class methods are delegated to `Tango.client`, which options can
    be changed by updating `Tango.options`. The changes are applied since next
    request.
-   `Tango::Client` instances are configured by initialization argument.
-   Default username, password and endpoint can be configured by environment variable
    `TANGO_USERNAME`, `TANGO_PASSWORD` and `TANGO_ENDPOINT`.
-   Changes to `Tango::Default.options` will applied to following created new client
    instance as default values.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tango-client-1.0.1 README.md
tango-client-1.0.0 README.md