Skip to content

Commit

Permalink
Add support for radar.early_fraud_warning resource (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
ob-stripe authored May 24, 2019
1 parent f6d4910 commit f68fb25
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/stripe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
require "stripe/person"
require "stripe/plan"
require "stripe/product"
require "stripe/radar/early_fraud_warning"
require "stripe/radar/value_list"
require "stripe/radar/value_list_item"
require "stripe/recipient"
Expand Down
11 changes: 11 additions & 0 deletions lib/stripe/radar/early_fraud_warning.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

module Stripe
module Radar
class EarlyFraudWarning < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "radar.early_fraud_warning".freeze
end
end
end
1 change: 1 addition & 0 deletions lib/stripe/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def self.object_classes # rubocop:disable Metrics/MethodLength
Person::OBJECT_NAME => Person,
Plan::OBJECT_NAME => Plan,
Product::OBJECT_NAME => Product,
Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
Radar::ValueList::OBJECT_NAME => Radar::ValueList,
Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
Recipient::OBJECT_NAME => Recipient,
Expand Down
22 changes: 22 additions & 0 deletions test/stripe/radar/early_fraud_warning_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

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

module Stripe
module Radar
class EarlyFraudWarningTest < Test::Unit::TestCase
should "be listable" do
warnings = Stripe::Radar::EarlyFraudWarning.list
assert_requested :get, "#{Stripe.api_base}/v1/radar/early_fraud_warnings"
assert warnings.data.is_a?(Array)
assert warnings.data[0].is_a?(Stripe::Radar::EarlyFraudWarning)
end

should "be retrievable" do
warning = Stripe::Radar::EarlyFraudWarning.retrieve("issfr_123")
assert_requested :get, "#{Stripe.api_base}/v1/radar/early_fraud_warnings/issfr_123"
assert warning.is_a?(Stripe::Radar::EarlyFraudWarning)
end
end
end
end

0 comments on commit f68fb25

Please sign in to comment.