Skip to content

Commit

Permalink
Moved remote test credentials to fixtures.yml
Browse files Browse the repository at this point in the history
Closes #199.
  • Loading branch information
tuomasb authored and Tim Beiko committed Jun 29, 2016
1 parent bb26fe5 commit 62a1f83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions test/fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ certo_direct:
login: 1
password: vP6OwK3

# Fully working credentials
checkout_finland:
merchant: '375917'
secret: 'SAIPPUAKAUPPIAS'

conekta:
key: key_eYvWV7gSDkNYXsmr

Expand Down
10 changes: 4 additions & 6 deletions test/remote/remote_checkout_finland_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ class RemoteCheckoutFinlandTest < Test::Unit::TestCase
def setup
@stamp = Time.now.to_i.to_s # Unique identifier for the payment with all information
@stamp2 = (Time.now.to_i+1000).to_s # Unique identifier for the payment with minimal information
@amount = "200" # Amount in cents
@currency = "EUR" # Currency code
@credential = "375917" # Account number
@credential2 = "SAIPPUAKAUPPIAS" # Account secret
@merchant = fixtures(:checkout_finland)[:merchant]
@secret = fixtures(:checkout_finland)[:secret]
end

def test_valid_payment_page_minimal_fields
payment_page = submit %(
<% payment_service_for('#{@stamp}', '#{@credential}', :service => :checkout_finland, :amount => #{@amount}, :currency => '#{@currency}',:credential2 => '#{@credential2}') do |service| %>
<% payment_service_for('#{@stamp}', '#{@merchant}', :service => :checkout_finland, :amount => '200', :currency => 'EUR', :credential2 => '#{@secret}') do |service| %>
<% service.language = 'FI' %> # Payment page language 2 character ISO code.
<% service.reference = '123123123' %> # Payment reference number. 20 digits max.
<% service.content = '1' %> # '1' for normal and '2' for adult payments.
Expand All @@ -34,7 +32,7 @@ def test_valid_payment_page_minimal_fields

def test_valid_payment_page_all_fields
payment_page = submit %(
<% payment_service_for('#{@stamp2}', '#{@credential}', :service => :checkout_finland, :amount => #{@amount}, :currency => '#{@currency}',:credential2 => '#{@credential2}') do |service| %>
<% payment_service_for('#{@stamp2}', '#{@merchant}', :service => :checkout_finland, :amount => '200', :currency => 'EUR',:credential2 => '#{@secret}') do |service| %>
<% service.customer :first_name => "Tero", # Optional customer information
:last_name => 'Testaaja',
:phone => '0800 552 010',
Expand Down

0 comments on commit 62a1f83

Please sign in to comment.