prelude-sdk 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +37 -0
  3. data/README.md +1 -1
  4. data/lib/prelude_sdk/internal/transport/base_client.rb +5 -0
  5. data/lib/prelude_sdk/models/notify_send_batch_params.rb +13 -1
  6. data/lib/prelude_sdk/models/notify_send_params.rb +13 -38
  7. data/lib/prelude_sdk/models/transactional_send_params.rb +11 -1
  8. data/lib/prelude_sdk/models/verification_check_params.rb +44 -1
  9. data/lib/prelude_sdk/models/verification_check_response.rb +12 -3
  10. data/lib/prelude_sdk/models/verification_create_params.rb +82 -4
  11. data/lib/prelude_sdk/models/verification_create_response.rb +11 -4
  12. data/lib/prelude_sdk/models/watch_predict_params.rb +3 -3
  13. data/lib/prelude_sdk/models/watch_send_events_params.rb +22 -3
  14. data/lib/prelude_sdk/resources/notify.rb +6 -6
  15. data/lib/prelude_sdk/resources/transactional.rb +3 -1
  16. data/lib/prelude_sdk/resources/verification.rb +3 -1
  17. data/lib/prelude_sdk/resources/watch.rb +19 -6
  18. data/lib/prelude_sdk/version.rb +1 -1
  19. data/rbi/prelude_sdk/models/notify_send_batch_params.rbi +19 -0
  20. data/rbi/prelude_sdk/models/notify_send_params.rbi +19 -59
  21. data/rbi/prelude_sdk/models/transactional_send_params.rbi +15 -0
  22. data/rbi/prelude_sdk/models/verification_check_params.rbi +68 -0
  23. data/rbi/prelude_sdk/models/verification_check_response.rbi +19 -3
  24. data/rbi/prelude_sdk/models/verification_create_params.rbi +184 -3
  25. data/rbi/prelude_sdk/models/verification_create_response.rbi +21 -7
  26. data/rbi/prelude_sdk/models/watch_predict_params.rbi +3 -3
  27. data/rbi/prelude_sdk/models/watch_send_events_params.rbi +27 -3
  28. data/rbi/prelude_sdk/resources/notify.rbi +14 -9
  29. data/rbi/prelude_sdk/resources/transactional.rbi +5 -0
  30. data/rbi/prelude_sdk/resources/verification.rbi +6 -0
  31. data/rbi/prelude_sdk/resources/watch.rbi +19 -6
  32. data/sig/prelude_sdk/models/notify_send_batch_params.rbs +7 -0
  33. data/sig/prelude_sdk/models/notify_send_params.rbs +7 -26
  34. data/sig/prelude_sdk/models/transactional_send_params.rbs +7 -0
  35. data/sig/prelude_sdk/models/verification_check_params.rbs +31 -1
  36. data/sig/prelude_sdk/models/verification_check_response.rbs +8 -1
  37. data/sig/prelude_sdk/models/verification_create_params.rbs +38 -0
  38. data/sig/prelude_sdk/models/verification_create_response.rbs +2 -1
  39. data/sig/prelude_sdk/resources/notify.rbs +2 -2
  40. data/sig/prelude_sdk/resources/transactional.rbs +1 -0
  41. data/sig/prelude_sdk/resources/verification.rbs +1 -0
  42. metadata +2 -2
@@ -159,7 +159,7 @@ module PreludeSDK
159
159
  # Send transactional and marketing messages to your users via SMS, RCS and
160
160
  # WhatsApp with automatic compliance enforcement.
161
161
  #
162
- # @overload send_(template_id:, to:, callback_url: nil, context: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, text: nil, variables: nil, request_options: {})
162
+ # @overload send_(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, max_auto_retries: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
163
163
  #
164
164
  # @param template_id [String] The template identifier configured by your Customer Success team.
165
165
  #
@@ -167,8 +167,6 @@ module PreludeSDK
167
167
  #
168
168
  # @param callback_url [String] The URL where webhooks will be sent for message delivery events.
169
169
  #
170
- # @param context [PreludeSDK::Models::NotifySendParams::Context] Context for replying to an inbound message. When provided, the message is sent a
171
- #
172
170
  # @param correlation_id [String] A user-defined identifier to correlate this message with your internal systems.
173
171
  #
174
172
  # @param document [PreludeSDK::Models::NotifySendParams::Document] A media attachment to include in the message header. Supported on
@@ -179,12 +177,12 @@ module PreludeSDK
179
177
  #
180
178
  # @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
181
179
  #
180
+ # @param max_auto_retries [Integer] Maximum number of automatic retry attempts across channels for this send, in add
181
+ #
182
182
  # @param preferred_channel [Symbol, PreludeSDK::Models::NotifySendParams::PreferredChannel] The preferred channel to be used in priority for message delivery. If the channe
183
183
  #
184
184
  # @param schedule_at [Time] Schedule the message for future delivery in RFC3339 format. Marketing messages c
185
185
  #
186
- # @param text [String] The reply message body. Required when `context.reply_to` is provided. Used for 2
187
- #
188
186
  # @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
189
187
  #
190
188
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
@@ -208,7 +206,7 @@ module PreludeSDK
208
206
  #
209
207
  # Send the same message to multiple recipients in a single request.
210
208
  #
211
- # @overload send_batch(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
209
+ # @overload send_batch(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, max_auto_retries: nil, preferred_channel: nil, schedule_at: nil, variables: nil, request_options: {})
212
210
  #
213
211
  # @param template_id [String] The template identifier configured by your Customer Success team.
214
212
  #
@@ -226,6 +224,8 @@ module PreludeSDK
226
224
  #
227
225
  # @param locale [String] A BCP-47 formatted locale string.
228
226
  #
227
+ # @param max_auto_retries [Integer] Maximum number of automatic retry attempts across channels for each send in the
228
+ #
229
229
  # @param preferred_channel [Symbol, PreludeSDK::Models::NotifySendBatchParams::PreferredChannel] Preferred channel for delivery. If unavailable, automatic fallback applies.
230
230
  #
231
231
  # @param schedule_at [Time] Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply w
@@ -12,7 +12,7 @@ module PreludeSDK
12
12
  # Legacy route maintained for backward compatibility. Migrate to `/v2/notify`
13
13
  # instead.
14
14
  #
15
- # @overload send_(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, preferred_channel: nil, variables: nil, request_options: {})
15
+ # @overload send_(template_id:, to:, callback_url: nil, correlation_id: nil, document: nil, expires_at: nil, from: nil, locale: nil, max_auto_retries: nil, preferred_channel: nil, variables: nil, request_options: {})
16
16
  #
17
17
  # @param template_id [String] The template identifier.
18
18
  #
@@ -30,6 +30,8 @@ module PreludeSDK
30
30
  #
31
31
  # @param locale [String] A BCP-47 formatted locale string with the language the text message will be sent
32
32
  #
33
+ # @param max_auto_retries [Integer] Maximum number of automatic retry attempts across channels for this send, in add
34
+ #
33
35
  # @param preferred_channel [Symbol, PreludeSDK::Models::TransactionalSendParams::PreferredChannel] The preferred delivery channel for the message. When specified, the system will
34
36
  #
35
37
  # @param variables [Hash{Symbol=>String}] The variables to be replaced in the template.
@@ -44,12 +44,14 @@ module PreludeSDK
44
44
  #
45
45
  # Check the validity of a verification code.
46
46
  #
47
- # @overload check(code:, target:, request_options: {})
47
+ # @overload check(code:, target:, psd2: nil, request_options: {})
48
48
  #
49
49
  # @param code [String] The OTP code to validate.
50
50
  #
51
51
  # @param target [PreludeSDK::Models::VerificationCheckParams::Target] The verification target. Either a phone number or an email address. To use the e
52
52
  #
53
+ # @param psd2 [PreludeSDK::Models::VerificationCheckParams::Psd2] Required when checking a code issued under the `prelude:psd2` template. The subm
54
+ #
53
55
  # @param request_options [PreludeSDK::RequestOptions, Hash{Symbol=>Object}, nil]
54
56
  #
55
57
  # @return [PreludeSDK::Models::VerificationCheckResponse]
@@ -7,11 +7,16 @@ module PreludeSDK
7
7
  # Some parameter documentations has been truncated, see
8
8
  # {PreludeSDK::Models::WatchPredictParams} for more details.
9
9
  #
10
- # Predict the outcome of a verification based on Prelude’s anti-fraud system.
10
+ # At signup, score the user's phone number or email address (target) as legitimate
11
+ # or suspicious. Scoring-only — does not update counters by itself. When using
12
+ # Feedback, call predict before verification.started on the same target (and
13
+ # correlation_id when used) so feedback can warm Watch auth-start counters. Use
14
+ # Events for product fraud labels; use Feedback only if you run your own phone
15
+ # verification funnel outside Prelude Verify.
11
16
  #
12
17
  # @overload predict(target:, dispatch_id: nil, metadata: nil, signals: nil, request_options: {})
13
18
  #
14
- # @param target [PreludeSDK::Models::WatchPredictParams::Target] The prediction target. Only supports phone numbers for now.
19
+ # @param target [PreludeSDK::Models::WatchPredictParams::Target] The signup identifier to score — a phone number or email address.
15
20
  #
16
21
  # @param dispatch_id [String] The identifier of the dispatch that came from the front-end SDK.
17
22
  #
@@ -38,8 +43,11 @@ module PreludeSDK
38
43
  # Some parameter documentations has been truncated, see
39
44
  # {PreludeSDK::Models::WatchSendEventsParams} for more details.
40
45
  #
41
- # Send real-time event data from end-user interactions within your application.
42
- # Events will be analyzed for proactive fraud prevention and risk scoring.
46
+ # Send custom fraud signals from your application (labels and confidence levels).
47
+ # Events capture product-specific risk patterns and are weighted when scoring
48
+ # traffic. Use without Predict or Feedback if you only need to report product-side
49
+ # abuse (for example account.banned). Feedback is a separate, optional endpoint
50
+ # for self-hosted phone verification funnels.
43
51
  #
44
52
  # @overload send_events(events:, request_options: {})
45
53
  #
@@ -64,8 +72,13 @@ module PreludeSDK
64
72
  # Some parameter documentations has been truncated, see
65
73
  # {PreludeSDK::Models::WatchSendFeedbacksParams} for more details.
66
74
  #
67
- # Send feedback regarding your end-users verification funnel. Events will be
68
- # analyzed for proactive fraud prevention and risk scoring.
75
+ # Optional. Report verification-funnel steps (verification.started,
76
+ # verification.completed) when you run phone verification outside Prelude Verify.
77
+ # Feeds Watch abuse-rate counters for your own flow. Call Predict on the same
78
+ # target before verification.started and reuse metadata.correlation_id so
79
+ # auth-start counters receive predict signals; without a linked predict, only
80
+ # attempt-rate counters update on started. Not required if you only use Events
81
+ # and/or Predict, or if Verify already handles verification for that traffic.
69
82
  #
70
83
  # @overload send_feedbacks(feedbacks:, request_options: {})
71
84
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PreludeSDK
4
- VERSION = "0.4.0"
4
+ VERSION = "0.6.0"
5
5
  end
@@ -78,6 +78,17 @@ module PreludeSDK
78
78
  sig { params(locale: String).void }
79
79
  attr_writer :locale
80
80
 
81
+ # Maximum number of automatic retry attempts across channels for each send in the
82
+ # batch, in addition to the first attempt. For example, `2` allows up to 3 total
83
+ # delivery attempts per recipient. Lower values reduce delivery cost on
84
+ # hard-to-reach numbers at the expense of deliverability. When omitted, your
85
+ # account's configured default applies.
86
+ sig { returns(T.nilable(Integer)) }
87
+ attr_reader :max_auto_retries
88
+
89
+ sig { params(max_auto_retries: Integer).void }
90
+ attr_writer :max_auto_retries
91
+
81
92
  # Preferred channel for delivery. If unavailable, automatic fallback applies.
82
93
  sig do
83
94
  returns(
@@ -121,6 +132,7 @@ module PreludeSDK
121
132
  expires_at: Time,
122
133
  from: String,
123
134
  locale: String,
135
+ max_auto_retries: Integer,
124
136
  preferred_channel:
125
137
  PreludeSDK::NotifySendBatchParams::PreferredChannel::OrSymbol,
126
138
  schedule_at: Time,
@@ -155,6 +167,12 @@ module PreludeSDK
155
167
  from: nil,
156
168
  # A BCP-47 formatted locale string.
157
169
  locale: nil,
170
+ # Maximum number of automatic retry attempts across channels for each send in the
171
+ # batch, in addition to the first attempt. For example, `2` allows up to 3 total
172
+ # delivery attempts per recipient. Lower values reduce delivery cost on
173
+ # hard-to-reach numbers at the expense of deliverability. When omitted, your
174
+ # account's configured default applies.
175
+ max_auto_retries: nil,
158
176
  # Preferred channel for delivery. If unavailable, automatic fallback applies.
159
177
  preferred_channel: nil,
160
178
  # Schedule delivery in RFC3339 format. Marketing sends may be adjusted to comply
@@ -177,6 +195,7 @@ module PreludeSDK
177
195
  expires_at: Time,
178
196
  from: String,
179
197
  locale: String,
198
+ max_auto_retries: Integer,
180
199
  preferred_channel:
181
200
  PreludeSDK::NotifySendBatchParams::PreferredChannel::OrSymbol,
182
201
  schedule_at: Time,
@@ -26,16 +26,6 @@ module PreludeSDK
26
26
  sig { params(callback_url: String).void }
27
27
  attr_writer :callback_url
28
28
 
29
- # Context for replying to an inbound message. When provided, the message is sent
30
- # as a WhatsApp reply within the 24-hour conversation window.
31
- sig { returns(T.nilable(PreludeSDK::NotifySendParams::Context)) }
32
- attr_reader :context
33
-
34
- sig do
35
- params(context: PreludeSDK::NotifySendParams::Context::OrHash).void
36
- end
37
- attr_writer :context
38
-
39
29
  # A user-defined identifier to correlate this message with your internal systems.
40
30
  # It is returned in the response and any webhook events that refer to this
41
31
  # message.
@@ -88,6 +78,17 @@ module PreludeSDK
88
78
  sig { params(locale: String).void }
89
79
  attr_writer :locale
90
80
 
81
+ # Maximum number of automatic retry attempts across channels for this send, in
82
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
83
+ # attempts. Lower values reduce delivery cost on hard-to-reach numbers at the
84
+ # expense of deliverability. When omitted, your account's configured default
85
+ # applies.
86
+ sig { returns(T.nilable(Integer)) }
87
+ attr_reader :max_auto_retries
88
+
89
+ sig { params(max_auto_retries: Integer).void }
90
+ attr_writer :max_auto_retries
91
+
91
92
  # The preferred channel to be used in priority for message delivery. If the
92
93
  # channel is unavailable, the system will fallback to other available channels.
93
94
  sig do
@@ -114,15 +115,6 @@ module PreludeSDK
114
115
  sig { params(schedule_at: Time).void }
115
116
  attr_writer :schedule_at
116
117
 
117
- # The reply message body. Required when `context.reply_to` is provided. Used for
118
- # 2-way WhatsApp messaging to send free-form text replies within a conversation
119
- # window.
120
- sig { returns(T.nilable(String)) }
121
- attr_reader :text
122
-
123
- sig { params(text: String).void }
124
- attr_writer :text
125
-
126
118
  # The variables to be replaced in the template.
127
119
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
128
120
  attr_reader :variables
@@ -135,16 +127,15 @@ module PreludeSDK
135
127
  template_id: String,
136
128
  to: String,
137
129
  callback_url: String,
138
- context: PreludeSDK::NotifySendParams::Context::OrHash,
139
130
  correlation_id: String,
140
131
  document: PreludeSDK::NotifySendParams::Document::OrHash,
141
132
  expires_at: Time,
142
133
  from: String,
143
134
  locale: String,
135
+ max_auto_retries: Integer,
144
136
  preferred_channel:
145
137
  PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol,
146
138
  schedule_at: Time,
147
- text: String,
148
139
  variables: T::Hash[Symbol, String],
149
140
  request_options: PreludeSDK::RequestOptions::OrHash
150
141
  ).returns(T.attached_class)
@@ -156,9 +147,6 @@ module PreludeSDK
156
147
  to:,
157
148
  # The URL where webhooks will be sent for message delivery events.
158
149
  callback_url: nil,
159
- # Context for replying to an inbound message. When provided, the message is sent
160
- # as a WhatsApp reply within the 24-hour conversation window.
161
- context: nil,
162
150
  # A user-defined identifier to correlate this message with your internal systems.
163
151
  # It is returned in the response and any webhook events that refer to this
164
152
  # message.
@@ -184,6 +172,12 @@ module PreludeSDK
184
172
  # code of the phone number. If the language specified doesn't exist, the default
185
173
  # set on the template will be used.
186
174
  locale: nil,
175
+ # Maximum number of automatic retry attempts across channels for this send, in
176
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
177
+ # attempts. Lower values reduce delivery cost on hard-to-reach numbers at the
178
+ # expense of deliverability. When omitted, your account's configured default
179
+ # applies.
180
+ max_auto_retries: nil,
187
181
  # The preferred channel to be used in priority for message delivery. If the
188
182
  # channel is unavailable, the system will fallback to other available channels.
189
183
  preferred_channel: nil,
@@ -191,10 +185,6 @@ module PreludeSDK
191
185
  # can be scheduled up to 90 days in advance and will be automatically adjusted for
192
186
  # compliance with local time window restrictions.
193
187
  schedule_at: nil,
194
- # The reply message body. Required when `context.reply_to` is provided. Used for
195
- # 2-way WhatsApp messaging to send free-form text replies within a conversation
196
- # window.
197
- text: nil,
198
188
  # The variables to be replaced in the template.
199
189
  variables: nil,
200
190
  request_options: {}
@@ -207,16 +197,15 @@ module PreludeSDK
207
197
  template_id: String,
208
198
  to: String,
209
199
  callback_url: String,
210
- context: PreludeSDK::NotifySendParams::Context,
211
200
  correlation_id: String,
212
201
  document: PreludeSDK::NotifySendParams::Document,
213
202
  expires_at: Time,
214
203
  from: String,
215
204
  locale: String,
205
+ max_auto_retries: Integer,
216
206
  preferred_channel:
217
207
  PreludeSDK::NotifySendParams::PreferredChannel::OrSymbol,
218
208
  schedule_at: Time,
219
- text: String,
220
209
  variables: T::Hash[Symbol, String],
221
210
  request_options: PreludeSDK::RequestOptions
222
211
  }
@@ -225,35 +214,6 @@ module PreludeSDK
225
214
  def to_hash
226
215
  end
227
216
 
228
- class Context < PreludeSDK::Internal::Type::BaseModel
229
- OrHash =
230
- T.type_alias do
231
- T.any(
232
- PreludeSDK::NotifySendParams::Context,
233
- PreludeSDK::Internal::AnyHash
234
- )
235
- end
236
-
237
- # The inbound message ID (prefixed with `im_`) to reply to. This ID is provided in
238
- # the `inbound.message.received` webhook event.
239
- sig { returns(String) }
240
- attr_accessor :reply_to
241
-
242
- # Context for replying to an inbound message. When provided, the message is sent
243
- # as a WhatsApp reply within the 24-hour conversation window.
244
- sig { params(reply_to: String).returns(T.attached_class) }
245
- def self.new(
246
- # The inbound message ID (prefixed with `im_`) to reply to. This ID is provided in
247
- # the `inbound.message.received` webhook event.
248
- reply_to:
249
- )
250
- end
251
-
252
- sig { override.returns({ reply_to: String }) }
253
- def to_hash
254
- end
255
- end
256
-
257
217
  class Document < PreludeSDK::Internal::Type::BaseModel
258
218
  OrHash =
259
219
  T.type_alias do
@@ -82,6 +82,15 @@ module PreludeSDK
82
82
  sig { params(locale: String).void }
83
83
  attr_writer :locale
84
84
 
85
+ # Maximum number of automatic retry attempts across channels for this send, in
86
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
87
+ # attempts. When omitted, your account's configured default applies.
88
+ sig { returns(T.nilable(Integer)) }
89
+ attr_reader :max_auto_retries
90
+
91
+ sig { params(max_auto_retries: Integer).void }
92
+ attr_writer :max_auto_retries
93
+
85
94
  # The preferred delivery channel for the message. When specified, the system will
86
95
  # prioritize sending via the requested channel if the template is configured for
87
96
  # it.
@@ -125,6 +134,7 @@ module PreludeSDK
125
134
  expires_at: String,
126
135
  from: String,
127
136
  locale: String,
137
+ max_auto_retries: Integer,
128
138
  preferred_channel:
129
139
  PreludeSDK::TransactionalSendParams::PreferredChannel::OrSymbol,
130
140
  variables: T::Hash[Symbol, String],
@@ -162,6 +172,10 @@ module PreludeSDK
162
172
  # code of the phone number. If the language specified doesn't exist, the default
163
173
  # set on the template will be used.
164
174
  locale: nil,
175
+ # Maximum number of automatic retry attempts across channels for this send, in
176
+ # addition to the first attempt. For example, `2` allows up to 3 total delivery
177
+ # attempts. When omitted, your account's configured default applies.
178
+ max_auto_retries: nil,
165
179
  # The preferred delivery channel for the message. When specified, the system will
166
180
  # prioritize sending via the requested channel if the template is configured for
167
181
  # it.
@@ -189,6 +203,7 @@ module PreludeSDK
189
203
  expires_at: String,
190
204
  from: String,
191
205
  locale: String,
206
+ max_auto_retries: Integer,
192
207
  preferred_channel:
193
208
  PreludeSDK::TransactionalSendParams::PreferredChannel::OrSymbol,
194
209
  variables: T::Hash[Symbol, String],
@@ -28,10 +28,23 @@ module PreludeSDK
28
28
  end
29
29
  attr_writer :target
30
30
 
31
+ # Required when checking a code issued under the `prelude:psd2` template. The
32
+ # submitted variables must match those provided at issuance; any mismatch
33
+ # invalidates the code (PSD2 SCA RTS Article 5 dynamic linking). Ignored on
34
+ # non-PSD2 verifications.
35
+ sig { returns(T.nilable(PreludeSDK::VerificationCheckParams::Psd2)) }
36
+ attr_reader :psd2
37
+
38
+ sig do
39
+ params(psd2: PreludeSDK::VerificationCheckParams::Psd2::OrHash).void
40
+ end
41
+ attr_writer :psd2
42
+
31
43
  sig do
32
44
  params(
33
45
  code: String,
34
46
  target: PreludeSDK::VerificationCheckParams::Target::OrHash,
47
+ psd2: PreludeSDK::VerificationCheckParams::Psd2::OrHash,
35
48
  request_options: PreludeSDK::RequestOptions::OrHash
36
49
  ).returns(T.attached_class)
37
50
  end
@@ -41,6 +54,11 @@ module PreludeSDK
41
54
  # The verification target. Either a phone number or an email address. To use the
42
55
  # email verification feature contact us to discuss your use case.
43
56
  target:,
57
+ # Required when checking a code issued under the `prelude:psd2` template. The
58
+ # submitted variables must match those provided at issuance; any mismatch
59
+ # invalidates the code (PSD2 SCA RTS Article 5 dynamic linking). Ignored on
60
+ # non-PSD2 verifications.
61
+ psd2: nil,
44
62
  request_options: {}
45
63
  )
46
64
  end
@@ -50,6 +68,7 @@ module PreludeSDK
50
68
  {
51
69
  code: String,
52
70
  target: PreludeSDK::VerificationCheckParams::Target,
71
+ psd2: PreludeSDK::VerificationCheckParams::Psd2,
53
72
  request_options: PreludeSDK::RequestOptions
54
73
  }
55
74
  )
@@ -135,6 +154,55 @@ module PreludeSDK
135
154
  end
136
155
  end
137
156
  end
157
+
158
+ class Psd2 < PreludeSDK::Internal::Type::BaseModel
159
+ OrHash =
160
+ T.type_alias do
161
+ T.any(
162
+ PreludeSDK::VerificationCheckParams::Psd2,
163
+ PreludeSDK::Internal::AnyHash
164
+ )
165
+ end
166
+
167
+ # Decimal amount of the transaction.
168
+ sig { returns(String) }
169
+ attr_accessor :amount
170
+
171
+ # ISO 4217 currency code.
172
+ sig { returns(String) }
173
+ attr_accessor :currency
174
+
175
+ # Payee name displayed to the payer.
176
+ sig { returns(String) }
177
+ attr_accessor :recipient
178
+
179
+ # Required when checking a code issued under the `prelude:psd2` template. The
180
+ # submitted variables must match those provided at issuance; any mismatch
181
+ # invalidates the code (PSD2 SCA RTS Article 5 dynamic linking). Ignored on
182
+ # non-PSD2 verifications.
183
+ sig do
184
+ params(amount: String, currency: String, recipient: String).returns(
185
+ T.attached_class
186
+ )
187
+ end
188
+ def self.new(
189
+ # Decimal amount of the transaction.
190
+ amount:,
191
+ # ISO 4217 currency code.
192
+ currency:,
193
+ # Payee name displayed to the payer.
194
+ recipient:
195
+ )
196
+ end
197
+
198
+ sig do
199
+ override.returns(
200
+ { amount: String, currency: String, recipient: String }
201
+ )
202
+ end
203
+ def to_hash
204
+ end
205
+ end
138
206
  end
139
207
  end
140
208
  end
@@ -11,7 +11,9 @@ module PreludeSDK
11
11
  )
12
12
  end
13
13
 
14
- # The status of the check.
14
+ # The status of the check. For `prelude:psd2` codes, `transaction_missing` is
15
+ # returned when the `psd2` block is omitted, and `transaction_mismatch` when the
16
+ # submitted variables differ from those provided at issuance.
15
17
  sig do
16
18
  returns(
17
19
  PreludeSDK::Models::VerificationCheckResponse::Status::TaggedSymbol
@@ -59,7 +61,9 @@ module PreludeSDK
59
61
  ).returns(T.attached_class)
60
62
  end
61
63
  def self.new(
62
- # The status of the check.
64
+ # The status of the check. For `prelude:psd2` codes, `transaction_missing` is
65
+ # returned when the `psd2` block is omitted, and `transaction_mismatch` when the
66
+ # submitted variables differ from those provided at issuance.
63
67
  status:,
64
68
  # The verification identifier.
65
69
  id: nil,
@@ -83,7 +87,9 @@ module PreludeSDK
83
87
  def to_hash
84
88
  end
85
89
 
86
- # The status of the check.
90
+ # The status of the check. For `prelude:psd2` codes, `transaction_missing` is
91
+ # returned when the `psd2` block is omitted, and `transaction_mismatch` when the
92
+ # submitted variables differ from those provided at issuance.
87
93
  module Status
88
94
  extend PreludeSDK::Internal::Type::Enum
89
95
 
@@ -108,6 +114,16 @@ module PreludeSDK
108
114
  :expired_or_not_found,
109
115
  PreludeSDK::Models::VerificationCheckResponse::Status::TaggedSymbol
110
116
  )
117
+ TRANSACTION_MISSING =
118
+ T.let(
119
+ :transaction_missing,
120
+ PreludeSDK::Models::VerificationCheckResponse::Status::TaggedSymbol
121
+ )
122
+ TRANSACTION_MISMATCH =
123
+ T.let(
124
+ :transaction_mismatch,
125
+ PreludeSDK::Models::VerificationCheckResponse::Status::TaggedSymbol
126
+ )
111
127
 
112
128
  sig do
113
129
  override.returns(