Sha256: aa75132f4311e331f3fb0051cab16ccca61b9acc2b1c43f53327d5083d075ecb

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

module PayuLatamHelper
  def setup_payu_latam_gateway
    Solidus::Gateway::PayuLatamGateway.create!(
      name: 'Payu Latam',
      preferred_merchant_id: '508029',
      preferred_account_id: '512323',
      preferred_api_login: 'pRRXKOl8ikMmt9u',
      preferred_api_key: '4Vj8eK4rloUd272L48hsrarnUA'
    )
  end

  def fill_credit_card(number, document)
    fill_in 'Card Number', with: number, visible: false
    # Otherwise ccType field does not get updated correctly
    page.execute_script("$('.cardNumber').trigger('change')")
    fill_in 'Card Code', with: '123'
    fill_in 'Expiration', with: "01 / #{Time.now.year + 1}"
    fill_in 'customer_document', with: document
  end

  def fill_address(country)
    fill_in 'First Name', with: 'APPROVED'
    fill_in 'Last Name', with: '.'
    fill_in 'Street Address', with: 'YT-1300'
    fill_in 'City', with: 'Mos Eisley'
    select 'United States of America', from: 'Country'
    select country.states.first, from: 'order_bill_address_attributes_state_id'
    fill_in 'Zip', with: '12010'
    fill_in 'Phone', with: '(555) 555-5555'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_payu_latam-0.0.2 spec/support/payu_latam_helper.rb