mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-08 00:02:46 -04:00
Merge pull request #711 from stripe/remi-add-account-links
Add support for the Account Link resource
This commit is contained in:
commit
ab17913243
@ -17,7 +17,7 @@ sudo: false
|
|||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
# If changing this number, please also change it in `test/test_helper.rb`.
|
# 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:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
|
@ -37,6 +37,7 @@ require "stripe/webhook"
|
|||||||
|
|
||||||
# Named API resources
|
# Named API resources
|
||||||
require "stripe/account"
|
require "stripe/account"
|
||||||
|
require "stripe/account_link"
|
||||||
require "stripe/alipay_account"
|
require "stripe/alipay_account"
|
||||||
require "stripe/apple_pay_domain"
|
require "stripe/apple_pay_domain"
|
||||||
require "stripe/application_fee"
|
require "stripe/application_fee"
|
||||||
|
9
lib/stripe/account_link.rb
Normal file
9
lib/stripe/account_link.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
module Stripe
|
||||||
|
class AccountLink < APIResource
|
||||||
|
extend Stripe::APIOperations::Create
|
||||||
|
|
||||||
|
OBJECT_NAME = "account_link".freeze
|
||||||
|
end
|
||||||
|
end
|
@ -46,6 +46,7 @@ module Stripe
|
|||||||
|
|
||||||
# business objects
|
# business objects
|
||||||
Account::OBJECT_NAME => Account,
|
Account::OBJECT_NAME => Account,
|
||||||
|
AccountLink::OBJECT_NAME => AccountLink,
|
||||||
AlipayAccount::OBJECT_NAME => AlipayAccount,
|
AlipayAccount::OBJECT_NAME => AlipayAccount,
|
||||||
ApplePayDomain::OBJECT_NAME => ApplePayDomain,
|
ApplePayDomain::OBJECT_NAME => ApplePayDomain,
|
||||||
ApplicationFee::OBJECT_NAME => ApplicationFee,
|
ApplicationFee::OBJECT_NAME => ApplicationFee,
|
||||||
|
18
test/stripe/account_link_test.rb
Normal file
18
test/stripe/account_link_test.rb
Normal file
@ -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
|
@ -16,7 +16,7 @@ PROJECT_ROOT = ::File.expand_path("../../", __FILE__)
|
|||||||
require ::File.expand_path("../test_data", __FILE__)
|
require ::File.expand_path("../test_data", __FILE__)
|
||||||
|
|
||||||
# If changing this number, please also change it in `.travis.yml`.
|
# 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
|
MOCK_PORT = ENV["STRIPE_MOCK_PORT"] || 12_111
|
||||||
|
|
||||||
# Disable all real network connections except those that are outgoing to
|
# Disable all real network connections except those that are outgoing to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user