stripe 10.11.0 → 10.12.0.pre.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +292 -48
- data/OPENAPI_VERSION +1 -1
- data/README.md +11 -0
- data/VERSION +1 -1
- data/lib/stripe/api_operations/request.rb +2 -1
- data/lib/stripe/api_version.rb +1 -0
- data/lib/stripe/object_types.rb +22 -0
- data/lib/stripe/request_signing_authenticator.rb +79 -0
- data/lib/stripe/resources/account.rb +69 -69
- data/lib/stripe/resources/account_notice.rb +32 -0
- data/lib/stripe/resources/apple_pay_domain.rb +4 -4
- data/lib/stripe/resources/apps/secret.rb +5 -5
- data/lib/stripe/resources/capital/financing_offer.rb +49 -0
- data/lib/stripe/resources/capital/financing_summary.rb +15 -0
- data/lib/stripe/resources/capital/financing_transaction.rb +27 -0
- data/lib/stripe/resources/checkout/session.rb +21 -21
- data/lib/stripe/resources/confirmation_token.rb +16 -0
- data/lib/stripe/resources/credit_note.rb +35 -35
- data/lib/stripe/resources/customer.rb +66 -55
- data/lib/stripe/resources/customer_entitlement.rb +12 -0
- data/lib/stripe/resources/customer_entitlement_summary.rb +12 -0
- data/lib/stripe/resources/entitlements/feature.rb +38 -0
- data/lib/stripe/resources/ephemeral_key.rb +9 -9
- data/lib/stripe/resources/file.rb +5 -5
- data/lib/stripe/resources/financial_connections/account.rb +37 -34
- data/lib/stripe/resources/financial_connections/account_inferred_balance.rb +14 -0
- data/lib/stripe/resources/gift_cards/card.rb +59 -0
- data/lib/stripe/resources/gift_cards/transaction.rb +93 -0
- data/lib/stripe/resources/identity/verification_session.rb +38 -38
- data/lib/stripe/resources/invoice.rb +113 -60
- data/lib/stripe/resources/invoice_payment.rb +12 -0
- data/lib/stripe/resources/issuing/authorization.rb +8 -8
- data/lib/stripe/resources/issuing/credit_underwriting_record.rb +88 -0
- data/lib/stripe/resources/issuing/dispute.rb +16 -16
- data/lib/stripe/resources/issuing/personalization_design.rb +119 -0
- data/lib/stripe/resources/issuing/physical_bundle.rb +26 -0
- data/lib/stripe/resources/margin.rb +37 -0
- data/lib/stripe/resources/order.rb +120 -0
- data/lib/stripe/resources/payment_intent.rb +150 -100
- data/lib/stripe/resources/payment_link.rb +10 -10
- data/lib/stripe/resources/payment_method.rb +17 -17
- data/lib/stripe/resources/payment_method_domain.rb +29 -29
- data/lib/stripe/resources/payout.rb +22 -22
- data/lib/stripe/resources/quote.rb +136 -32
- data/lib/stripe/resources/quote_phase.rb +39 -0
- data/lib/stripe/resources/quote_preview_invoice.rb +43 -0
- data/lib/stripe/resources/quote_preview_subscription_schedule.rb +11 -0
- data/lib/stripe/resources/setup_intent.rb +32 -32
- data/lib/stripe/resources/sigma/scheduled_query_run.rb +4 -4
- data/lib/stripe/resources/source.rb +17 -17
- data/lib/stripe/resources/subscription.rb +36 -36
- data/lib/stripe/resources/subscription_schedule.rb +31 -11
- data/lib/stripe/resources/tax/calculation.rb +10 -10
- data/lib/stripe/resources/tax/form.rb +49 -0
- data/lib/stripe/resources/tax/transaction.rb +10 -10
- data/lib/stripe/resources/terminal/reader.rb +101 -41
- data/lib/stripe/resources/treasury/financial_account.rb +25 -25
- data/lib/stripe/resources/treasury/transaction_entry.rb +4 -4
- data/lib/stripe/resources.rb +21 -0
- data/lib/stripe/stripe_client.rb +62 -28
- data/lib/stripe/stripe_configuration.rb +2 -1
- data/lib/stripe/util.rb +8 -1
- data/lib/stripe/version.rb +1 -1
- data/lib/stripe.rb +54 -0
- metadata +25 -3
@@ -16,42 +16,42 @@ module Stripe
|
|
16
16
|
"issuing.dispute"
|
17
17
|
end
|
18
18
|
|
19
|
-
#
|
20
|
-
def
|
19
|
+
# Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.
|
20
|
+
def self.create(params = {}, opts = {})
|
21
21
|
request_stripe_object(
|
22
22
|
method: :post,
|
23
|
-
path:
|
23
|
+
path: "/v1/issuing/disputes",
|
24
24
|
params: params,
|
25
25
|
opts: opts
|
26
26
|
)
|
27
27
|
end
|
28
28
|
|
29
|
-
#
|
30
|
-
def self.
|
29
|
+
# Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
30
|
+
def self.list(filters = {}, opts = {})
|
31
31
|
request_stripe_object(
|
32
|
-
method: :
|
33
|
-
path:
|
34
|
-
params:
|
32
|
+
method: :get,
|
33
|
+
path: "/v1/issuing/disputes",
|
34
|
+
params: filters,
|
35
35
|
opts: opts
|
36
36
|
)
|
37
37
|
end
|
38
38
|
|
39
|
-
#
|
40
|
-
def
|
39
|
+
# Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
|
40
|
+
def submit(params = {}, opts = {})
|
41
41
|
request_stripe_object(
|
42
42
|
method: :post,
|
43
|
-
path: "/v1/issuing/disputes",
|
43
|
+
path: format("/v1/issuing/disputes/%<dispute>s/submit", { dispute: CGI.escape(self["id"]) }),
|
44
44
|
params: params,
|
45
45
|
opts: opts
|
46
46
|
)
|
47
47
|
end
|
48
48
|
|
49
|
-
#
|
50
|
-
def self.
|
49
|
+
# Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
|
50
|
+
def self.submit(dispute, params = {}, opts = {})
|
51
51
|
request_stripe_object(
|
52
|
-
method: :
|
53
|
-
path: "/v1/issuing/disputes",
|
54
|
-
params:
|
52
|
+
method: :post,
|
53
|
+
path: format("/v1/issuing/disputes/%<dispute>s/submit", { dispute: CGI.escape(dispute) }),
|
54
|
+
params: params,
|
55
55
|
opts: opts
|
56
56
|
)
|
57
57
|
end
|
@@ -0,0 +1,119 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Issuing
|
6
|
+
# A Personalization Design is a logical grouping of a Physical Bundle, card logo, and carrier text that represents a product line.
|
7
|
+
class PersonalizationDesign < APIResource
|
8
|
+
extend Stripe::APIOperations::Create
|
9
|
+
extend Stripe::APIOperations::List
|
10
|
+
include Stripe::APIOperations::Save
|
11
|
+
|
12
|
+
OBJECT_NAME = "issuing.personalization_design"
|
13
|
+
def self.object_name
|
14
|
+
"issuing.personalization_design"
|
15
|
+
end
|
16
|
+
|
17
|
+
# Creates a personalization design object.
|
18
|
+
def self.create(params = {}, opts = {})
|
19
|
+
request_stripe_object(
|
20
|
+
method: :post,
|
21
|
+
path: "/v1/issuing/personalization_designs",
|
22
|
+
params: params,
|
23
|
+
opts: opts
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
28
|
+
def self.list(filters = {}, opts = {})
|
29
|
+
request_stripe_object(
|
30
|
+
method: :get,
|
31
|
+
path: "/v1/issuing/personalization_designs",
|
32
|
+
params: filters,
|
33
|
+
opts: opts
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
# Updates a card personalization object.
|
38
|
+
def self.update(id, params = {}, opts = {})
|
39
|
+
request_stripe_object(
|
40
|
+
method: :post,
|
41
|
+
path: format("/v1/issuing/personalization_designs/%<id>s", { id: CGI.escape(id) }),
|
42
|
+
params: params,
|
43
|
+
opts: opts
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_helpers
|
48
|
+
TestHelpers.new(self)
|
49
|
+
end
|
50
|
+
|
51
|
+
class TestHelpers < APIResourceTestHelpers
|
52
|
+
RESOURCE_CLASS = PersonalizationDesign
|
53
|
+
def self.resource_class
|
54
|
+
"PersonalizationDesign"
|
55
|
+
end
|
56
|
+
|
57
|
+
# Updates the status of the specified testmode personalization design object to active.
|
58
|
+
def self.activate(personalization_design, params = {}, opts = {})
|
59
|
+
request_stripe_object(
|
60
|
+
method: :post,
|
61
|
+
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/activate", { personalization_design: CGI.escape(personalization_design) }),
|
62
|
+
params: params,
|
63
|
+
opts: opts
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
# Updates the status of the specified testmode personalization design object to inactive.
|
68
|
+
def self.deactivate(personalization_design, params = {}, opts = {})
|
69
|
+
request_stripe_object(
|
70
|
+
method: :post,
|
71
|
+
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/deactivate", { personalization_design: CGI.escape(personalization_design) }),
|
72
|
+
params: params,
|
73
|
+
opts: opts
|
74
|
+
)
|
75
|
+
end
|
76
|
+
|
77
|
+
# Updates the status of the specified testmode personalization design object to rejected.
|
78
|
+
def self.reject(personalization_design, params = {}, opts = {})
|
79
|
+
request_stripe_object(
|
80
|
+
method: :post,
|
81
|
+
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/reject", { personalization_design: CGI.escape(personalization_design) }),
|
82
|
+
params: params,
|
83
|
+
opts: opts
|
84
|
+
)
|
85
|
+
end
|
86
|
+
|
87
|
+
# Updates the status of the specified testmode personalization design object to active.
|
88
|
+
def activate(params = {}, opts = {})
|
89
|
+
@resource.request_stripe_object(
|
90
|
+
method: :post,
|
91
|
+
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/activate", { personalization_design: CGI.escape(@resource["id"]) }),
|
92
|
+
params: params,
|
93
|
+
opts: opts
|
94
|
+
)
|
95
|
+
end
|
96
|
+
|
97
|
+
# Updates the status of the specified testmode personalization design object to inactive.
|
98
|
+
def deactivate(params = {}, opts = {})
|
99
|
+
@resource.request_stripe_object(
|
100
|
+
method: :post,
|
101
|
+
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/deactivate", { personalization_design: CGI.escape(@resource["id"]) }),
|
102
|
+
params: params,
|
103
|
+
opts: opts
|
104
|
+
)
|
105
|
+
end
|
106
|
+
|
107
|
+
# Updates the status of the specified testmode personalization design object to rejected.
|
108
|
+
def reject(params = {}, opts = {})
|
109
|
+
@resource.request_stripe_object(
|
110
|
+
method: :post,
|
111
|
+
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/reject", { personalization_design: CGI.escape(@resource["id"]) }),
|
112
|
+
params: params,
|
113
|
+
opts: opts
|
114
|
+
)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
module Issuing
|
6
|
+
# A Physical Bundle represents the bundle of physical items - card stock, carrier letter, and envelope - that is shipped to a cardholder when you create a physical card.
|
7
|
+
class PhysicalBundle < APIResource
|
8
|
+
extend Stripe::APIOperations::List
|
9
|
+
|
10
|
+
OBJECT_NAME = "issuing.physical_bundle"
|
11
|
+
def self.object_name
|
12
|
+
"issuing.physical_bundle"
|
13
|
+
end
|
14
|
+
|
15
|
+
# Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
16
|
+
def self.list(filters = {}, opts = {})
|
17
|
+
request_stripe_object(
|
18
|
+
method: :get,
|
19
|
+
path: "/v1/issuing/physical_bundles",
|
20
|
+
params: filters,
|
21
|
+
opts: opts
|
22
|
+
)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# A (partner) margin represents a specific discount distributed in partner reseller programs to business partners who
|
6
|
+
# resell products and services and earn a discount (margin) for doing so.
|
7
|
+
class Margin < APIResource
|
8
|
+
extend Stripe::APIOperations::Create
|
9
|
+
extend Stripe::APIOperations::List
|
10
|
+
include Stripe::APIOperations::Save
|
11
|
+
|
12
|
+
OBJECT_NAME = "margin"
|
13
|
+
def self.object_name
|
14
|
+
"margin"
|
15
|
+
end
|
16
|
+
|
17
|
+
# Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount.A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item.
|
18
|
+
def self.create(params = {}, opts = {})
|
19
|
+
request_stripe_object(method: :post, path: "/v1/billing/margins", params: params, opts: opts)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Retrieve a list of your margins.
|
23
|
+
def self.list(filters = {}, opts = {})
|
24
|
+
request_stripe_object(method: :get, path: "/v1/billing/margins", params: filters, opts: opts)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Update the specified margin object. Certain fields of the margin object are not editable.
|
28
|
+
def self.update(id, params = {}, opts = {})
|
29
|
+
request_stripe_object(
|
30
|
+
method: :post,
|
31
|
+
path: format("/v1/billing/margins/%<id>s", { id: CGI.escape(id) }),
|
32
|
+
params: params,
|
33
|
+
opts: opts
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
# File generated from our OpenAPI spec
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Stripe
|
5
|
+
# An Order describes a purchase being made by a customer, including the
|
6
|
+
# products & quantities being purchased, the order status, the payment information,
|
7
|
+
# and the billing/shipping details.
|
8
|
+
#
|
9
|
+
# Related guide: [Orders overview](https://stripe.com/docs/orders)
|
10
|
+
class Order < APIResource
|
11
|
+
extend Stripe::APIOperations::Create
|
12
|
+
extend Stripe::APIOperations::List
|
13
|
+
include Stripe::APIOperations::Save
|
14
|
+
|
15
|
+
OBJECT_NAME = "order"
|
16
|
+
def self.object_name
|
17
|
+
"order"
|
18
|
+
end
|
19
|
+
|
20
|
+
# Cancels the order as well as the payment intent if one is attached.
|
21
|
+
def cancel(params = {}, opts = {})
|
22
|
+
request_stripe_object(
|
23
|
+
method: :post,
|
24
|
+
path: format("/v1/orders/%<id>s/cancel", { id: CGI.escape(self["id"]) }),
|
25
|
+
params: params,
|
26
|
+
opts: opts
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Cancels the order as well as the payment intent if one is attached.
|
31
|
+
def self.cancel(id, params = {}, opts = {})
|
32
|
+
request_stripe_object(
|
33
|
+
method: :post,
|
34
|
+
path: format("/v1/orders/%<id>s/cancel", { id: CGI.escape(id) }),
|
35
|
+
params: params,
|
36
|
+
opts: opts
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Creates a new open order object.
|
41
|
+
def self.create(params = {}, opts = {})
|
42
|
+
request_stripe_object(method: :post, path: "/v1/orders", params: params, opts: opts)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.
|
46
|
+
def self.list(filters = {}, opts = {})
|
47
|
+
request_stripe_object(method: :get, path: "/v1/orders", params: filters, opts: opts)
|
48
|
+
end
|
49
|
+
|
50
|
+
# When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
|
51
|
+
def list_line_items(params = {}, opts = {})
|
52
|
+
request_stripe_object(
|
53
|
+
method: :get,
|
54
|
+
path: format("/v1/orders/%<id>s/line_items", { id: CGI.escape(self["id"]) }),
|
55
|
+
params: params,
|
56
|
+
opts: opts
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
# When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
|
61
|
+
def self.list_line_items(id, params = {}, opts = {})
|
62
|
+
request_stripe_object(
|
63
|
+
method: :get,
|
64
|
+
path: format("/v1/orders/%<id>s/line_items", { id: CGI.escape(id) }),
|
65
|
+
params: params,
|
66
|
+
opts: opts
|
67
|
+
)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Reopens a submitted order.
|
71
|
+
def reopen(params = {}, opts = {})
|
72
|
+
request_stripe_object(
|
73
|
+
method: :post,
|
74
|
+
path: format("/v1/orders/%<id>s/reopen", { id: CGI.escape(self["id"]) }),
|
75
|
+
params: params,
|
76
|
+
opts: opts
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Reopens a submitted order.
|
81
|
+
def self.reopen(id, params = {}, opts = {})
|
82
|
+
request_stripe_object(
|
83
|
+
method: :post,
|
84
|
+
path: format("/v1/orders/%<id>s/reopen", { id: CGI.escape(id) }),
|
85
|
+
params: params,
|
86
|
+
opts: opts
|
87
|
+
)
|
88
|
+
end
|
89
|
+
|
90
|
+
# Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://stripe.com/docs/api#reopen_order) method is called.
|
91
|
+
def submit(params = {}, opts = {})
|
92
|
+
request_stripe_object(
|
93
|
+
method: :post,
|
94
|
+
path: format("/v1/orders/%<id>s/submit", { id: CGI.escape(self["id"]) }),
|
95
|
+
params: params,
|
96
|
+
opts: opts
|
97
|
+
)
|
98
|
+
end
|
99
|
+
|
100
|
+
# Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://stripe.com/docs/api#reopen_order) method is called.
|
101
|
+
def self.submit(id, params = {}, opts = {})
|
102
|
+
request_stripe_object(
|
103
|
+
method: :post,
|
104
|
+
path: format("/v1/orders/%<id>s/submit", { id: CGI.escape(id) }),
|
105
|
+
params: params,
|
106
|
+
opts: opts
|
107
|
+
)
|
108
|
+
end
|
109
|
+
|
110
|
+
# Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
111
|
+
def self.update(id, params = {}, opts = {})
|
112
|
+
request_stripe_object(
|
113
|
+
method: :post,
|
114
|
+
path: format("/v1/orders/%<id>s", { id: CGI.escape(id) }),
|
115
|
+
params: params,
|
116
|
+
opts: opts
|
117
|
+
)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|