|
|
@@ -4,7 +4,13 @@ require 'bigdecimal'
|
|
|
|
|
|
class PaymentTest < Minitest::Test
|
|
|
def setup
|
|
|
- excluded_files = ["base.rb", "errors.rb", "paratika_gateway.rb", "test_cards.rb", "test_cards", "version.rb"]
|
|
|
+ Paratika.configure do |config|
|
|
|
+ config.merchant_id = '10002036'
|
|
|
+ config.merchant_user = 'paytentest@akillibulut.net'
|
|
|
+ config.merchant_password = '3mzVyRKuwnttqRC.'
|
|
|
+ config.url = 'https://entegrasyon.paratika.com.tr'
|
|
|
+ end
|
|
|
+ excluded_files = ["base.rb", "errors.rb", "test_cards.rb", "test_cards", "version.rb"]
|
|
|
@modules = (Dir.children("lib/payment") - excluded_files).map { |file| "Payment::#{file.split(".")[0].camelcase}" }
|
|
|
@mandatory_methods = %w(charge_from_card cancel_transaction refund_money query_saved_cards delete_card currency_exchange)
|
|
|
@customer = { id: 'c1', name: 'John Doe', email: 'test@example.com', phone: '905531781020', ip: '7.11.7.11' }
|
|
|
@@ -29,7 +35,6 @@ class PaymentTest < Minitest::Test
|
|
|
|
|
|
def test_pre_auth_method_is_responding_hash
|
|
|
@modules.each do |module_name|
|
|
|
- binding.irb
|
|
|
request, response = module_name.constantize.try(:charge_from_card, @payment, @customer, @card, true, false)
|
|
|
check_response(response, module_name)
|
|
|
assert_equal @new_result_keys.all? { |s| response.key? s.to_sym }, true, "return value must contain all of the following keys: #{@new_result_keys}"
|