stripe 5.17.0 → 5.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.travis.yml +1 -1
 - data/CHANGELOG.md +3 -0
 - data/Gemfile +4 -1
 - data/VERSION +1 -1
 - data/lib/stripe/object_types.rb +1 -0
 - data/lib/stripe/resources.rb +1 -0
 - data/lib/stripe/resources/billing_portal/session.rb +11 -0
 - data/lib/stripe/version.rb +1 -1
 - data/test/stripe/billing_portal/session_test.rb +18 -0
 - data/test/stripe/issuing/card_test.rb +13 -1
 - data/test/stripe/issuing/dispute_test.rb +3 -13
 - data/test/test_helper.rb +1 -1
 - metadata +5 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: d22d41c56bb85d7b5712eaf36c274b8636f6a5a27b767d344d766ca59b6be4dc
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: ec876e8fcf530e645e4a26bd8dee1c635dee466248d31e7746c33aa4e6373c0e
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 69cdb2b0263d577512d77892a3229b4a8112ccd5c6eae8fb6d38510901981da05d93062dd514a6fa9976d54927f5208a6fdc8f5c2bf6f5db072eaac0089f66a0
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: c681fc11a7566635cdf094ad1bbe1c90db63887ed019d65a25f4eb52efe39411786c370c47403bd2b26f8d5df62f588ba951cf4d59bb12d6f4d3f02cda36a5cf
         
     | 
    
        data/.travis.yml
    CHANGED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,5 +1,8 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Changelog
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            ## 5.18.0 - 2020-04-22
         
     | 
| 
      
 4 
     | 
    
         
            +
            * [#911](https://github.com/stripe/stripe-ruby/pull/911) Add support for `BillingPortal` namespace and `Session` resource and APIs
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
       3 
6 
     | 
    
         
             
            ## 5.17.0 - 2020-02-26
         
     | 
| 
       4 
7 
     | 
    
         
             
            * [#907](https://github.com/stripe/stripe-ruby/pull/907) Add `StripeError#idempotent_replayed?`
         
     | 
| 
       5 
8 
     | 
    
         | 
    
        data/Gemfile
    CHANGED
    
    | 
         @@ -9,7 +9,10 @@ group :development do 
     | 
|
| 
       9 
9 
     | 
    
         
             
              gem "mocha", "~> 0.13.2"
         
     | 
| 
       10 
10 
     | 
    
         
             
              gem "rack", ">= 2.0.6"
         
     | 
| 
       11 
11 
     | 
    
         
             
              gem "rake"
         
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
              # Update to 2.0.0 once it ships.
         
     | 
| 
      
 14 
     | 
    
         
            +
              gem "shoulda-context", "2.0.0.rc4"
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
       13 
16 
     | 
    
         
             
              gem "test-unit"
         
     | 
| 
       14 
17 
     | 
    
         | 
| 
       15 
18 
     | 
    
         
             
              # Version doesn't matter that much, but this one contains some fixes for Ruby
         
     | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            5. 
     | 
| 
      
 1 
     | 
    
         
            +
            5.18.0
         
     | 
    
        data/lib/stripe/object_types.rb
    CHANGED
    
    | 
         @@ -19,6 +19,7 @@ module Stripe 
     | 
|
| 
       19 
19 
     | 
    
         
             
                    Balance::OBJECT_NAME => Balance,
         
     | 
| 
       20 
20 
     | 
    
         
             
                    BalanceTransaction::OBJECT_NAME => BalanceTransaction,
         
     | 
| 
       21 
21 
     | 
    
         
             
                    BankAccount::OBJECT_NAME => BankAccount,
         
     | 
| 
      
 22 
     | 
    
         
            +
                    BillingPortal::Session::OBJECT_NAME => BillingPortal::Session,
         
     | 
| 
       22 
23 
     | 
    
         
             
                    BitcoinReceiver::OBJECT_NAME => BitcoinReceiver,
         
     | 
| 
       23 
24 
     | 
    
         
             
                    BitcoinTransaction::OBJECT_NAME => BitcoinTransaction,
         
     | 
| 
       24 
25 
     | 
    
         
             
                    Capability::OBJECT_NAME => Capability,
         
     | 
    
        data/lib/stripe/resources.rb
    CHANGED
    
    | 
         @@ -9,6 +9,7 @@ require "stripe/resources/application_fee_refund" 
     | 
|
| 
       9 
9 
     | 
    
         
             
            require "stripe/resources/balance"
         
     | 
| 
       10 
10 
     | 
    
         
             
            require "stripe/resources/balance_transaction"
         
     | 
| 
       11 
11 
     | 
    
         
             
            require "stripe/resources/bank_account"
         
     | 
| 
      
 12 
     | 
    
         
            +
            require "stripe/resources/billing_portal/session"
         
     | 
| 
       12 
13 
     | 
    
         
             
            require "stripe/resources/bitcoin_receiver"
         
     | 
| 
       13 
14 
     | 
    
         
             
            require "stripe/resources/bitcoin_transaction"
         
     | 
| 
       14 
15 
     | 
    
         
             
            require "stripe/resources/capability"
         
     | 
    
        data/lib/stripe/version.rb
    CHANGED
    
    
| 
         @@ -0,0 +1,18 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # frozen_string_literal: true
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require ::File.expand_path("../../test_helper", __dir__)
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            module Stripe
         
     | 
| 
      
 6 
     | 
    
         
            +
              module BillingPortal
         
     | 
| 
      
 7 
     | 
    
         
            +
                class SessionTest < Test::Unit::TestCase
         
     | 
| 
      
 8 
     | 
    
         
            +
                  should "be creatable" do
         
     | 
| 
      
 9 
     | 
    
         
            +
                    session = Stripe::BillingPortal::Session.create(
         
     | 
| 
      
 10 
     | 
    
         
            +
                      customer: "cus_123",
         
     | 
| 
      
 11 
     | 
    
         
            +
                      return_url: "https://stripe.com/return"
         
     | 
| 
      
 12 
     | 
    
         
            +
                    )
         
     | 
| 
      
 13 
     | 
    
         
            +
                    assert_requested :post, "#{Stripe.api_base}/v1/billing_portal/sessions"
         
     | 
| 
      
 14 
     | 
    
         
            +
                    assert session.is_a?(Stripe::BillingPortal::Session)
         
     | 
| 
      
 15 
     | 
    
         
            +
                  end
         
     | 
| 
      
 16 
     | 
    
         
            +
                end
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -43,6 +43,10 @@ module Stripe 
     | 
|
| 
       43 
43 
     | 
    
         | 
| 
       44 
44 
     | 
    
         
             
                  context "#details" do
         
     | 
| 
       45 
45 
     | 
    
         
             
                    should "retrieve a card's details" do
         
     | 
| 
      
 46 
     | 
    
         
            +
                      # The /details endpoint is deprecated and not in the spec so we mock
         
     | 
| 
      
 47 
     | 
    
         
            +
                      stub_request(:get, "#{Stripe.api_base}/v1/issuing/cards/ic_123/details")
         
     | 
| 
      
 48 
     | 
    
         
            +
                        .to_return(body: JSON.generate(object: "issuing.card_details"))
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
       46 
50 
     | 
    
         
             
                      card_details = Stripe::Issuing::Card.details("ic_123")
         
     | 
| 
       47 
51 
     | 
    
         
             
                      assert_requested :get, "#{Stripe.api_base}/v1/issuing/cards/ic_123/details"
         
     | 
| 
       48 
52 
     | 
    
         
             
                      assert card_details.is_a?(Stripe::Issuing::CardDetails)
         
     | 
| 
         @@ -51,8 +55,16 @@ module Stripe 
     | 
|
| 
       51 
55 
     | 
    
         | 
| 
       52 
56 
     | 
    
         
             
                  context ".details" do
         
     | 
| 
       53 
57 
     | 
    
         
             
                    should "retrieve a card's details" do
         
     | 
| 
       54 
     | 
    
         
            -
                       
     | 
| 
      
 58 
     | 
    
         
            +
                      # The /details endpoint is deprecated and not in the spec so we mock
         
     | 
| 
      
 59 
     | 
    
         
            +
                      stub_request(:get, "#{Stripe.api_base}/v1/issuing/cards/ic_123/details")
         
     | 
| 
      
 60 
     | 
    
         
            +
                        .to_return(body: JSON.generate(object: "issuing.card_details"))
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
                      card = Stripe::Issuing::Card.construct_from(
         
     | 
| 
      
 63 
     | 
    
         
            +
                        id: "ic_123",
         
     | 
| 
      
 64 
     | 
    
         
            +
                        object: "issuing.card_details"
         
     | 
| 
      
 65 
     | 
    
         
            +
                      )
         
     | 
| 
       55 
66 
     | 
    
         
             
                      card_details = card.details
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
       56 
68 
     | 
    
         
             
                      assert_requested :get, "#{Stripe.api_base}/v1/issuing/cards/ic_123/details"
         
     | 
| 
       57 
69 
     | 
    
         
             
                      assert card_details.is_a?(Stripe::Issuing::CardDetails)
         
     | 
| 
       58 
70 
     | 
    
         
             
                    end
         
     | 
| 
         @@ -6,10 +6,8 @@ module Stripe 
     | 
|
| 
       6 
6 
     | 
    
         
             
              module Issuing
         
     | 
| 
       7 
7 
     | 
    
         
             
                class DisputeTest < Test::Unit::TestCase
         
     | 
| 
       8 
8 
     | 
    
         
             
                  should "be creatable" do
         
     | 
| 
       9 
     | 
    
         
            -
                    dispute = Stripe::Issuing::Dispute.create 
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
                      disputed_transaction: "ipi_123"
         
     | 
| 
       12 
     | 
    
         
            -
                    )
         
     | 
| 
      
 9 
     | 
    
         
            +
                    dispute = Stripe::Issuing::Dispute.create
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
       13 
11 
     | 
    
         
             
                    assert_requested :post, "#{Stripe.api_base}/v1/issuing/disputes"
         
     | 
| 
       14 
12 
     | 
    
         
             
                    assert dispute.is_a?(Stripe::Issuing::Dispute)
         
     | 
| 
       15 
13 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -27,16 +25,8 @@ module Stripe 
     | 
|
| 
       27 
25 
     | 
    
         
             
                    assert dispute.is_a?(Stripe::Issuing::Dispute)
         
     | 
| 
       28 
26 
     | 
    
         
             
                  end
         
     | 
| 
       29 
27 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
                  should "be saveable" do
         
     | 
| 
       31 
     | 
    
         
            -
                    dispute = Stripe::Issuing::Dispute.retrieve("ich_123")
         
     | 
| 
       32 
     | 
    
         
            -
                    dispute.metadata["key"] = "value"
         
     | 
| 
       33 
     | 
    
         
            -
                    dispute.save
         
     | 
| 
       34 
     | 
    
         
            -
                    assert_requested :post, "#{Stripe.api_base}/v1/issuing/disputes/#{dispute.id}"
         
     | 
| 
       35 
     | 
    
         
            -
                    assert dispute.is_a?(Stripe::Issuing::Dispute)
         
     | 
| 
       36 
     | 
    
         
            -
                  end
         
     | 
| 
       37 
     | 
    
         
            -
             
     | 
| 
       38 
28 
     | 
    
         
             
                  should "be updateable" do
         
     | 
| 
       39 
     | 
    
         
            -
                    dispute = Stripe::Issuing::Dispute.update("ich_123",  
     | 
| 
      
 29 
     | 
    
         
            +
                    dispute = Stripe::Issuing::Dispute.update("ich_123", {})
         
     | 
| 
       40 
30 
     | 
    
         
             
                    assert_requested :post, "#{Stripe.api_base}/v1/issuing/disputes/ich_123"
         
     | 
| 
       41 
31 
     | 
    
         
             
                    assert dispute.is_a?(Stripe::Issuing::Dispute)
         
     | 
| 
       42 
32 
     | 
    
         
             
                  end
         
     | 
    
        data/test/test_helper.rb
    CHANGED
    
    | 
         @@ -16,7 +16,7 @@ require ::File.expand_path("test_data", __dir__) 
     | 
|
| 
       16 
16 
     | 
    
         
             
            require ::File.expand_path("stripe_mock", __dir__)
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
            # If changing this number, please also change it in `.travis.yml`.
         
     | 
| 
       19 
     | 
    
         
            -
            MOCK_MINIMUM_VERSION = "0. 
     | 
| 
      
 19 
     | 
    
         
            +
            MOCK_MINIMUM_VERSION = "0.88.0"
         
     | 
| 
       20 
20 
     | 
    
         
             
            MOCK_PORT = Stripe::StripeMock.start
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
            # Disable all real network connections except those that are outgoing to
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: stripe
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 5. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 5.18.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Stripe
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2020- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2020-04-22 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: Stripe is the easiest way to accept payments online.  See https://stripe.com
         
     | 
| 
       14 
14 
     | 
    
         
             
              for details.
         
     | 
| 
         @@ -64,6 +64,7 @@ files: 
     | 
|
| 
       64 
64 
     | 
    
         
             
            - lib/stripe/resources/balance.rb
         
     | 
| 
       65 
65 
     | 
    
         
             
            - lib/stripe/resources/balance_transaction.rb
         
     | 
| 
       66 
66 
     | 
    
         
             
            - lib/stripe/resources/bank_account.rb
         
     | 
| 
      
 67 
     | 
    
         
            +
            - lib/stripe/resources/billing_portal/session.rb
         
     | 
| 
       67 
68 
     | 
    
         
             
            - lib/stripe/resources/bitcoin_receiver.rb
         
     | 
| 
       68 
69 
     | 
    
         
             
            - lib/stripe/resources/bitcoin_transaction.rb
         
     | 
| 
       69 
70 
     | 
    
         
             
            - lib/stripe/resources/capability.rb
         
     | 
| 
         @@ -152,6 +153,7 @@ files: 
     | 
|
| 
       152 
153 
     | 
    
         
             
            - test/stripe/balance_test.rb
         
     | 
| 
       153 
154 
     | 
    
         
             
            - test/stripe/balance_transaction_test.rb
         
     | 
| 
       154 
155 
     | 
    
         
             
            - test/stripe/bank_account_test.rb
         
     | 
| 
      
 156 
     | 
    
         
            +
            - test/stripe/billing_portal/session_test.rb
         
     | 
| 
       155 
157 
     | 
    
         
             
            - test/stripe/capability_test.rb
         
     | 
| 
       156 
158 
     | 
    
         
             
            - test/stripe/charge_test.rb
         
     | 
| 
       157 
159 
     | 
    
         
             
            - test/stripe/checkout/session_test.rb
         
     | 
| 
         @@ -267,6 +269,7 @@ test_files: 
     | 
|
| 
       267 
269 
     | 
    
         
             
            - test/stripe/balance_test.rb
         
     | 
| 
       268 
270 
     | 
    
         
             
            - test/stripe/balance_transaction_test.rb
         
     | 
| 
       269 
271 
     | 
    
         
             
            - test/stripe/bank_account_test.rb
         
     | 
| 
      
 272 
     | 
    
         
            +
            - test/stripe/billing_portal/session_test.rb
         
     | 
| 
       270 
273 
     | 
    
         
             
            - test/stripe/capability_test.rb
         
     | 
| 
       271 
274 
     | 
    
         
             
            - test/stripe/charge_test.rb
         
     | 
| 
       272 
275 
     | 
    
         
             
            - test/stripe/checkout/session_test.rb
         
     |