Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the Account Link resource #711

Merged
merged 1 commit into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ sudo: false
env:
global:
# If changing this number, please also change it in `test/test_helper.rb`.
- STRIPE_MOCK_VERSION=0.38.0
- STRIPE_MOCK_VERSION=0.39.0

cache:
directories:
Expand Down
1 change: 1 addition & 0 deletions lib/stripe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

# Named API resources
require "stripe/account"
require "stripe/account_link"
require "stripe/alipay_account"
require "stripe/apple_pay_domain"
require "stripe/application_fee"
Expand Down
9 changes: 9 additions & 0 deletions lib/stripe/account_link.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

module Stripe
class AccountLink < APIResource
extend Stripe::APIOperations::Create

OBJECT_NAME = "account_link".freeze
end
end
1 change: 1 addition & 0 deletions lib/stripe/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def self.object_classes # rubocop:disable Metrics/MethodLength

# business objects
Account::OBJECT_NAME => Account,
AccountLink::OBJECT_NAME => AccountLink,
AlipayAccount::OBJECT_NAME => AlipayAccount,
ApplePayDomain::OBJECT_NAME => ApplePayDomain,
ApplicationFee::OBJECT_NAME => ApplicationFee,
Expand Down
18 changes: 18 additions & 0 deletions test/stripe/account_link_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

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

module Stripe
class AccountLinkTest < Test::Unit::TestCase
should "be creatable" do
link = Stripe::AccountLink.create(
account: "acct_123",
failure_url: "https://stripe.com/failure",
success_url: "https://stripe.com/success",
type: "custom_account_verification"
)
assert_requested :post, "#{Stripe.api_base}/v1/account_links"
assert link.is_a?(Stripe::AccountLink)
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("../test_data", __FILE__)

# If changing this number, please also change it in `.travis.yml`.
MOCK_MINIMUM_VERSION = "0.38.0".freeze
MOCK_MINIMUM_VERSION = "0.39.0".freeze
MOCK_PORT = ENV["STRIPE_MOCK_PORT"] || 12_111

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