Sha256: 6bb6cc5ae6bde97d8b45b89c16f5a11f986978fd622c77b69b89a434bcd889a3

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

require 'test_helper'

class AdyenHelperTest < Test::Unit::TestCase
  include ActiveMerchant::Billing::Integrations

  def setup
    @helper = Adyen::Helper.new('order-500','cody@example.com', :amount => 500, :currency => 'USD')
  end

  def test_basic_helper_fields
    assert_field 'merchantAccount',   'cody@example.com'
    assert_field 'paymentAmount',     '500'
    assert_field 'merchantReference', 'order-500'
  end

  def test_customer_fields
    @helper.customer :email => 'cody@example.com'
    assert_field 'shopperEmail', 'cody@example.com'
  end

  def test_address_mapping
    @helper.billing_address :address1 => '1 My Street',
                            :address2 => '',
                            :city => 'Leeds',
                            :state => 'Yorkshire',
                            :zip => 'LS2 7EE',
                            :country  => 'CA'

    assert_field 'billingAddress.street',          '1 My Street'
    assert_field 'billingAddress.city',            'Leeds'
    assert_field 'billingAddress.stateOrProvince', 'Yorkshire'
    assert_field 'billingAddress.postalCode',      'LS2 7EE'
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activemerchant-est-1.4.2.6 test/unit/integrations/helpers/adyen_helper_test.rb
activemerchant-est-1.4.2.5 test/unit/integrations/helpers/adyen_helper_test.rb