Class: Stripe::Forwarding::Request
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Forwarding::Request
- Extended by:
- APIOperations::Create, APIOperations::List
- Defined in:
- lib/stripe/resources/forwarding/request.rb
Overview
Instructs Stripe to make a request on your behalf using the destination URL. The destination URL is activated by Stripe at the time of onboarding. Stripe verifies requests with your credentials provided during onboarding, and injects card details from the payment_method into the request.
Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers, before storing the request and response data in the forwarding Request object, which are subject to a 30-day retention period.
You can provide a Stripe idempotency key to make sure that requests with the same key result in only one outbound request. The Stripe idempotency key provided should be unique and different from any idempotency keys provided on the underlying third-party request.
Forwarding Requests are synchronous requests that return a response or time out according to Stripe’s limits.
Related guide: [Forward card details to third-party API endpoints](docs.stripe.com/payments/forwarding).
Defined Under Namespace
Classes: RequestContext, RequestDetails, ResponseDetails
Constant Summary collapse
- OBJECT_NAME =
"forwarding.request"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#payment_method ⇒ Object
readonly
The PaymentMethod to insert into the forwarded request.
-
#replacements ⇒ Object
readonly
The field kinds to be replaced in the forwarded request.
-
#request_context ⇒ Object
readonly
Context about the request from Stripe’s servers to the destination endpoint.
-
#request_details ⇒ Object
readonly
The request that was sent to the destination endpoint.
-
#response_details ⇒ Object
readonly
The response that the destination endpoint returned to us.
-
#url ⇒ Object
readonly
The destination URL for the forwarded request.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.create(params = {}, opts = {}) ⇒ Object
Creates a ForwardingRequest object.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Lists all ForwardingRequest objects.
- .object_name ⇒ Object
Methods included from APIOperations::Create
Methods included from APIOperations::List
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
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #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
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
108 109 110 |
# File 'lib/stripe/resources/forwarding/request.rb', line 108 def created @created end |
#id ⇒ Object (readonly)
Unique identifier for the object.
110 111 112 |
# File 'lib/stripe/resources/forwarding/request.rb', line 110 def id @id end |
#livemode ⇒ Object (readonly)
Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.
112 113 114 |
# File 'lib/stripe/resources/forwarding/request.rb', line 112 def livemode @livemode end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
114 115 116 |
# File 'lib/stripe/resources/forwarding/request.rb', line 114 def @metadata end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
116 117 118 |
# File 'lib/stripe/resources/forwarding/request.rb', line 116 def object @object end |
#payment_method ⇒ Object (readonly)
The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
118 119 120 |
# File 'lib/stripe/resources/forwarding/request.rb', line 118 def payment_method @payment_method end |
#replacements ⇒ Object (readonly)
The field kinds to be replaced in the forwarded request.
120 121 122 |
# File 'lib/stripe/resources/forwarding/request.rb', line 120 def replacements @replacements end |
#request_context ⇒ Object (readonly)
Context about the request from Stripe’s servers to the destination endpoint.
122 123 124 |
# File 'lib/stripe/resources/forwarding/request.rb', line 122 def request_context @request_context end |
#request_details ⇒ Object (readonly)
The request that was sent to the destination endpoint. We redact any sensitive fields.
124 125 126 |
# File 'lib/stripe/resources/forwarding/request.rb', line 124 def request_details @request_details end |
#response_details ⇒ Object (readonly)
The response that the destination endpoint returned to us. We redact any sensitive fields.
126 127 128 |
# File 'lib/stripe/resources/forwarding/request.rb', line 126 def response_details @response_details end |
#url ⇒ Object (readonly)
The destination URL for the forwarded request. Must be supported by the config.
128 129 130 |
# File 'lib/stripe/resources/forwarding/request.rb', line 128 def url @url end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates a ForwardingRequest object.
131 132 133 134 135 136 137 138 |
# File 'lib/stripe/resources/forwarding/request.rb', line 131 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/forwarding/requests", params: params, opts: opts ) end |
.field_remappings ⇒ Object
158 159 160 |
# File 'lib/stripe/resources/forwarding/request.rb', line 158 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
150 151 152 153 154 155 156 |
# File 'lib/stripe/resources/forwarding/request.rb', line 150 def self.inner_class_types @inner_class_types = { request_context: RequestContext, request_details: RequestDetails, response_details: ResponseDetails, } end |
.list(params = {}, opts = {}) ⇒ Object
Lists all ForwardingRequest objects.
141 142 143 144 145 146 147 148 |
# File 'lib/stripe/resources/forwarding/request.rb', line 141 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/forwarding/requests", params: params, opts: opts ) end |
.object_name ⇒ Object
27 28 29 |
# File 'lib/stripe/resources/forwarding/request.rb', line 27 def self.object_name "forwarding.request" end |