Sha256: 573508c282814bd61e0b7cfa7d437a3e3aa0356a4165335c10b236cfb7369e4c

Contents?: true

Size: 1.46 KB

Versions: 4

Compression:

Stored size: 1.46 KB

Contents

require 'test_helper'
require 'adyen/rest'

class PaymentModificationAPITest < Minitest::Test
  def setup
    @client = Adyen::REST.client
  end

  def teardown
    @client.close
  end

  def test_capture_payment_api_request
    response = @client.capture_payment(
      merchant_account: 'VanBergenORG',
      modification_amount: { currency: 'EUR', value: 1234 },
      reference: "functional test for cancellation",
      original_reference: 7913939284323855
    )

    assert response.received?
    assert response.psp_reference
  end

  def test_cancel_payment_api_request
    response = @client.cancel_payment(
      merchant_account: 'VanBergenORG',
      reference: "functional test for cancellation",
      original_reference: 7913939284323855
    )

    assert response.received?
    assert response.psp_reference
  end

  def test_refund_payment_api_request
    response = @client.refund_payment(
      merchant_account: 'VanBergenORG',
      modification_amount: { currency: 'EUR', value: 1234 },
      reference: "functional test for cancellation",
      original_reference: 7913939284323855
    )

    assert response.received?
    assert response.psp_reference
  end

  def test_cancel_or_refund_payment_api_request
    response = @client.cancel_or_refund_payment(
      merchant_account: 'VanBergenORG',
      reference: "functional test for cancellation",
      original_reference: 7913939284323855
    )

    assert response.received?
    assert response.psp_reference
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
adyen-2.4.0 test/functional/payment_modification_api_test.rb
adyen-2.3.0 test/functional/payment_modification_api_test.rb
adyen-2.2.0 test/functional/payment_modification_api_test.rb
adyen-2.1.0 test/functional/payment_modification_api_test.rb