Class: Stripe::Forwarding::Request

Inherits:
APIResource show all
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: CreateParams, ListParams, RequestContext, RequestDetails, ResponseDetails, RetrieveParams

Constant Summary collapse

OBJECT_NAME =
"forwarding.request"

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

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

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

included

Methods inherited from StripeObject

#==, #[], #[]=, 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

#createdObject (readonly)

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



195
196
197
# File 'lib/stripe/resources/forwarding/request.rb', line 195

def created
  @created
end

#idObject (readonly)

Unique identifier for the object.



198
199
200
# File 'lib/stripe/resources/forwarding/request.rb', line 198

def id
  @id
end

#livemodeObject (readonly)

Has the value ‘true` if the object exists in live mode or the value `false` if the object exists in test mode.



201
202
203
# File 'lib/stripe/resources/forwarding/request.rb', line 201

def livemode
  @livemode
end

#metadataObject (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.



204
205
206
# File 'lib/stripe/resources/forwarding/request.rb', line 204

def 
  @metadata
end

#objectObject (readonly)

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



207
208
209
# File 'lib/stripe/resources/forwarding/request.rb', line 207

def object
  @object
end

#payment_methodObject (readonly)

The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.



210
211
212
# File 'lib/stripe/resources/forwarding/request.rb', line 210

def payment_method
  @payment_method
end

#replacementsObject (readonly)

The field kinds to be replaced in the forwarded request.



213
214
215
# File 'lib/stripe/resources/forwarding/request.rb', line 213

def replacements
  @replacements
end

#request_contextObject (readonly)

Context about the request from Stripe’s servers to the destination endpoint.



216
217
218
# File 'lib/stripe/resources/forwarding/request.rb', line 216

def request_context
  @request_context
end

#request_detailsObject (readonly)

The request that was sent to the destination endpoint. We redact any sensitive fields.



219
220
221
# File 'lib/stripe/resources/forwarding/request.rb', line 219

def request_details
  @request_details
end

#response_detailsObject (readonly)

The response that the destination endpoint returned to us. We redact any sensitive fields.



222
223
224
# File 'lib/stripe/resources/forwarding/request.rb', line 222

def response_details
  @response_details
end

#urlObject (readonly)

The destination URL for the forwarded request. Must be supported by the config.



225
226
227
# File 'lib/stripe/resources/forwarding/request.rb', line 225

def url
  @url
end

Class Method Details

.create(params = {}, opts = {}) ⇒ Object

Creates a ForwardingRequest object.



228
229
230
231
232
233
234
235
# File 'lib/stripe/resources/forwarding/request.rb', line 228

def self.create(params = {}, opts = {})
  request_stripe_object(
    method: :post,
    path: "/v1/forwarding/requests",
    params: params,
    opts: opts
  )
end

.list(params = {}, opts = {}) ⇒ Object

Lists all ForwardingRequest objects.



238
239
240
241
242
243
244
245
# File 'lib/stripe/resources/forwarding/request.rb', line 238

def self.list(params = {}, opts = {})
  request_stripe_object(
    method: :get,
    path: "/v1/forwarding/requests",
    params: params,
    opts: opts
  )
end

.object_nameObject



27
28
29
# File 'lib/stripe/resources/forwarding/request.rb', line 27

def self.object_name
  "forwarding.request"
end