test/test_helper.rb in active_merchant-epsilon-0.7.1 vs test/test_helper.rb in active_merchant-epsilon-0.8.0
- old
+ new
@@ -21,10 +21,12 @@
VCR.configure do |c|
c.cassette_library_dir = 'test/fixtures/vcr_cassettes'
c.hook_into :webmock
c.filter_sensitive_data('[CONTRACT_CODE]') { ENV['CONTRACT_CODE'] }
+ c.filter_sensitive_data('[GMO_ID]') { ENV['GMO_ID'] }
+ c.filter_sensitive_data('gmo_card_id=[GMO_CARD_ID]') { "gmo_card_id=#{ENV['GMO_CARD_ID']}" } # GMO CARD ID is not unique.
end
module SamplePaymentMethods
def valid_credit_card
ActiveMerchant::Billing::CreditCard.require_verification_value = false
@@ -174,9 +176,35 @@
ActiveMerchant::Billing::ConvenienceStore.new(
code: ActiveMerchant::Billing::ConvenienceStore::Code::LAWSON,
full_name_kana: 'ヤマダ タロウ',
phone_number: '0312345678901'
)
+ end
+
+ def valid_gmo_id_purchase_detail
+ {
+ user_id: "U#{Time.now.to_i}",
+ user_email: 'yamada-taro@example.com',
+ user_name: 'YAMADA TARO',
+ item_code: 'ITEM001',
+ item_name: 'Golden Product',
+ order_number: "O#{Time.now.to_i}",
+ gmo_id: ENV['GMO_ID'],
+ gmo_card_id: ENV['GMO_CARD_ID'],
+ }
+ end
+
+ def invalid_gmo_id_purchase_detail
+ {
+ user_id: "U#{Time.now.to_i}",
+ user_email: 'yamada-taro@example.com',
+ user_name: 'YAMADA TARO',
+ item_code: 'ITEM001',
+ item_name: 'Golden Product',
+ order_number: "O#{Time.now.to_i}",
+ gmo_id: ENV['GMO_ID'],
+ gmo_card_id: 'invail id',
+ }
end
def fixture_xml(filename, parse: true)
xml = File.read("test/fixtures/#{filename}")
parse ? Nokogiri.parse(xml.sub('x-sjis-cp932', 'CP932')) : xml