• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-go / 11296113556

11 Oct 2024 04:42PM UTC coverage: 62.991% (-0.02%) from 63.015%
11296113556

Pull #1934

github

stripe-openapi[bot]
Update generated code for v1291
Pull Request #1934: Update generated code for beta

0 of 8 new or added lines in 2 files covered. (0.0%)

469 existing lines in 20 files now uncovered.

6209 of 9857 relevant lines covered (62.99%)

15.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/forwarding_request.go
1
//
2
//
3
// File generated from our OpenAPI spec
4
//
5
//
6

7
package stripe
8

9
// The field kinds to be replaced in the forwarded request.
10
type ForwardingRequestReplacement string
11

12
// List of values that ForwardingRequestReplacement can take
13
const (
14
        ForwardingRequestReplacementCardCVC        ForwardingRequestReplacement = "card_cvc"
15
        ForwardingRequestReplacementCardExpiry     ForwardingRequestReplacement = "card_expiry"
16
        ForwardingRequestReplacementCardNumber     ForwardingRequestReplacement = "card_number"
17
        ForwardingRequestReplacementCardholderName ForwardingRequestReplacement = "cardholder_name"
18
)
19

20
// The HTTP method used to call the destination endpoint.
21
type ForwardingRequestRequestDetailsHTTPMethod string
22

23
// List of values that ForwardingRequestRequestDetailsHTTPMethod can take
24
const (
25
        ForwardingRequestRequestDetailsHTTPMethodPOST ForwardingRequestRequestDetailsHTTPMethod = "POST"
26
)
27

28
// Lists all ForwardingRequest objects.
29
type ForwardingRequestListParams struct {
30
        ListParams `form:"*"`
31
        // Similar to other List endpoints, filters results based on created timestamp. You can pass gt, gte, lt, and lte timestamp values.
32
        Created *RangeQueryParams `form:"created"`
33
        // Specifies which fields in the response should be expanded.
34
        Expand []*string `form:"expand"`
35
}
36

37
// AddExpand appends a new field to expand.
38
func (p *ForwardingRequestListParams) AddExpand(f string) {
×
39
        p.Expand = append(p.Expand, &f)
×
40
}
×
41

42
// The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included.
43
type ForwardingRequestRequestHeaderParams struct {
44
        // The header name.
45
        Name *string `form:"name"`
46
        // The header value.
47
        Value *string `form:"value"`
48
}
49

50
// The request body and headers to be sent to the destination endpoint.
51
type ForwardingRequestRequestParams struct {
52
        // The body payload to send to the destination endpoint.
53
        Body *string `form:"body"`
54
        // The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included.
55
        Headers []*ForwardingRequestRequestHeaderParams `form:"headers"`
56
}
57

58
// Creates a ForwardingRequest object.
59
type ForwardingRequestParams struct {
60
        Params `form:"*"`
61
        // Specifies which fields in the response should be expanded.
62
        Expand []*string `form:"expand"`
63
        // Set of [key-value pairs](https://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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
64
        Metadata map[string]string `form:"metadata"`
65
        // The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
66
        PaymentMethod *string `form:"payment_method"`
67
        // The field kinds to be replaced in the forwarded request.
68
        Replacements []*string `form:"replacements"`
69
        // The request body and headers to be sent to the destination endpoint.
70
        Request *ForwardingRequestRequestParams `form:"request"`
71
        // The destination URL for the forwarded request. Must be supported by the config.
72
        URL *string `form:"url"`
73
}
74

75
// AddExpand appends a new field to expand.
76
func (p *ForwardingRequestParams) AddExpand(f string) {
×
77
        p.Expand = append(p.Expand, &f)
×
78
}
×
79

80
// AddMetadata adds a new key-value pair to the Metadata.
NEW
81
func (p *ForwardingRequestParams) AddMetadata(key string, value string) {
×
NEW
82
        if p.Metadata == nil {
×
NEW
83
                p.Metadata = make(map[string]string)
×
NEW
84
        }
×
85

NEW
86
        p.Metadata[key] = value
×
87
}
88

89
// Context about the request from Stripe's servers to the destination endpoint.
90
type ForwardingRequestRequestContext struct {
91
        // The time it took in milliseconds for the destination endpoint to respond.
92
        DestinationDuration int64 `json:"destination_duration"`
93
        // The IP address of the destination.
94
        DestinationIPAddress string `json:"destination_ip_address"`
95
}
96

97
// The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included.
98
type ForwardingRequestRequestDetailsHeader struct {
99
        // The header name.
100
        Name string `json:"name"`
101
        // The header value.
102
        Value string `json:"value"`
103
}
104

105
// The request that was sent to the destination endpoint. We redact any sensitive fields.
106
type ForwardingRequestRequestDetails struct {
107
        // The body payload to send to the destination endpoint.
108
        Body string `json:"body"`
109
        // The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included.
110
        Headers []*ForwardingRequestRequestDetailsHeader `json:"headers"`
111
        // The HTTP method used to call the destination endpoint.
112
        HTTPMethod ForwardingRequestRequestDetailsHTTPMethod `json:"http_method"`
113
}
114

115
// HTTP headers that the destination endpoint returned.
116
type ForwardingRequestResponseDetailsHeader struct {
117
        // The header name.
118
        Name string `json:"name"`
119
        // The header value.
120
        Value string `json:"value"`
121
}
122

123
// The response that the destination endpoint returned to us. We redact any sensitive fields.
124
type ForwardingRequestResponseDetails struct {
125
        // The response body from the destination endpoint to Stripe.
126
        Body string `json:"body"`
127
        // HTTP headers that the destination endpoint returned.
128
        Headers []*ForwardingRequestResponseDetailsHeader `json:"headers"`
129
        // The HTTP status code that the destination endpoint returned.
130
        Status int64 `json:"status"`
131
}
132

133
// Instructs Stripe to make a request on your behalf using the destination URL. The destination URL
134
// is activated by Stripe at the time of onboarding. Stripe verifies requests with your credentials
135
// provided during onboarding, and injects card details from the payment_method into the request.
136
//
137
// Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers,
138
// before storing the request and response data in the forwarding Request object, which are subject to a
139
// 30-day retention period.
140
//
141
// You can provide a Stripe idempotency key to make sure that requests with the same key result in only one
142
// outbound request. The Stripe idempotency key provided should be unique and different from any idempotency
143
// keys provided on the underlying third-party request.
144
//
145
// Forwarding Requests are synchronous requests that return a response or time out according to
146
// Stripe's limits.
147
//
148
// Related guide: [Forward card details to third-party API endpoints](https://docs.stripe.com/payments/forwarding).
149
type ForwardingRequest struct {
150
        APIResource
151
        // Time at which the object was created. Measured in seconds since the Unix epoch.
152
        Created int64 `json:"created"`
153
        // Unique identifier for the object.
154
        ID string `json:"id"`
155
        // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
156
        Livemode bool `json:"livemode"`
157
        // Set of [key-value pairs](https://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.
158
        Metadata map[string]string `json:"metadata"`
159
        // String representing the object's type. Objects of the same type share the same value.
160
        Object string `json:"object"`
161
        // The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed.
162
        PaymentMethod string `json:"payment_method"`
163
        // The field kinds to be replaced in the forwarded request.
164
        Replacements []ForwardingRequestReplacement `json:"replacements"`
165
        // Context about the request from Stripe's servers to the destination endpoint.
166
        RequestContext *ForwardingRequestRequestContext `json:"request_context"`
167
        // The request that was sent to the destination endpoint. We redact any sensitive fields.
168
        RequestDetails *ForwardingRequestRequestDetails `json:"request_details"`
169
        // The response that the destination endpoint returned to us. We redact any sensitive fields.
170
        ResponseDetails *ForwardingRequestResponseDetails `json:"response_details"`
171
        // The destination URL for the forwarded request. Must be supported by the config.
172
        URL string `json:"url"`
173
}
174

175
// ForwardingRequestList is a list of Requests as retrieved from a list endpoint.
176
type ForwardingRequestList struct {
177
        APIResource
178
        ListMeta
179
        Data []*ForwardingRequest `json:"data"`
180
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc