<commit_before># PayPoint::Blue

API client for PayPoint's 3rd generation PSP product a.k.a PayPoint Blue.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'paypoint-blue'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install paypoint-blue

## Usage

``` ruby
# endpoint can be the actual URL or one of :mite_api, :mite_hosted, :live_api, or :live_hosted
# installation id and credentials default to these ENV vars if omitted
blue = PayPoint::Blue.hosted_client(
  endpoint: :test,
  inst_id: ENV['BLUE_API_INSTALLATION'],
  api_id: ENV['BLUE_API_ID'],
  api_password: ENV['<PASSWORD>']
)

blue.ping # => :ok
<commit_msg>Update example in the README<commit_after># PayPoint::Blue

API client for PayPoint's 3rd generation PSP product a.k.a PayPoint Blue.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'paypoint-blue'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install paypoint-blue

## Usage

``` ruby
# Endpoint can be the actual URL or one of :test or :live.
# Installation id and credentials default to these ENV vars if omitted.
blue = PayPoint::Blue.hosted_client(
  endpoint: :test,
  inst_id: ENV['BLUE_API_INSTALLATION'],
  api_id: ENV['BLUE_API_ID'],
  api_password: ENV['<PASSWORD>']
)

blue.ping # => true

blue.make_payment(
  transaction: {
    merchantReference: "abcd-1234",
    money: { amount: { fixed: "4.89" }, currency: "GBP" }
  },
  customer: {
    identity: { merchantCustomerId: "42" },
    details: { name: "<NAME>" }
  },
  session: {
    returnUrl: { url: "http://example.com/callback/abcd-1234" },
    skin: "9001"
  }
) # => { sessionId: "39ac...", redirectUrl: "https://hosted.paypoint.net/...", ... }

# The hosted product doesn't have this endpoint, but the client will delegate
# this request to an API client for the regular API product behind the scenes.
{'fraction_non_alphanumeric': 0.12781561026715557, 'fraction_numerical': 0.011000523834468309, 'mean_word_length': 3.961038961038961, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6451024', 'n_tokens_mistral': 673, 'n_tokens_neox': 635, 'n_words': 205}