Class: Stripe::ConfirmationToken

Inherits:
APIResource show all
Defined in:
lib/stripe/resources/confirmation_token.rb

Overview

ConfirmationTokens help transport client side data collected by Stripe JS over to your server for confirming a PaymentIntent or SetupIntent. If the confirmation is successful, values present on the ConfirmationToken are written onto the Intent.

To learn more about how to use ConfirmationToken, visit the related guides:

Defined Under Namespace

Classes: MandateData, PaymentMethodOptions, PaymentMethodPreview, Shipping, TestHelpers

Constant Summary collapse

OBJECT_NAME =
"confirmation_token"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResource

class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource

Methods included from APIOperations::Request

included

Methods inherited from StripeObject

#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Instance Attribute Details

#createdObject (readonly)

Time at which the object was created. Measured in seconds since the Unix epoch.



1875
1876
1877
# File 'lib/stripe/resources/confirmation_token.rb', line 1875

def created
  @created
end

#expires_atObject (readonly)

Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent.



1877
1878
1879
# File 'lib/stripe/resources/confirmation_token.rb', line 1877

def expires_at
  @expires_at
end

#idObject (readonly)

Unique identifier for the object.



1879
1880
1881
# File 'lib/stripe/resources/confirmation_token.rb', line 1879

def id
  @id
end

#livemodeObject (readonly)

If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.



1881
1882
1883
# File 'lib/stripe/resources/confirmation_token.rb', line 1881

def livemode
  @livemode
end

#mandate_dataObject (readonly)

Data used for generating a Mandate.



1883
1884
1885
# File 'lib/stripe/resources/confirmation_token.rb', line 1883

def mandate_data
  @mandate_data
end

#objectObject (readonly)

String representing the object's type. Objects of the same type share the same value.



1885
1886
1887
# File 'lib/stripe/resources/confirmation_token.rb', line 1885

def object
  @object
end

#payment_intentObject (readonly)

ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.



1887
1888
1889
# File 'lib/stripe/resources/confirmation_token.rb', line 1887

def payment_intent
  @payment_intent
end

#payment_method_optionsObject (readonly)

Payment-method-specific configuration for this ConfirmationToken.



1889
1890
1891
# File 'lib/stripe/resources/confirmation_token.rb', line 1889

def payment_method_options
  @payment_method_options
end

#payment_method_previewObject (readonly)

Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken.



1891
1892
1893
# File 'lib/stripe/resources/confirmation_token.rb', line 1891

def payment_method_preview
  @payment_method_preview
end

#return_urlObject (readonly)

Return URL used to confirm the Intent.



1893
1894
1895
# File 'lib/stripe/resources/confirmation_token.rb', line 1893

def return_url
  @return_url
end

#setup_future_usageObject (readonly)

Indicates that you intend to make future payments with this ConfirmationToken's payment method.

The presence of this property will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete.



1897
1898
1899
# File 'lib/stripe/resources/confirmation_token.rb', line 1897

def setup_future_usage
  @setup_future_usage
end

#setup_intentObject (readonly)

ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used.



1899
1900
1901
# File 'lib/stripe/resources/confirmation_token.rb', line 1899

def setup_intent
  @setup_intent
end

#shippingObject (readonly)

Shipping information collected on this ConfirmationToken.



1901
1902
1903
# File 'lib/stripe/resources/confirmation_token.rb', line 1901

def shipping
  @shipping
end

#use_stripe_sdkObject (readonly)

Indicates whether the Stripe SDK is used to handle confirmation flow. Defaults to true on ConfirmationToken.



1903
1904
1905
# File 'lib/stripe/resources/confirmation_token.rb', line 1903

def use_stripe_sdk
  @use_stripe_sdk
end

Class Method Details

.field_remappingsObject



1935
1936
1937
# File 'lib/stripe/resources/confirmation_token.rb', line 1935

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



1926
1927
1928
1929
1930
1931
1932
1933
# File 'lib/stripe/resources/confirmation_token.rb', line 1926

def self.inner_class_types
  @inner_class_types = {
    mandate_data: MandateData,
    payment_method_options: PaymentMethodOptions,
    payment_method_preview: PaymentMethodPreview,
    shipping: Shipping,
  }
end

.object_nameObject



14
15
16
# File 'lib/stripe/resources/confirmation_token.rb', line 14

def self.object_name
  "confirmation_token"
end

Instance Method Details

#test_helpersObject



1905
1906
1907
# File 'lib/stripe/resources/confirmation_token.rb', line 1905

def test_helpers
  TestHelpers.new(self)
end