Sha256: 5eac2a5d8ea953e161fa4130d776769a3052b22dd0dcac2dff71b2aac8ffaf0d

Contents?: true

Size: 715 Bytes

Versions: 5

Compression:

Stored size: 715 Bytes

Contents

module CardsFactory

  def valid_card_params(params = {})
    {
      number: 0000111122223333,
      exp_month: 12,
      exp_year: 16,
      cvc: 111,
      name: 'John Tester',
      address_line1: '123 Elm Street',
      address_line2: 'Apt 2',
      address_city: 'Rochester',
      address_zip: 14605,
      address_state: 'NY',
      address_country: 'US',
      default: 'true'
    }.merge(params)
  end

  def create_card(params = {})
    advertiser_id = if params.has_key?(:advertiser_id)
      params.delete(:advertiser_id)
    else
      create_advertiser['id']
    end

    _params = valid_card_params(params)
    api_client.create_card(advertiser_id, _params)
  end

  def delete_all_cards
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
oi-api-ruby-0.1.5 spec/support/cards_factory.rb
oi-api-ruby-0.1.4 spec/support/cards_factory.rb
oi-api-ruby-0.1.3 spec/support/cards_factory.rb
oi-api-ruby-0.1.2 spec/support/cards_factory.rb
oi-api-ruby-0.1.1 spec/support/cards_factory.rb