Sha256: 79a3fe2d3fbdab92e6d650caaba1cb9bed9fd62c2fbc9836a43a52d2ef6a839e

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

require 'test_helper'

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

3 entries across 3 versions & 1 rubygems

Version Path
adyen-2.0.0 test/functional/payment_modification_api_test.rb
adyen-2.0.0.pre2 test/functional/payment_modification_api_test.rb
adyen-2.0.0.pre1 test/functional/payment_modification_api_test.rb