<commit_before># White Ruby

White makes accepting payments in the Middle East ridiculously easy. Sign up for an account at [whitepayments.com](http://whitepayments.com).

## Getting Started

Using White with your Ruby project is simple. If you're using [bundler](http://bundler.io) (and really, who isn't these days amirite?), you just need to add one line to your `Gemfile`:

```ruby
gem 'white_payments', require: 'white'
```

Now, running `bundle install` will pull the library directly to your local project.

## Using White

You'll need an account with White if you don't already have one (grab one real quick at [whitepayments.com](http://whitepayments.com) and come back .. we'll wait).

Got an account? Great .. let's get busy.

### 1. Initializing White

To get started, you'll need to initialize White with your secret API key. Here's how that looks (we're using a test key, so no real money will be exchanging hands):

```ruby
require 'white'

White.api_key = "test_sec_k_25dd497d7e657bb761ad6"
```

That's it! You probably want to do something with the White object though -- it gets really bored when it doesn't have anything to do. 

Let's run a transaction, shall we.

### 2. Processing a transaction through White

Now, for the fun part. Here's all the code you need to process a transaction with White:

```ruby
White::Charge.create(
    :amount => 5,
    :currency => "aed",
    :card => {
      :number => "4242424242424242",
      :exp_month => 11,
      :exp_year => 2016,
      :cvv => 123
    },
    :description => "Charge for <EMAIL>"
  )
```

This transaction should be successful since we used the `4242 4242 4242 4242` test credit card. For a complete list of test cards, and their expected output you can check out this link [here](https://whitepayments.com/docs/testing/).<commit_msg>Add email param<commit_after># White Ruby

White makes accepting payments in the Middle East ridiculously easy. Sign up for an account at [whitepayments.com](http://whitepayments.com).

## Getting Started

Using White with your Ruby project is simple. If you're using [bundler](http://bundler.io) (and really, who isn't these days amirite?), you just need to add one line to your `Gemfile`:

```ruby
gem 'white_payments', require: 'white'
```

Now, running `bundle install` will pull the library directly to your local project.

## Using White

You'll need an account with White if you don't already have one (grab one real quick at [whitepayments.com](http://whitepayments.com) and come back .. we'll wait).

Got an account? Great .. let's get busy.

### 1. Initializing White

To get started, you'll need to initialize White with your secret API key. Here's how that looks (we're using a test key, so no real money will be exchanging hands):

```ruby
require 'white'

White.api_key = "test_sec_k_25dd497d7e657bb761ad6"
```

That's it! You probably want to do something with the White object though -- it gets really bored when it doesn't have anything to do. 

Let's run a transaction, shall we.

### 2. Processing a transaction through White

Now, for the fun part. Here's all the code you need to process a transaction with White:

```ruby
White::Charge.create(
    :amount => 5,
    :currency => "aed",
    :email => "<EMAIL>",
    :card => {
      :number => "4242424242424242",
      :exp_month => 11,
      :exp_year => 2016,
      :cvv => 123
    },
    :description => "2kg of lizard tails, non-refundable"
  )
```

This transaction should be successful since we used the `4242 4242 4242 4242` test credit card. For a complete list of test cards, and their expected output you can check out this link [here](https://whitepayments.com/docs/testing/).
{'fraction_non_alphanumeric': 0.10288513881328253, 'fraction_numerical': 0.03130103429504627, 'mean_word_length': 3.8804780876494025, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, 'https://': 2, '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': '693171', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1081, 'n_words': 495}