Skip to content

Commit

Permalink
Add support for Mandate (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-stripe authored Nov 6, 2019
1 parent 93ea15f commit 6b4a034
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sudo: false
env:
global:
# If changing this number, please also change it in `test/test_helper.rb`.
- STRIPE_MOCK_VERSION=0.63.0
- STRIPE_MOCK_VERSION=0.72.0

cache:
directories:
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def self.object_names_to_classes
Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
LoginLink::OBJECT_NAME => LoginLink,
Mandate::OBJECT_NAME => Mandate,
Order::OBJECT_NAME => Order,
OrderReturn::OBJECT_NAME => OrderReturn,
PaymentIntent::OBJECT_NAME => PaymentIntent,
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
require "stripe/resources/issuing/dispute"
require "stripe/resources/issuing/transaction"
require "stripe/resources/login_link"
require "stripe/resources/mandate"
require "stripe/resources/order"
require "stripe/resources/order_return"
require "stripe/resources/payment_intent"
Expand Down
7 changes: 7 additions & 0 deletions lib/stripe/resources/mandate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

module Stripe
class Mandate < APIResource
OBJECT_NAME = "mandate"
end
end
14 changes: 14 additions & 0 deletions test/stripe/mandate_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

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

module Stripe
class MandateTest < Test::Unit::TestCase
should "be retrievable" do
schedule = Stripe::Mandate.retrieve("mandate_123")
assert_requested :get,
"#{Stripe.api_base}/v1/mandates/mandate_123"
assert schedule.is_a?(Stripe::Mandate)
end
end
end
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
require ::File.expand_path("stripe_mock", __dir__)

# If changing this number, please also change it in `.travis.yml`.
MOCK_MINIMUM_VERSION = "0.63.0"
MOCK_MINIMUM_VERSION = "0.72.0"
MOCK_PORT = Stripe::StripeMock.start

# Disable all real network connections except those that are outgoing to
Expand Down

0 comments on commit 6b4a034

Please sign in to comment.