Sha256: 30c3786b42bbd427f6b0d1468418520b0ed78691d712851961f66e38aa31cd33

Contents?: true

Size: 1.77 KB

Versions: 52

Compression:

Stored size: 1.77 KB

Contents

# frozen_string_literal: true

require ::File.expand_path("../test_helper", __dir__)

module Stripe
  class ApplicationFeeTest < Test::Unit::TestCase
    should "be listable" do
      fees = Stripe::ApplicationFee.list
      assert_requested :get, "#{Stripe.api_base}/v1/application_fees"
      assert fees.data.is_a?(Array)
      assert fees.data[0].is_a?(Stripe::ApplicationFee)
    end

    context "#create_refund" do
      should "create a refund" do
        refund = Stripe::ApplicationFee.create_refund(
          "fee_123"
        )
        assert_requested :post, "#{Stripe.api_base}/v1/application_fees/fee_123/refunds"
        assert refund.is_a?(Stripe::ApplicationFeeRefund)
      end
    end

    context "#retrieve_refund" do
      should "retrieve a refund" do
        refund = Stripe::ApplicationFee.retrieve_refund(
          "fee_123",
          "fr_123"
        )
        assert_requested :get, "#{Stripe.api_base}/v1/application_fees/fee_123/refunds/fr_123"
        assert refund.is_a?(Stripe::ApplicationFeeRefund)
      end
    end

    context "#update_refund" do
      should "update a refund" do
        refund = Stripe::ApplicationFee.update_refund(
          "fee_123",
          "fr_123",
          metadata: { foo: "bar" }
        )
        assert_requested :post, "#{Stripe.api_base}/v1/application_fees/fee_123/refunds/fr_123"
        assert refund.is_a?(Stripe::ApplicationFeeRefund)
      end
    end

    context "#list_refunds" do
      should "list the application fee's refuns" do
        refunds = Stripe::ApplicationFee.list_refunds(
          "fee_123"
        )
        assert_requested :get, "#{Stripe.api_base}/v1/application_fees/fee_123/refunds"
        assert refunds.is_a?(Stripe::ListObject)
        assert refunds.data.is_a?(Array)
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
stripe-5.31.0 test/stripe/application_fee_test.rb
stripe-5.30.0 test/stripe/application_fee_test.rb
stripe-5.29.1 test/stripe/application_fee_test.rb
stripe-5.29.0 test/stripe/application_fee_test.rb
stripe-5.28.0 test/stripe/application_fee_test.rb
stripe-5.27.0 test/stripe/application_fee_test.rb
stripe-5.26.0 test/stripe/application_fee_test.rb
stripe-5.25.0 test/stripe/application_fee_test.rb
stripe-5.24.0 test/stripe/application_fee_test.rb
stripe-5.23.1 test/stripe/application_fee_test.rb
stripe-5.23.0 test/stripe/application_fee_test.rb
stripe-5.22.0 test/stripe/application_fee_test.rb
stripe-5.21.0 test/stripe/application_fee_test.rb
stripe-5.20.0 test/stripe/application_fee_test.rb
stripe-5.19.0 test/stripe/application_fee_test.rb
stripe-5.18.0 test/stripe/application_fee_test.rb
stripe-5.17.0 test/stripe/application_fee_test.rb
stripe-5.16.0 test/stripe/application_fee_test.rb
stripe-5.15.0 test/stripe/application_fee_test.rb
stripe-5.14.0 test/stripe/application_fee_test.rb