mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-07-28 00:00:41 -04:00
Compare commits
3 Commits
a60aee46a1
...
61ba9d6b51
Author | SHA1 | Date | |
---|---|---|---|
|
61ba9d6b51 | ||
|
de4e1d3b23 | ||
|
c51404d7a2 |
@ -1,4 +1,11 @@
|
||||
# Changelog
|
||||
## 10.4.0 - 2023-12-22
|
||||
* [#1303](https://github.com/stripe/stripe-ruby/pull/1303) Update generated code
|
||||
* Add support for new resource `FinancialConnections.Transaction`
|
||||
* Add support for `list` and `retrieve` methods on resource `Transaction`
|
||||
* Add support for `subscribe` and `unsubscribe` methods on resource `FinancialConnections.Account`
|
||||
* [#1304](https://github.com/stripe/stripe-ruby/pull/1304) Add support for updatable singleton resources
|
||||
|
||||
## 10.3.0 - 2023-12-14
|
||||
* [#1294](https://github.com/stripe/stripe-ruby/pull/1294) Support sending parameters inside singleton retrieve
|
||||
|
||||
|
@ -1 +1 @@
|
||||
v682
|
||||
v742
|
@ -52,6 +52,7 @@ module Stripe
|
||||
FinancialConnections::AccountOwnership::OBJECT_NAME =>
|
||||
FinancialConnections::AccountOwnership,
|
||||
FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
|
||||
FinancialConnections::Transaction::OBJECT_NAME => FinancialConnections::Transaction,
|
||||
FundingInstructions::OBJECT_NAME => FundingInstructions,
|
||||
Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
|
||||
Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
|
||||
|
@ -39,6 +39,7 @@ require "stripe/resources/financial_connections/account"
|
||||
require "stripe/resources/financial_connections/account_owner"
|
||||
require "stripe/resources/financial_connections/account_ownership"
|
||||
require "stripe/resources/financial_connections/session"
|
||||
require "stripe/resources/financial_connections/transaction"
|
||||
require "stripe/resources/funding_instructions"
|
||||
require "stripe/resources/identity/verification_report"
|
||||
require "stripe/resources/identity/verification_session"
|
||||
|
@ -25,6 +25,7 @@ module Stripe
|
||||
resource_plural: "capabilities"
|
||||
nested_resource_class_methods :person, operations: %i[create retrieve update delete list]
|
||||
|
||||
# Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
|
||||
def persons(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -34,6 +35,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
|
||||
#
|
||||
# Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
|
||||
def reject(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -43,6 +47,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first.
|
||||
def self.persons(account, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -52,6 +57,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious.
|
||||
#
|
||||
# Test-mode Custom and Express accounts can be rejected at any time. Accounts created using live-mode keys may only be rejected once all balances are zero.
|
||||
def self.reject(account, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -18,6 +18,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "apps.secret"
|
||||
|
||||
# Deletes a secret from the secret store by name and scope.
|
||||
def self.delete_where(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -27,6 +28,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Finds a secret in the secret store by name and scope.
|
||||
def self.find(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
|
@ -14,6 +14,11 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "charge"
|
||||
|
||||
# Capture the payment of an existing, uncaptured charge that was created with the capture option set to false.
|
||||
#
|
||||
# Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail.
|
||||
#
|
||||
# Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture).
|
||||
def capture(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -23,6 +28,11 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Capture the payment of an existing, uncaptured charge that was created with the capture option set to false.
|
||||
#
|
||||
# Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail.
|
||||
#
|
||||
# Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture).
|
||||
def self.capture(charge, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -23,6 +23,9 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "checkout.session"
|
||||
|
||||
# A Session can be expired when it is in one of these statuses: open
|
||||
#
|
||||
# After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired.
|
||||
def expire(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -32,6 +35,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# When retrieving a Checkout Session, 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.
|
||||
def list_line_items(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -41,6 +45,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# A Session can be expired when it is in one of these statuses: open
|
||||
#
|
||||
# After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired.
|
||||
def self.expire(session, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -50,6 +57,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# When retrieving a Checkout Session, 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.
|
||||
def self.list_line_items(session, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
|
@ -12,6 +12,10 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "climate.order"
|
||||
|
||||
# Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the
|
||||
# reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier
|
||||
# might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe
|
||||
# provides 90 days advance notice and refunds the amount_total.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -21,6 +25,10 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the
|
||||
# reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier
|
||||
# might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe
|
||||
# provides 90 days advance notice and refunds the amount_total.
|
||||
def self.cancel(order, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -12,6 +12,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "credit_note"
|
||||
|
||||
# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
|
||||
def void_credit_note(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -21,6 +22,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
|
||||
def self.list_preview_line_items(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -30,6 +32,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Get a preview of a credit note without creating it.
|
||||
def self.preview(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -39,6 +42,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
|
||||
def self.void_credit_note(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -19,6 +19,9 @@ module Stripe
|
||||
nested_resource_class_methods :cash_balance_transaction, operations: %i[retrieve list]
|
||||
nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list]
|
||||
|
||||
# Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
|
||||
# funding instructions will be created. If funding instructions have already been created for a given customer, the same
|
||||
# funding instructions will be retrieved. In other words, we will return the same funding instructions each time.
|
||||
def create_funding_instructions(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -28,6 +31,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Removes the currently applied discount on a customer.
|
||||
def delete_discount(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
@ -37,6 +41,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Returns a list of PaymentMethods for a given Customer
|
||||
def list_payment_methods(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -46,6 +51,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Retrieves a PaymentMethod object for a given Customer.
|
||||
def retrieve_payment_method(payment_method, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -55,6 +61,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
|
||||
# funding instructions will be created. If funding instructions have already been created for a given customer, the same
|
||||
# funding instructions will be retrieved. In other words, we will return the same funding instructions each time.
|
||||
def self.create_funding_instructions(customer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -64,6 +73,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Removes the currently applied discount on a customer.
|
||||
def self.delete_discount(customer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
@ -73,6 +83,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Returns a list of PaymentMethods for a given Customer
|
||||
def self.list_payment_methods(customer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -82,6 +93,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Retrieves a PaymentMethod object for a given Customer.
|
||||
def self.retrieve_payment_method(customer, payment_method, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -109,6 +121,7 @@ module Stripe
|
||||
search(params, opts).auto_paging_each(&blk)
|
||||
end
|
||||
|
||||
# Retrieves a customer's cash balance.
|
||||
def self.retrieve_cash_balance(customer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -118,6 +131,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Changes the settings on a customer's cash balance.
|
||||
def self.update_cash_balance(customer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -134,6 +148,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = Customer
|
||||
|
||||
# Create an incoming testmode bank transfer
|
||||
def self.fund_cash_balance(customer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -143,6 +158,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Create an incoming testmode bank transfer
|
||||
def fund_cash_balance(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -13,6 +13,9 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "dispute"
|
||||
|
||||
# Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.
|
||||
#
|
||||
# The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible.
|
||||
def close(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -22,6 +25,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost.
|
||||
#
|
||||
# The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible.
|
||||
def self.close(dispute, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -5,7 +5,7 @@ module Stripe
|
||||
# This object represents files hosted on Stripe's servers. You can upload
|
||||
# files with the [create file](https://stripe.com/docs/api#create_file) request
|
||||
# (for example, when uploading dispute evidence). Stripe also
|
||||
# creates files independetly (for example, the results of a [Sigma scheduled
|
||||
# creates files independently (for example, the results of a [Sigma scheduled
|
||||
# query](https://stripe.com/docs/api#scheduled_queries)).
|
||||
#
|
||||
# Related guide: [File upload guide](https://stripe.com/docs/file-upload)
|
||||
|
@ -9,6 +9,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "financial_connections.account"
|
||||
|
||||
# Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
|
||||
def disconnect(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -18,6 +19,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Lists all owners for a given Account
|
||||
def list_owners(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -27,6 +29,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Refreshes the data associated with a Financial Connections Account.
|
||||
def refresh_account(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -36,6 +39,27 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Subscribes to periodic refreshes of data associated with a Financial Connections Account.
|
||||
def subscribe(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(self["id"]) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
|
||||
# Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
|
||||
def unsubscribe(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(self["id"]) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
|
||||
# Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
|
||||
def self.disconnect(account, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -45,6 +69,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Lists all owners for a given Account
|
||||
def self.list_owners(account, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -54,6 +79,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Refreshes the data associated with a Financial Connections Account.
|
||||
def self.refresh_account(account, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -62,6 +88,26 @@ module Stripe
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
|
||||
# Subscribes to periodic refreshes of data associated with a Financial Connections Account.
|
||||
def self.subscribe(account, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(account) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
|
||||
# Unsubscribes from periodic refreshes of data associated with a Financial Connections Account.
|
||||
def self.unsubscribe(account, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(account) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
13
lib/stripe/resources/financial_connections/transaction.rb
Normal file
13
lib/stripe/resources/financial_connections/transaction.rb
Normal file
@ -0,0 +1,13 @@
|
||||
# File generated from our OpenAPI spec
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
module FinancialConnections
|
||||
# A Transaction represents a real transaction that affects a Financial Connections Account balance.
|
||||
class Transaction < APIResource
|
||||
extend Stripe::APIOperations::List
|
||||
|
||||
OBJECT_NAME = "financial_connections.transaction"
|
||||
end
|
||||
end
|
||||
end
|
@ -21,6 +21,9 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "identity.verification_session"
|
||||
|
||||
# A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
|
||||
#
|
||||
# Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -30,6 +33,25 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Redact a VerificationSession to remove all collected information from Stripe. This will redact
|
||||
# the VerificationSession and all objects related to it, including VerificationReports, Events,
|
||||
# request logs, etc.
|
||||
#
|
||||
# A VerificationSession object can be redacted when it is in requires_input or verified
|
||||
# [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
|
||||
# state will automatically cancel it.
|
||||
#
|
||||
# The redaction process may take up to four days. When the redaction process is in progress, the
|
||||
# VerificationSession's redaction.status field will be set to processing; when the process is
|
||||
# finished, it will change to redacted and an identity.verification_session.redacted event
|
||||
# will be emitted.
|
||||
#
|
||||
# Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the
|
||||
# fields that contain personal data will be replaced by the string [redacted] or a similar
|
||||
# placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
|
||||
# used for any purpose.
|
||||
#
|
||||
# [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
|
||||
def redact(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -39,6 +61,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
|
||||
#
|
||||
# Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
|
||||
def self.cancel(session, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -48,6 +73,25 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Redact a VerificationSession to remove all collected information from Stripe. This will redact
|
||||
# the VerificationSession and all objects related to it, including VerificationReports, Events,
|
||||
# request logs, etc.
|
||||
#
|
||||
# A VerificationSession object can be redacted when it is in requires_input or verified
|
||||
# [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
|
||||
# state will automatically cancel it.
|
||||
#
|
||||
# The redaction process may take up to four days. When the redaction process is in progress, the
|
||||
# VerificationSession's redaction.status field will be set to processing; when the process is
|
||||
# finished, it will change to redacted and an identity.verification_session.redacted event
|
||||
# will be emitted.
|
||||
#
|
||||
# Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the
|
||||
# fields that contain personal data will be replaced by the string [redacted] or a similar
|
||||
# placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
|
||||
# used for any purpose.
|
||||
#
|
||||
# [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
|
||||
def self.redact(session, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -43,6 +43,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "invoice"
|
||||
|
||||
# Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method.
|
||||
def finalize_invoice(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -52,6 +53,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
|
||||
def mark_uncollectible(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -61,6 +63,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
|
||||
def pay(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -70,6 +73,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.
|
||||
#
|
||||
# Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.
|
||||
def send_invoice(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -79,6 +85,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
|
||||
def void_invoice(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -88,6 +95,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method.
|
||||
def self.finalize_invoice(invoice, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -97,6 +105,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
|
||||
def self.list_upcoming_line_items(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -106,6 +115,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes.
|
||||
def self.mark_uncollectible(invoice, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -115,6 +125,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so.
|
||||
def self.pay(invoice, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -124,6 +135,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email.
|
||||
#
|
||||
# Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event.
|
||||
def self.send_invoice(invoice, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -133,10 +147,16 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
|
||||
#
|
||||
# Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
|
||||
#
|
||||
# You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource.
|
||||
def self.upcoming(params = {}, opts = {})
|
||||
request_stripe_object(method: :get, path: "/v1/invoices/upcoming", params: params, opts: opts)
|
||||
end
|
||||
|
||||
# Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
|
||||
def self.void_invoice(invoice, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -14,6 +14,8 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "issuing.authorization"
|
||||
|
||||
# [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
def approve(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -23,6 +25,8 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
def decline(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -32,6 +36,8 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
def self.approve(authorization, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -41,6 +47,8 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
def self.decline(authorization, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -57,6 +65,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = Authorization
|
||||
|
||||
# Capture a test-mode authorization.
|
||||
def self.capture(authorization, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -66,6 +75,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Create a test-mode authorization.
|
||||
def self.create(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -75,6 +85,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Expire a test-mode Authorization.
|
||||
def self.expire(authorization, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -84,6 +95,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Increment a test-mode Authorization.
|
||||
def self.increment(authorization, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -93,6 +105,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Reverse a test-mode Authorization.
|
||||
def self.reverse(authorization, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -102,6 +115,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Capture a test-mode authorization.
|
||||
def capture(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -111,6 +125,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Expire a test-mode Authorization.
|
||||
def expire(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -120,6 +135,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Increment a test-mode Authorization.
|
||||
def increment(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -129,6 +145,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Reverse a test-mode Authorization.
|
||||
def reverse(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -18,6 +18,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = Card
|
||||
|
||||
# Updates the shipping status of the specified Issuing Card object to delivered.
|
||||
def self.deliver_card(card, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -27,6 +28,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Updates the shipping status of the specified Issuing Card object to failure.
|
||||
def self.fail_card(card, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -36,6 +38,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Updates the shipping status of the specified Issuing Card object to returned.
|
||||
def self.return_card(card, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -45,6 +48,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Updates the shipping status of the specified Issuing Card object to shipped.
|
||||
def self.ship_card(card, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -54,6 +58,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Updates the shipping status of the specified Issuing Card object to delivered.
|
||||
def deliver_card(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -63,6 +68,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Updates the shipping status of the specified Issuing Card object to failure.
|
||||
def fail_card(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -72,6 +78,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Updates the shipping status of the specified Issuing Card object to returned.
|
||||
def return_card(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -81,6 +88,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Updates the shipping status of the specified Issuing Card object to shipped.
|
||||
def ship_card(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -13,6 +13,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "issuing.dispute"
|
||||
|
||||
# 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).
|
||||
def submit(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -22,6 +23,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# 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).
|
||||
def self.submit(dispute, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -21,6 +21,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = Transaction
|
||||
|
||||
# Allows the user to capture an arbitrary amount, also known as a forced capture.
|
||||
def self.create_force_capture(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -30,6 +31,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Allows the user to refund an arbitrary amount, also known as a unlinked refund.
|
||||
def self.create_unlinked_refund(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -39,6 +41,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Refund a test-mode Transaction.
|
||||
def self.refund(transaction, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -48,6 +51,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Refund a test-mode Transaction.
|
||||
def refund(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -21,6 +21,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "payment_intent"
|
||||
|
||||
# Manually reconcile the remaining amount for a customer_balance PaymentIntent.
|
||||
def apply_customer_balance(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -30,6 +31,11 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing.
|
||||
#
|
||||
# After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded.
|
||||
#
|
||||
# You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -39,6 +45,11 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture.
|
||||
#
|
||||
# Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
|
||||
#
|
||||
# Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later).
|
||||
def capture(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -48,6 +59,29 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Confirm that your customer intends to pay with current or provided
|
||||
# payment method. Upon confirmation, the PaymentIntent will attempt to initiate
|
||||
# a payment.
|
||||
# If the selected payment method requires additional authentication steps, the
|
||||
# PaymentIntent will transition to the requires_action status and
|
||||
# suggest additional actions via next_action. If payment fails,
|
||||
# the PaymentIntent transitions to the requires_payment_method status or the
|
||||
# canceled status if the confirmation limit is reached. If
|
||||
# payment succeeds, the PaymentIntent will transition to the succeeded
|
||||
# status (or requires_capture, if capture_method is set to manual).
|
||||
# If the confirmation_method is automatic, payment may be attempted
|
||||
# using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment)
|
||||
# and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret).
|
||||
# After next_actions are handled by the client, no additional
|
||||
# confirmation is required to complete the payment.
|
||||
# If the confirmation_method is manual, all payment attempts must be
|
||||
# initiated using a secret key.
|
||||
# If any actions are required for the payment, the PaymentIntent will
|
||||
# return to the requires_confirmation state
|
||||
# after those actions are completed. Your server needs to then
|
||||
# explicitly re-confirm the PaymentIntent to initiate the next payment
|
||||
# attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual)
|
||||
# to learn more about manual confirmation.
|
||||
def confirm(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -57,6 +91,30 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Perform an incremental authorization on an eligible
|
||||
# [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
|
||||
# PaymentIntent's status must be requires_capture and
|
||||
# [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported)
|
||||
# must be true.
|
||||
#
|
||||
# Incremental authorizations attempt to increase the authorized amount on
|
||||
# your customer's card to the new, higher amount provided. Similar to the
|
||||
# initial authorization, incremental authorizations can be declined. A
|
||||
# single PaymentIntent can call this endpoint multiple times to further
|
||||
# increase the authorized amount.
|
||||
#
|
||||
# If the incremental authorization succeeds, the PaymentIntent object
|
||||
# returns with the updated
|
||||
# [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
|
||||
# If the incremental authorization fails, a
|
||||
# [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
|
||||
# fields on the PaymentIntent or Charge update. The PaymentIntent
|
||||
# object remains capturable for the previously authorized amount.
|
||||
#
|
||||
# Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
|
||||
# After it's captured, a PaymentIntent can no longer be incremented.
|
||||
#
|
||||
# Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
|
||||
def increment_authorization(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -66,6 +124,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Verifies microdeposits on a PaymentIntent object.
|
||||
def verify_microdeposits(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -75,6 +134,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Manually reconcile the remaining amount for a customer_balance PaymentIntent.
|
||||
def self.apply_customer_balance(intent, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -84,6 +144,11 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing.
|
||||
#
|
||||
# After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded.
|
||||
#
|
||||
# You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead.
|
||||
def self.cancel(intent, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -93,6 +158,11 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture.
|
||||
#
|
||||
# Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation.
|
||||
#
|
||||
# Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later).
|
||||
def self.capture(intent, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -102,6 +172,29 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Confirm that your customer intends to pay with current or provided
|
||||
# payment method. Upon confirmation, the PaymentIntent will attempt to initiate
|
||||
# a payment.
|
||||
# If the selected payment method requires additional authentication steps, the
|
||||
# PaymentIntent will transition to the requires_action status and
|
||||
# suggest additional actions via next_action. If payment fails,
|
||||
# the PaymentIntent transitions to the requires_payment_method status or the
|
||||
# canceled status if the confirmation limit is reached. If
|
||||
# payment succeeds, the PaymentIntent will transition to the succeeded
|
||||
# status (or requires_capture, if capture_method is set to manual).
|
||||
# If the confirmation_method is automatic, payment may be attempted
|
||||
# using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment)
|
||||
# and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret).
|
||||
# After next_actions are handled by the client, no additional
|
||||
# confirmation is required to complete the payment.
|
||||
# If the confirmation_method is manual, all payment attempts must be
|
||||
# initiated using a secret key.
|
||||
# If any actions are required for the payment, the PaymentIntent will
|
||||
# return to the requires_confirmation state
|
||||
# after those actions are completed. Your server needs to then
|
||||
# explicitly re-confirm the PaymentIntent to initiate the next payment
|
||||
# attempt. Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual)
|
||||
# to learn more about manual confirmation.
|
||||
def self.confirm(intent, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -111,6 +204,30 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Perform an incremental authorization on an eligible
|
||||
# [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
|
||||
# PaymentIntent's status must be requires_capture and
|
||||
# [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported)
|
||||
# must be true.
|
||||
#
|
||||
# Incremental authorizations attempt to increase the authorized amount on
|
||||
# your customer's card to the new, higher amount provided. Similar to the
|
||||
# initial authorization, incremental authorizations can be declined. A
|
||||
# single PaymentIntent can call this endpoint multiple times to further
|
||||
# increase the authorized amount.
|
||||
#
|
||||
# If the incremental authorization succeeds, the PaymentIntent object
|
||||
# returns with the updated
|
||||
# [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
|
||||
# If the incremental authorization fails, a
|
||||
# [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other
|
||||
# fields on the PaymentIntent or Charge update. The PaymentIntent
|
||||
# object remains capturable for the previously authorized amount.
|
||||
#
|
||||
# Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines.
|
||||
# After it's captured, a PaymentIntent can no longer be incremented.
|
||||
#
|
||||
# Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations).
|
||||
def self.increment_authorization(intent, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -120,6 +237,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Verifies microdeposits on a PaymentIntent object.
|
||||
def self.verify_microdeposits(intent, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -14,6 +14,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "payment_link"
|
||||
|
||||
# When retrieving a payment link, 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.
|
||||
def list_line_items(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -23,6 +24,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# When retrieving a payment link, 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.
|
||||
def self.list_line_items(payment_link, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
|
@ -14,6 +14,19 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "payment_method"
|
||||
|
||||
# Attaches a PaymentMethod object to a Customer.
|
||||
#
|
||||
# To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents)
|
||||
# or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage).
|
||||
# These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach
|
||||
# endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for
|
||||
# future use, which makes later declines and payment friction more likely.
|
||||
# See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up
|
||||
# future payments.
|
||||
#
|
||||
# To use this PaymentMethod as the default for invoice or subscription payments,
|
||||
# set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method),
|
||||
# on the Customer to the PaymentMethod's ID.
|
||||
def attach(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -23,6 +36,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.
|
||||
def detach(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -32,6 +46,19 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Attaches a PaymentMethod object to a Customer.
|
||||
#
|
||||
# To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents)
|
||||
# or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage).
|
||||
# These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach
|
||||
# endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for
|
||||
# future use, which makes later declines and payment friction more likely.
|
||||
# See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up
|
||||
# future payments.
|
||||
#
|
||||
# To use this PaymentMethod as the default for invoice or subscription payments,
|
||||
# set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method),
|
||||
# on the Customer to the PaymentMethod's ID.
|
||||
def self.attach(payment_method, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -41,6 +68,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer.
|
||||
def self.detach(payment_method, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -13,6 +13,12 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "payment_method_domain"
|
||||
|
||||
# Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain.
|
||||
# The payment method doesn't appear in Elements for this domain until it is active.
|
||||
#
|
||||
# To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint.
|
||||
#
|
||||
# Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
|
||||
def validate(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -22,6 +28,12 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain.
|
||||
# The payment method doesn't appear in Elements for this domain until it is active.
|
||||
#
|
||||
# To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint.
|
||||
#
|
||||
# Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
|
||||
def self.validate(payment_method_domain, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -17,6 +17,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "payout"
|
||||
|
||||
# You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -26,6 +27,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead.
|
||||
#
|
||||
# By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required.
|
||||
def reverse(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -35,6 +39,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts.
|
||||
def self.cancel(payout, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -44,6 +49,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead.
|
||||
#
|
||||
# By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required.
|
||||
def self.reverse(payout, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -11,6 +11,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "quote"
|
||||
|
||||
# Accepts the specified quote.
|
||||
def accept(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -20,6 +21,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Cancels the quote.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -29,6 +31,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Finalizes the quote.
|
||||
def finalize_quote(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -38,6 +41,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
|
||||
def list_computed_upfront_line_items(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -47,6 +51,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# When retrieving a quote, 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.
|
||||
def list_line_items(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -56,6 +61,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Download the PDF for a finalized quote
|
||||
def pdf(params = {}, opts = {}, &read_body_chunk_block)
|
||||
config = opts[:client]&.config || Stripe.config
|
||||
opts = { api_base: config.uploads_base }.merge(opts)
|
||||
@ -68,6 +74,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Accepts the specified quote.
|
||||
def self.accept(quote, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -77,6 +84,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Cancels the quote.
|
||||
def self.cancel(quote, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -86,6 +94,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Finalizes the quote.
|
||||
def self.finalize_quote(quote, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -95,6 +104,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items.
|
||||
def self.list_computed_upfront_line_items(quote, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -104,6 +114,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# When retrieving a quote, 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.
|
||||
def self.list_line_items(quote, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -113,6 +124,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Download the PDF for a finalized quote
|
||||
def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
|
||||
config = opts[:client]&.config || Stripe.config
|
||||
opts = { api_base: config.uploads_base }.merge(opts)
|
||||
|
@ -14,6 +14,9 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "refund"
|
||||
|
||||
# Cancels a refund with a status of requires_action.
|
||||
#
|
||||
# You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -23,6 +26,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Cancels a refund with a status of requires_action.
|
||||
#
|
||||
# You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state.
|
||||
def self.cancel(refund, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -39,6 +45,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = Refund
|
||||
|
||||
# Expire a refund with a status of requires_action.
|
||||
def self.expire(refund, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -48,6 +55,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Expire a refund with a status of requires_action.
|
||||
def expire(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -11,6 +11,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "review"
|
||||
|
||||
# Approves a Review object, closing it and removing it from the list of reviews.
|
||||
def approve(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -20,6 +21,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Approves a Review object, closing it and removing it from the list of reviews.
|
||||
def self.approve(review, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -30,6 +30,9 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "setup_intent"
|
||||
|
||||
# You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
|
||||
#
|
||||
# After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -39,6 +42,20 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Confirm that your customer intends to set up the current or
|
||||
# provided payment method. For example, you would confirm a SetupIntent
|
||||
# when a customer hits the “Save” button on a payment method management
|
||||
# page on your website.
|
||||
#
|
||||
# If the selected payment method does not require any additional
|
||||
# steps from the customer, the SetupIntent will transition to the
|
||||
# succeeded status.
|
||||
#
|
||||
# Otherwise, it will transition to the requires_action status and
|
||||
# suggest additional actions via next_action. If setup fails,
|
||||
# the SetupIntent will transition to the
|
||||
# requires_payment_method status or the canceled status if the
|
||||
# confirmation limit is reached.
|
||||
def confirm(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -48,6 +65,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Verifies microdeposits on a SetupIntent object.
|
||||
def verify_microdeposits(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -57,6 +75,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action.
|
||||
#
|
||||
# After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error.
|
||||
def self.cancel(intent, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -66,6 +87,20 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Confirm that your customer intends to set up the current or
|
||||
# provided payment method. For example, you would confirm a SetupIntent
|
||||
# when a customer hits the “Save” button on a payment method management
|
||||
# page on your website.
|
||||
#
|
||||
# If the selected payment method does not require any additional
|
||||
# steps from the customer, the SetupIntent will transition to the
|
||||
# succeeded status.
|
||||
#
|
||||
# Otherwise, it will transition to the requires_action status and
|
||||
# suggest additional actions via next_action. If setup fails,
|
||||
# the SetupIntent will transition to the
|
||||
# requires_payment_method status or the canceled status if the
|
||||
# confirmation limit is reached.
|
||||
def self.confirm(intent, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -75,6 +110,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Verifies microdeposits on a SetupIntent object.
|
||||
def self.verify_microdeposits(intent, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -21,6 +21,7 @@ module Stripe
|
||||
|
||||
nested_resource_class_methods :source_transaction, operations: %i[retrieve list]
|
||||
|
||||
# Verify a given source.
|
||||
def verify(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -30,6 +31,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Verify a given source.
|
||||
def self.verify(source, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -13,6 +13,11 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "subscription"
|
||||
|
||||
# Cancels a customer's subscription immediately. The customer will not be charged again for the subscription.
|
||||
#
|
||||
# Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
|
||||
#
|
||||
# By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
@ -22,6 +27,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Removes the currently applied discount on a subscription.
|
||||
def delete_discount(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
@ -31,6 +37,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
|
||||
def resume(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -40,6 +47,11 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Cancels a customer's subscription immediately. The customer will not be charged again for the subscription.
|
||||
#
|
||||
# Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
|
||||
#
|
||||
# By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
|
||||
def self.cancel(subscription_exposed_id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
@ -49,6 +61,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Removes the currently applied discount on a subscription.
|
||||
def self.delete_discount(subscription_exposed_id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
@ -58,6 +71,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date.
|
||||
def self.resume(subscription, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -12,6 +12,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "subscription_schedule"
|
||||
|
||||
# Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -21,6 +22,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
|
||||
def release(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -30,6 +32,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
|
||||
def self.cancel(schedule, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -39,6 +42,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property.
|
||||
def self.release(schedule, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -11,6 +11,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "tax.calculation"
|
||||
|
||||
# Retrieves the line items of a persisted tax calculation as a collection.
|
||||
def list_line_items(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -20,6 +21,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Retrieves the line items of a persisted tax calculation as a collection.
|
||||
def self.list_line_items(calculation, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
|
@ -9,6 +9,7 @@ module Stripe
|
||||
class Transaction < APIResource
|
||||
OBJECT_NAME = "tax.transaction"
|
||||
|
||||
# Retrieves the line items of a committed standalone transaction as a collection.
|
||||
def list_line_items(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -18,6 +19,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Creates a Tax Transaction from a calculation.
|
||||
def self.create_from_calculation(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -27,6 +29,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Partially or fully reverses a previously created Transaction.
|
||||
def self.create_reversal(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -36,6 +39,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Retrieves the line items of a committed standalone transaction as a collection.
|
||||
def self.list_line_items(transaction, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
|
@ -14,6 +14,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "terminal.reader"
|
||||
|
||||
# Cancels the current reader action.
|
||||
def cancel_action(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -23,6 +24,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Initiates a payment flow on a Reader.
|
||||
def process_payment_intent(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -32,6 +34,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Initiates a setup intent flow on a Reader.
|
||||
def process_setup_intent(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -41,6 +44,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Initiates a refund on a Reader
|
||||
def refund_payment(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -50,6 +54,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Sets reader display to show cart details.
|
||||
def set_reader_display(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -59,6 +64,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Cancels the current reader action.
|
||||
def self.cancel_action(reader, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -68,6 +74,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Initiates a payment flow on a Reader.
|
||||
def self.process_payment_intent(reader, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -77,6 +84,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Initiates a setup intent flow on a Reader.
|
||||
def self.process_setup_intent(reader, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -86,6 +94,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Initiates a refund on a Reader
|
||||
def self.refund_payment(reader, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -95,6 +104,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Sets reader display to show cart details.
|
||||
def self.set_reader_display(reader, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -111,6 +121,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = Reader
|
||||
|
||||
# Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
|
||||
def self.present_payment_method(reader, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -120,6 +131,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction.
|
||||
def present_payment_method(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -13,6 +13,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "test_helpers.test_clock"
|
||||
|
||||
# Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready.
|
||||
def advance(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -22,6 +23,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready.
|
||||
def self.advance(test_clock, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -14,6 +14,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "topup"
|
||||
|
||||
# Cancels a top-up. Only pending top-ups can be canceled.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -23,6 +24,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Cancels a top-up. Only pending top-ups can be canceled.
|
||||
def self.cancel(topup, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -12,6 +12,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "treasury.financial_account"
|
||||
|
||||
# Retrieves Features information associated with the FinancialAccount.
|
||||
def retrieve_features(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -21,6 +22,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Updates the Features associated with a FinancialAccount.
|
||||
def update_features(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -30,6 +32,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Retrieves Features information associated with the FinancialAccount.
|
||||
def self.retrieve_features(financial_account, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
@ -39,6 +42,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Updates the Features associated with a FinancialAccount.
|
||||
def self.update_features(financial_account, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -10,6 +10,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "treasury.inbound_transfer"
|
||||
|
||||
# Cancels an InboundTransfer.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -19,6 +20,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Cancels an InboundTransfer.
|
||||
def self.cancel(inbound_transfer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -35,6 +37,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = InboundTransfer
|
||||
|
||||
# Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state.
|
||||
def self.fail(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -44,6 +47,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state.
|
||||
def self.return_inbound_transfer(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -53,6 +57,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state.
|
||||
def self.succeed(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -62,6 +67,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state.
|
||||
def fail(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -71,6 +77,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state.
|
||||
def return_inbound_transfer(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -80,6 +87,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state.
|
||||
def succeed(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -12,6 +12,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "treasury.outbound_payment"
|
||||
|
||||
# Cancel an OutboundPayment.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -21,6 +22,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Cancel an OutboundPayment.
|
||||
def self.cancel(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -37,6 +39,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = OutboundPayment
|
||||
|
||||
# Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state.
|
||||
def self.fail(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -46,6 +49,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state.
|
||||
def self.post(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -55,6 +59,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state.
|
||||
def self.return_outbound_payment(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -64,6 +69,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state.
|
||||
def fail(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -73,6 +79,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state.
|
||||
def post(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -82,6 +89,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state.
|
||||
def return_outbound_payment(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -12,6 +12,7 @@ module Stripe
|
||||
|
||||
OBJECT_NAME = "treasury.outbound_transfer"
|
||||
|
||||
# An OutboundTransfer can be canceled if the funds have not yet been paid out.
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -21,6 +22,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# An OutboundTransfer can be canceled if the funds have not yet been paid out.
|
||||
def self.cancel(outbound_transfer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -37,6 +39,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = OutboundTransfer
|
||||
|
||||
# Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state.
|
||||
def self.fail(outbound_transfer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -46,6 +49,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state.
|
||||
def self.post(outbound_transfer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -55,6 +59,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state.
|
||||
def self.return_outbound_transfer(outbound_transfer, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -64,6 +69,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state.
|
||||
def fail(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -73,6 +79,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state.
|
||||
def post(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
@ -82,6 +89,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state.
|
||||
def return_outbound_transfer(params = {}, opts = {})
|
||||
@resource.request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -16,6 +16,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = ReceivedCredit
|
||||
|
||||
# Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties.
|
||||
def self.create(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -16,6 +16,7 @@ module Stripe
|
||||
class TestHelpers < APIResourceTestHelpers
|
||||
RESOURCE_CLASS = ReceivedDebit
|
||||
|
||||
# Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties.
|
||||
def self.create(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -1,5 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
VERSION = "10.3.0"
|
||||
VERSION = "10.4.0"
|
||||
end
|
||||
|
@ -613,6 +613,14 @@ module Stripe
|
||||
Stripe::FinancialConnections::Account.refresh_account("fca_xyz", { features: ["balance"] })
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/accounts/fca_xyz/refresh"
|
||||
end
|
||||
should "Test financial connections accounts subscribe post" do
|
||||
Stripe::FinancialConnections::Account.subscribe("fa_123", { features: ["transactions"] })
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/accounts/fa_123/subscribe"
|
||||
end
|
||||
should "Test financial connections accounts unsubscribe post" do
|
||||
Stripe::FinancialConnections::Account.unsubscribe("fa_123", { features: ["transactions"] })
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/accounts/fa_123/unsubscribe"
|
||||
end
|
||||
should "Test financial connections sessions get" do
|
||||
Stripe::FinancialConnections::Session.retrieve("fcsess_xyz")
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/financial_connections/sessions/fcsess_xyz?"
|
||||
@ -642,6 +650,14 @@ module Stripe
|
||||
})
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/sessions"
|
||||
end
|
||||
should "Test financial connections transactions get" do
|
||||
Stripe::FinancialConnections::Transaction.retrieve("tr_123")
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/financial_connections/transactions/tr_123?"
|
||||
end
|
||||
should "Test financial connections transactions get 2" do
|
||||
Stripe::FinancialConnections::Transaction.list({ account: "fca_xyz" })
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/financial_connections/transactions?account=fca_xyz"
|
||||
end
|
||||
should "Test identity verification reports get" do
|
||||
Stripe::Identity::VerificationReport.list({ limit: 3 })
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/identity/verification_reports?limit=3"
|
||||
@ -1571,6 +1587,22 @@ module Stripe
|
||||
Stripe::TaxRate.update("txr_xxxxxxxxxxxxx", { active: false })
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/tax_rates/txr_xxxxxxxxxxxxx"
|
||||
end
|
||||
should "Test tax registrations get" do
|
||||
Stripe::Tax::Registration.list({ status: "all" })
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/tax/registrations?status=all"
|
||||
end
|
||||
should "Test tax registrations post" do
|
||||
Stripe::Tax::Registration.create({
|
||||
country: "IE",
|
||||
country_options: { ie: { type: "oss_union" } },
|
||||
active_from: "now",
|
||||
})
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/tax/registrations"
|
||||
end
|
||||
should "Test tax registrations post 2" do
|
||||
Stripe::Tax::Registration.update("taxreg_xxxxxxxxxxxxx", { expires_at: "now" })
|
||||
assert_requested :post, "#{Stripe.api_base}/v1/tax/registrations/taxreg_xxxxxxxxxxxxx"
|
||||
end
|
||||
should "Test tax settings get" do
|
||||
Stripe::Tax::Settings.retrieve
|
||||
assert_requested :get, "#{Stripe.api_base}/v1/tax/settings?"
|
||||
|
Loading…
x
Reference in New Issue
Block a user