Skip to main content

blockchyp/
models.rs

1// Copyright 2019-2026 BlockChyp, Inc. All rights reserved. Use of this code
2// is governed by a license that can be found in the LICENSE file.
3//
4// This file was generated automatically by the BlockChyp SDK Generator.
5// Changes to this file will be lost every time the code is regenerated.
6use std::collections::HashMap;
7use serde::{Deserialize, Serialize};
8use serde_json::{self, Value};
9use serde::de::DeserializeOwned;
10use chrono::{DateTime, Utc};
11
12// APICredentials models gateway credentials.
13#[derive(Debug, Default, Clone, Serialize, Deserialize)]
14pub struct APICredentials {
15    #[serde(rename = "apiKey")]
16	pub api_key: String,
17    #[serde(rename = "bearerToken")]
18    pub bearer_token: String,
19    #[serde(rename = "signingKey")]
20    pub signing_key: String,
21}
22
23// CardType is used to differentiate credit, debit, and EBT.
24#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
25#[serde(untagged)] 
26pub enum CardType {
27    #[default]
28    Credit,
29    Debit,
30    EBT,
31    BlockchainGift,
32    Healthcare,
33}
34
35// SignatureFormat is used to specify the output format for customer signature images.
36#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
37pub enum SignatureFormat {
38    #[serde(rename = "")]
39    #[default]
40    None,
41    #[serde(rename = "png")]
42    PNG,
43    #[serde(rename = "jpg")]
44    JPG,
45    #[serde(rename = "gif")]
46    GIF,
47}
48
49impl SignatureFormat {
50    // Function to get the string representation of each variant
51    pub fn as_str(&self) -> &'static str {
52        match self {
53            SignatureFormat::None => "",
54            SignatureFormat::PNG => "png",
55            SignatureFormat::JPG => "jpg",
56            SignatureFormat::GIF => "gif",
57        }
58    }
59}
60
61// CVMType designates a customer verification method.
62#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
63pub enum CVMType {
64    #[serde(rename = "Signature")]
65    Signature,
66    #[serde(rename = "Offline PIN")]
67    OfflinePIN,
68    #[serde(rename = "Online PIN")]
69    OnlinePIN,
70    #[serde(rename = "CDCVM")]
71    CDCVM,
72    #[serde(rename = "No CVM")]
73    NoCVM,
74    #[serde(other)]
75    #[default]
76    Default,
77}
78
79impl CVMType {
80    pub fn as_str(&self) -> &'static str {
81        match self {
82            CVMType::Signature => "Signature",
83            CVMType::OfflinePIN => "Offline PIN",
84            CVMType::OnlinePIN => "Online PIN",
85            CVMType::CDCVM => "CDCVM",
86            CVMType::NoCVM => "No CVM",
87            CVMType::Default => "",
88        }
89    }
90}
91
92// PromptType is used to specify the type of text input data being requested
93// from a customer.
94#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
95pub enum PromptType {
96    #[serde(rename = "amount")]
97    Amount,
98    #[serde(rename = "email")]
99    Email,
100    #[serde(rename = "phone")]
101    Phone,
102    #[serde(rename = "customer-number")]
103    CustomerNumber,
104    #[serde(rename = "rewards-number")]
105    RewardsNumber,
106    #[serde(rename = "first-name")]
107    FirstName,
108    #[serde(rename = "last-name")]
109    LastName,
110    #[serde(other)]
111    #[default]
112    Default,
113}
114
115impl PromptType {
116    // Function to get the string representation of each variant
117    pub fn as_str(&self) -> &'static str {
118        match self {
119            PromptType::Amount => "amount",
120            PromptType::Email => "email",
121            PromptType::Phone => "phone",
122            PromptType::CustomerNumber => "customer-number",
123            PromptType::RewardsNumber => "rewards-number",
124            PromptType::FirstName => "first-name",
125            PromptType::LastName => "last-name",
126            PromptType::Default => "",
127        }
128    }
129}
130
131// AVSResponse indicates the result of address verification.
132#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
133pub enum AVSResponse {
134    #[serde(rename = "")]
135    NotApplicable,
136    #[serde(rename = "not_supported")]
137    NotSupported,
138    #[serde(rename = "retry")]
139    Retry,
140    #[serde(rename = "no_match")]
141    NoMatch,
142    #[serde(rename = "address_match")]
143    AddressMatch,
144    #[serde(rename = "zip_match")]
145    PostalCodeMatch,
146    #[serde(rename = "match")]
147    AddressAndPostalCodeMatch,
148    #[serde(other)]
149    #[default]
150    Default,
151}
152
153impl AVSResponse {
154    // Function to get the string representation of each variant
155    pub fn as_str(&self) -> &'static str {
156        match self {
157            AVSResponse::NotApplicable => "",
158            AVSResponse::NotSupported => "not_supported",
159            AVSResponse::Retry => "retry",
160            AVSResponse::NoMatch => "no_match",
161            AVSResponse::AddressMatch => "address_match",
162            AVSResponse::PostalCodeMatch => "zip_match",
163            AVSResponse::AddressAndPostalCodeMatch => "match",
164            AVSResponse::Default => "",
165        }
166    }
167}
168
169// HealthcareType is a category of healthcare.
170#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
171pub enum HealthcareType {
172    Healthcare,
173    Prescription,
174    Vision,
175    Clinic,
176    Dental,
177    #[default]
178    Default,
179}
180
181impl HealthcareType {
182    // Function to get the string representation of each variant
183    pub fn as_str(&self) -> &'static str {
184        match self {
185            HealthcareType::Healthcare => "healthcare",
186            HealthcareType::Prescription => "prescription",
187            HealthcareType::Vision => "vision",
188            HealthcareType::Clinic => "clinic",
189            HealthcareType::Dental => "dental",
190            HealthcareType::Default => "",
191        }
192    }
193}
194
195// RoundingMode indicates how partial penny rounding operations should work
196#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
197pub enum RoundingMode {
198    Up,
199    Nearest,
200    Down,
201    #[default]
202    Default,
203}
204
205impl RoundingMode {
206    // Function to get the string representation of each variant
207    pub fn as_str(&self) -> &'static str {
208        match self {
209            RoundingMode::Up => "up",
210            RoundingMode::Nearest => "nearest",
211            RoundingMode::Down => "down",
212            RoundingMode::Default => "",
213        }
214    }
215}
216
217
218/// EMV fields we recommend developers put on their receipts.
219#[derive(Debug, Default, Clone, Serialize, Deserialize)]
220pub struct ReceiptSuggestions {
221    /// The EMV Application Identifier.
222    #[serde(rename = "aid", default)]
223    pub aid: String,
224    /// The EMV Application Request Cryptogram.
225    #[serde(rename = "arqc", default)]
226    pub arqc: String,
227    /// The EMV Issuer Application Data.
228    #[serde(rename = "iad", default)]
229    pub iad: String,
230    /// The EMV Authorization Response Code.
231    #[serde(rename = "arc", default)]
232    pub arc: String,
233    /// The EMV Transaction Certificate.
234    #[serde(rename = "tc", default)]
235    pub tc: String,
236    /// The EMV Terminal Verification Response.
237    #[serde(rename = "tvr", default)]
238    pub tvr: String,
239    /// The EMV Transaction Status Indicator.
240    #[serde(rename = "tsi", default)]
241    pub tsi: String,
242    /// The ID of the payment terminal.
243    #[serde(rename = "terminalId", default)]
244    pub terminal_id: String,
245    /// The name of the merchant's business.
246    #[serde(rename = "merchantName", default)]
247    pub merchant_name: String,
248    /// The ID of the merchant.
249    #[serde(rename = "merchantId", default)]
250    pub merchant_id: String,
251    /// The partially masked merchant key required on EMV receipts.
252    #[serde(rename = "merchantKey", default)]
253    pub merchant_key: String,
254    /// A description of the selected AID.
255    #[serde(rename = "applicationLabel", default)]
256    pub application_label: String,
257    /// That the receipt should contain a signature line.
258    #[serde(rename = "requestSignature")]
259    pub request_signature: bool,
260    /// The masked primary account number of the payment card, as required.
261    #[serde(rename = "maskedPan", default)]
262    pub masked_pan: String,
263    /// The amount authorized by the payment network. Could be less than the requested amount
264/// for partial auth.
265    #[serde(rename = "authorizedAmount")]
266    pub authorized_amount: String,
267    /// The type of transaction performed (CHARGE, PREAUTH, REFUND, etc).
268    #[serde(rename = "transactionType")]
269    pub transaction_type: String,
270    /// The method by which the payment card was entered (MSR, CHIP, KEYED, etc.).
271    #[serde(rename = "entryMethod", default)]
272    pub entry_method: String,
273    /// That PIN verification was performed.
274    #[serde(rename = "pinVerified", default)]
275    pub pin_verified: bool,
276    /// The customer verification method used for the transaction.
277    #[serde(rename = "cvmUsed", default)]
278    pub cvm_used: CVMType,
279    /// That a chip read failure caused the transaction to fall back to the magstripe.
280    #[serde(rename = "fallback", default)]
281    pub fallback: bool,
282    /// The sequence of the transaction in the batch.
283    #[serde(rename = "batchSequence", default)]
284    pub batch_sequence: i32,
285    /// The amount of cash back that was approved.
286    #[serde(rename = "cashBackAmount", default)]
287    pub cash_back_amount: String,
288    /// The amount added to the transaction to cover eligible credit card fees.
289    #[serde(rename = "surcharge", default)]
290    pub surcharge: String,
291    /// The discount applied to the transaction for payment methods ineligible for
292/// surcharges.
293    #[serde(rename = "cashDiscount", default)]
294    pub cash_discount: String,
295
296}
297
298/// A basic api acknowledgement.
299#[derive(Debug, Default, Clone, Serialize, Deserialize)]
300pub struct Acknowledgement {
301    /// Whether or not the request succeeded.
302    #[serde(rename = "success")]
303    pub success: bool,
304    /// The error, if an error occurred.
305    #[serde(rename = "error")]
306    pub error: String,
307    /// A narrative description of the transaction result.
308    #[serde(rename = "responseDescription")]
309    pub response_description: String,
310
311}
312
313/// A request for customer signature data.
314#[derive(Debug, Default, Clone, Serialize, Deserialize)]
315pub struct CaptureSignatureRequest {
316    /// The request timeout in seconds.
317    #[serde(rename = "timeout")]
318    pub timeout: i32,
319    /// Whether or not to route transaction to the test gateway.
320    #[serde(rename = "test")]
321    pub test: bool,
322    /// A user-assigned reference that can be used to recall or reverse transactions.
323    #[serde(rename = "transactionRef", default)]
324    pub transaction_ref: String,
325    /// That the transaction reference was autogenerated and should be ignored for the
326/// purposes of duplicate detection.
327    #[serde(rename = "autogeneratedRef")]
328    pub autogenerated_ref: bool,
329    /// Defers the response to the transaction and returns immediately. Callers should
330/// retrive the transaction result using the Transaction Status API.
331    #[serde(rename = "async")]
332    pub async_yo: bool,
333    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
334/// transaction result using the Transaction Status API.
335    #[serde(rename = "queue")]
336    pub queue: bool,
337    /// Whether or not the request should block until all cards have been removed from the card
338/// reader.
339    #[serde(rename = "waitForRemovedCard", default)]
340    pub wait_for_removed_card: bool,
341    /// Override any in-progress transactions.
342    #[serde(rename = "force", default)]
343    pub force: bool,
344    /// An identifier from an external point of sale system.
345    #[serde(rename = "orderRef", default)]
346    pub order_ref: String,
347    /// The settlement account for merchants with split settlements.
348    #[serde(rename = "destinationAccount", default)]
349    pub destination_account: String,
350    /// Can include a code used to trigger simulated conditions for the purposes of testing and
351/// certification. Valid for test merchant accounts only.
352    #[serde(rename = "testCase", default)]
353    pub test_case: String,
354    /// A location on the filesystem which a customer signature should be written to.
355    #[serde(rename = "sigFile", default)]
356    pub sig_file: String,
357    /// The image format to be used for returning signatures.
358    #[serde(rename = "sigFormat", default)]
359    pub sig_format: SignatureFormat,
360    /// The width that the signature image should be scaled to, preserving the aspect ratio. If
361/// not provided, the signature is returned in the terminal's max resolution.
362    #[serde(rename = "sigWidth", default)]
363    pub sig_width: i32,
364    /// Whether or not signature prompt should be skipped on the terminal. The terminal will
365/// indicate whether or not a signature is required by the card in the receipt suggestions
366/// response.
367    #[serde(rename = "disableSignature", default)]
368    pub disable_signature: bool,
369    /// The name of the target payment terminal.
370    #[serde(rename = "terminalName", default)]
371    pub terminal_name: String,
372    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
373/// This is a diagnostic settings that can be used only for test transactions.
374    #[serde(rename = "resetConnection")]
375    pub reset_connection: bool,
376
377}
378
379/// Customer signature data.
380#[derive(Debug, Default, Clone, Serialize, Deserialize)]
381pub struct CaptureSignatureResponse {
382    /// Whether or not the request succeeded.
383    #[serde(rename = "success")]
384    pub success: bool,
385    /// The error, if an error occurred.
386    #[serde(rename = "error")]
387    pub error: String,
388    /// A narrative description of the transaction result.
389    #[serde(rename = "responseDescription")]
390    pub response_description: String,
391    /// The hex encoded signature data.
392    #[serde(rename = "sigFile", default)]
393    pub sig_file: String,
394
395}
396
397/// Information needed to test connectivity with a terminal.
398#[derive(Debug, Default, Clone, Serialize, Deserialize)]
399pub struct PingRequest {
400    /// The request timeout in seconds.
401    #[serde(rename = "timeout")]
402    pub timeout: i32,
403    /// Whether or not to route transaction to the test gateway.
404    #[serde(rename = "test")]
405    pub test: bool,
406    /// A user-assigned reference that can be used to recall or reverse transactions.
407    #[serde(rename = "transactionRef", default)]
408    pub transaction_ref: String,
409    /// That the transaction reference was autogenerated and should be ignored for the
410/// purposes of duplicate detection.
411    #[serde(rename = "autogeneratedRef")]
412    pub autogenerated_ref: bool,
413    /// Defers the response to the transaction and returns immediately. Callers should
414/// retrive the transaction result using the Transaction Status API.
415    #[serde(rename = "async")]
416    pub async_yo: bool,
417    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
418/// transaction result using the Transaction Status API.
419    #[serde(rename = "queue")]
420    pub queue: bool,
421    /// Whether or not the request should block until all cards have been removed from the card
422/// reader.
423    #[serde(rename = "waitForRemovedCard", default)]
424    pub wait_for_removed_card: bool,
425    /// Override any in-progress transactions.
426    #[serde(rename = "force", default)]
427    pub force: bool,
428    /// An identifier from an external point of sale system.
429    #[serde(rename = "orderRef", default)]
430    pub order_ref: String,
431    /// The settlement account for merchants with split settlements.
432    #[serde(rename = "destinationAccount", default)]
433    pub destination_account: String,
434    /// Can include a code used to trigger simulated conditions for the purposes of testing and
435/// certification. Valid for test merchant accounts only.
436    #[serde(rename = "testCase", default)]
437    pub test_case: String,
438    /// The name of the target payment terminal.
439    #[serde(rename = "terminalName", default)]
440    pub terminal_name: String,
441    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
442/// This is a diagnostic settings that can be used only for test transactions.
443    #[serde(rename = "resetConnection")]
444    pub reset_connection: bool,
445
446}
447
448/// The response to a ping request.
449#[derive(Debug, Default, Clone, Serialize, Deserialize)]
450pub struct PingResponse {
451    /// Whether or not the request succeeded.
452    #[serde(rename = "success")]
453    pub success: bool,
454    /// The error, if an error occurred.
455    #[serde(rename = "error")]
456    pub error: String,
457    /// A narrative description of the transaction result.
458    #[serde(rename = "responseDescription")]
459    pub response_description: String,
460    /// The ID assigned to the transaction.
461    #[serde(rename = "transactionId")]
462    pub transaction_id: String,
463    /// The ID assigned to the batch.
464    #[serde(rename = "batchId", default)]
465    pub batch_id: String,
466    /// The transaction reference string assigned to the transaction request. If no
467/// transaction ref was assiged on the request, then the gateway will randomly generate
468/// one.
469    #[serde(rename = "transactionRef", default)]
470    pub transaction_ref: String,
471    /// The type of transaction.
472    #[serde(rename = "transactionType")]
473    pub transaction_type: String,
474    /// The timestamp of the transaction.
475    #[serde(rename = "timestamp")]
476    pub timestamp: String,
477    /// The hash of the last tick block.
478    #[serde(rename = "tickBlock")]
479    pub tick_block: String,
480    /// That the transaction was processed on the test gateway.
481    #[serde(rename = "test")]
482    pub test: bool,
483    /// The settlement account for merchants with split settlements.
484    #[serde(rename = "destinationAccount", default)]
485    pub destination_account: String,
486    /// The ECC signature of the response. Can be used to ensure that it was signed by the
487/// terminal and detect man-in-the middle attacks.
488    #[serde(rename = "sig", default)]
489    pub sig: String,
490
491}
492
493/// Information needed to retrieve location information for a terminal.
494#[derive(Debug, Default, Clone, Serialize, Deserialize)]
495pub struct LocateRequest {
496    /// The request timeout in seconds.
497    #[serde(rename = "timeout")]
498    pub timeout: i32,
499    /// Whether or not to route transaction to the test gateway.
500    #[serde(rename = "test")]
501    pub test: bool,
502    /// A user-assigned reference that can be used to recall or reverse transactions.
503    #[serde(rename = "transactionRef", default)]
504    pub transaction_ref: String,
505    /// That the transaction reference was autogenerated and should be ignored for the
506/// purposes of duplicate detection.
507    #[serde(rename = "autogeneratedRef")]
508    pub autogenerated_ref: bool,
509    /// Defers the response to the transaction and returns immediately. Callers should
510/// retrive the transaction result using the Transaction Status API.
511    #[serde(rename = "async")]
512    pub async_yo: bool,
513    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
514/// transaction result using the Transaction Status API.
515    #[serde(rename = "queue")]
516    pub queue: bool,
517    /// Whether or not the request should block until all cards have been removed from the card
518/// reader.
519    #[serde(rename = "waitForRemovedCard", default)]
520    pub wait_for_removed_card: bool,
521    /// Override any in-progress transactions.
522    #[serde(rename = "force", default)]
523    pub force: bool,
524    /// An identifier from an external point of sale system.
525    #[serde(rename = "orderRef", default)]
526    pub order_ref: String,
527    /// The settlement account for merchants with split settlements.
528    #[serde(rename = "destinationAccount", default)]
529    pub destination_account: String,
530    /// Can include a code used to trigger simulated conditions for the purposes of testing and
531/// certification. Valid for test merchant accounts only.
532    #[serde(rename = "testCase", default)]
533    pub test_case: String,
534    /// The name of the target payment terminal.
535    #[serde(rename = "terminalName", default)]
536    pub terminal_name: String,
537    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
538/// This is a diagnostic settings that can be used only for test transactions.
539    #[serde(rename = "resetConnection")]
540    pub reset_connection: bool,
541
542}
543
544/// The response to a locate request.
545#[derive(Debug, Default, Clone, Serialize, Deserialize)]
546pub struct LocateResponse {
547    /// Whether or not the request succeeded.
548    #[serde(rename = "success")]
549    pub success: bool,
550    /// The error, if an error occurred.
551    #[serde(rename = "error")]
552    pub error: String,
553    /// A narrative description of the transaction result.
554    #[serde(rename = "responseDescription")]
555    pub response_description: String,
556    /// The ID assigned to the transaction.
557    #[serde(rename = "transactionId")]
558    pub transaction_id: String,
559    /// The ID assigned to the batch.
560    #[serde(rename = "batchId", default)]
561    pub batch_id: String,
562    /// The transaction reference string assigned to the transaction request. If no
563/// transaction ref was assiged on the request, then the gateway will randomly generate
564/// one.
565    #[serde(rename = "transactionRef", default)]
566    pub transaction_ref: String,
567    /// The type of transaction.
568    #[serde(rename = "transactionType")]
569    pub transaction_type: String,
570    /// The timestamp of the transaction.
571    #[serde(rename = "timestamp")]
572    pub timestamp: String,
573    /// The hash of the last tick block.
574    #[serde(rename = "tickBlock")]
575    pub tick_block: String,
576    /// That the transaction was processed on the test gateway.
577    #[serde(rename = "test")]
578    pub test: bool,
579    /// The settlement account for merchants with split settlements.
580    #[serde(rename = "destinationAccount", default)]
581    pub destination_account: String,
582    /// The ECC signature of the response. Can be used to ensure that it was signed by the
583/// terminal and detect man-in-the middle attacks.
584    #[serde(rename = "sig", default)]
585    pub sig: String,
586    /// The name assigned to the terminal at activation.
587    #[serde(rename = "terminalName")]
588    pub terminal_name: String,
589    /// The local IP address of the terminal.
590    #[serde(rename = "ipAddress")]
591    pub ip_address: String,
592    /// Whether or not the terminal is running in cloud relay mode.
593    #[serde(rename = "cloudRelay")]
594    pub cloud_relay: bool,
595    /// The terminal's public key.
596    #[serde(rename = "publicKey")]
597    pub public_key: String,
598
599}
600
601/// A message to be displayed on the terminal screen.
602#[derive(Debug, Default, Clone, Serialize, Deserialize)]
603pub struct MessageRequest {
604    /// The request timeout in seconds.
605    #[serde(rename = "timeout")]
606    pub timeout: i32,
607    /// Whether or not to route transaction to the test gateway.
608    #[serde(rename = "test")]
609    pub test: bool,
610    /// A user-assigned reference that can be used to recall or reverse transactions.
611    #[serde(rename = "transactionRef", default)]
612    pub transaction_ref: String,
613    /// That the transaction reference was autogenerated and should be ignored for the
614/// purposes of duplicate detection.
615    #[serde(rename = "autogeneratedRef")]
616    pub autogenerated_ref: bool,
617    /// Defers the response to the transaction and returns immediately. Callers should
618/// retrive the transaction result using the Transaction Status API.
619    #[serde(rename = "async")]
620    pub async_yo: bool,
621    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
622/// transaction result using the Transaction Status API.
623    #[serde(rename = "queue")]
624    pub queue: bool,
625    /// Whether or not the request should block until all cards have been removed from the card
626/// reader.
627    #[serde(rename = "waitForRemovedCard", default)]
628    pub wait_for_removed_card: bool,
629    /// Override any in-progress transactions.
630    #[serde(rename = "force", default)]
631    pub force: bool,
632    /// An identifier from an external point of sale system.
633    #[serde(rename = "orderRef", default)]
634    pub order_ref: String,
635    /// The settlement account for merchants with split settlements.
636    #[serde(rename = "destinationAccount", default)]
637    pub destination_account: String,
638    /// Can include a code used to trigger simulated conditions for the purposes of testing and
639/// certification. Valid for test merchant accounts only.
640    #[serde(rename = "testCase", default)]
641    pub test_case: String,
642    /// The name of the target payment terminal.
643    #[serde(rename = "terminalName", default)]
644    pub terminal_name: String,
645    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
646/// This is a diagnostic settings that can be used only for test transactions.
647    #[serde(rename = "resetConnection")]
648    pub reset_connection: bool,
649    /// The message to be displayed on the terminal.
650    #[serde(rename = "message")]
651    pub message: String,
652
653}
654
655/// A simple yes no prompt request.
656#[derive(Debug, Default, Clone, Serialize, Deserialize)]
657pub struct BooleanPromptRequest {
658    /// The request timeout in seconds.
659    #[serde(rename = "timeout")]
660    pub timeout: i32,
661    /// Whether or not to route transaction to the test gateway.
662    #[serde(rename = "test")]
663    pub test: bool,
664    /// A user-assigned reference that can be used to recall or reverse transactions.
665    #[serde(rename = "transactionRef", default)]
666    pub transaction_ref: String,
667    /// That the transaction reference was autogenerated and should be ignored for the
668/// purposes of duplicate detection.
669    #[serde(rename = "autogeneratedRef")]
670    pub autogenerated_ref: bool,
671    /// Defers the response to the transaction and returns immediately. Callers should
672/// retrive the transaction result using the Transaction Status API.
673    #[serde(rename = "async")]
674    pub async_yo: bool,
675    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
676/// transaction result using the Transaction Status API.
677    #[serde(rename = "queue")]
678    pub queue: bool,
679    /// Whether or not the request should block until all cards have been removed from the card
680/// reader.
681    #[serde(rename = "waitForRemovedCard", default)]
682    pub wait_for_removed_card: bool,
683    /// Override any in-progress transactions.
684    #[serde(rename = "force", default)]
685    pub force: bool,
686    /// An identifier from an external point of sale system.
687    #[serde(rename = "orderRef", default)]
688    pub order_ref: String,
689    /// The settlement account for merchants with split settlements.
690    #[serde(rename = "destinationAccount", default)]
691    pub destination_account: String,
692    /// Can include a code used to trigger simulated conditions for the purposes of testing and
693/// certification. Valid for test merchant accounts only.
694    #[serde(rename = "testCase", default)]
695    pub test_case: String,
696    /// The name of the target payment terminal.
697    #[serde(rename = "terminalName", default)]
698    pub terminal_name: String,
699    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
700/// This is a diagnostic settings that can be used only for test transactions.
701    #[serde(rename = "resetConnection")]
702    pub reset_connection: bool,
703    /// The preferred caption for the 'yes' button.
704    #[serde(rename = "yesCaption")]
705    pub yes_caption: String,
706    /// The preferred caption for the 'no' button.
707    #[serde(rename = "noCaption")]
708    pub no_caption: String,
709    /// The text to be displayed on the terminal.
710    #[serde(rename = "prompt")]
711    pub prompt: String,
712
713}
714
715/// A text prompt request.
716#[derive(Debug, Default, Clone, Serialize, Deserialize)]
717pub struct TextPromptRequest {
718    /// The request timeout in seconds.
719    #[serde(rename = "timeout")]
720    pub timeout: i32,
721    /// Whether or not to route transaction to the test gateway.
722    #[serde(rename = "test")]
723    pub test: bool,
724    /// A user-assigned reference that can be used to recall or reverse transactions.
725    #[serde(rename = "transactionRef", default)]
726    pub transaction_ref: String,
727    /// That the transaction reference was autogenerated and should be ignored for the
728/// purposes of duplicate detection.
729    #[serde(rename = "autogeneratedRef")]
730    pub autogenerated_ref: bool,
731    /// Defers the response to the transaction and returns immediately. Callers should
732/// retrive the transaction result using the Transaction Status API.
733    #[serde(rename = "async")]
734    pub async_yo: bool,
735    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
736/// transaction result using the Transaction Status API.
737    #[serde(rename = "queue")]
738    pub queue: bool,
739    /// Whether or not the request should block until all cards have been removed from the card
740/// reader.
741    #[serde(rename = "waitForRemovedCard", default)]
742    pub wait_for_removed_card: bool,
743    /// Override any in-progress transactions.
744    #[serde(rename = "force", default)]
745    pub force: bool,
746    /// An identifier from an external point of sale system.
747    #[serde(rename = "orderRef", default)]
748    pub order_ref: String,
749    /// The settlement account for merchants with split settlements.
750    #[serde(rename = "destinationAccount", default)]
751    pub destination_account: String,
752    /// Can include a code used to trigger simulated conditions for the purposes of testing and
753/// certification. Valid for test merchant accounts only.
754    #[serde(rename = "testCase", default)]
755    pub test_case: String,
756    /// The name of the target payment terminal.
757    #[serde(rename = "terminalName", default)]
758    pub terminal_name: String,
759    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
760/// This is a diagnostic settings that can be used only for test transactions.
761    #[serde(rename = "resetConnection")]
762    pub reset_connection: bool,
763    /// The prompt type (email, phone, etc).
764    #[serde(rename = "promptType")]
765    pub prompt_type: PromptType,
766
767}
768
769/// Models a customer data request.
770#[derive(Debug, Default, Clone, Serialize, Deserialize)]
771pub struct CustomerRequest {
772    /// The request timeout in seconds.
773    #[serde(rename = "timeout")]
774    pub timeout: i32,
775    /// Whether or not to route transaction to the test gateway.
776    #[serde(rename = "test")]
777    pub test: bool,
778    /// A user-assigned reference that can be used to recall or reverse transactions.
779    #[serde(rename = "transactionRef", default)]
780    pub transaction_ref: String,
781    /// That the transaction reference was autogenerated and should be ignored for the
782/// purposes of duplicate detection.
783    #[serde(rename = "autogeneratedRef")]
784    pub autogenerated_ref: bool,
785    /// Defers the response to the transaction and returns immediately. Callers should
786/// retrive the transaction result using the Transaction Status API.
787    #[serde(rename = "async")]
788    pub async_yo: bool,
789    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
790/// transaction result using the Transaction Status API.
791    #[serde(rename = "queue")]
792    pub queue: bool,
793    /// Whether or not the request should block until all cards have been removed from the card
794/// reader.
795    #[serde(rename = "waitForRemovedCard", default)]
796    pub wait_for_removed_card: bool,
797    /// Override any in-progress transactions.
798    #[serde(rename = "force", default)]
799    pub force: bool,
800    /// An identifier from an external point of sale system.
801    #[serde(rename = "orderRef", default)]
802    pub order_ref: String,
803    /// The settlement account for merchants with split settlements.
804    #[serde(rename = "destinationAccount", default)]
805    pub destination_account: String,
806    /// Can include a code used to trigger simulated conditions for the purposes of testing and
807/// certification. Valid for test merchant accounts only.
808    #[serde(rename = "testCase", default)]
809    pub test_case: String,
810    /// BlockChyp assigned customer id.
811    #[serde(rename = "customerId")]
812    pub customer_id: String,
813    /// Optional customer ref that can be used for the client's system's customer id.
814    #[serde(rename = "customerRef")]
815    pub customer_ref: String,
816
817}
818
819/// Models a customer data response.
820#[derive(Debug, Default, Clone, Serialize, Deserialize)]
821pub struct CustomerResponse {
822    /// Whether or not the request succeeded.
823    #[serde(rename = "success")]
824    pub success: bool,
825    /// The error, if an error occurred.
826    #[serde(rename = "error")]
827    pub error: String,
828    /// A narrative description of the transaction result.
829    #[serde(rename = "responseDescription")]
830    pub response_description: String,
831    /// The customer record.
832    #[serde(rename = "customer")]
833    pub customer: Option<Customer>,
834
835}
836
837/// Models a customer data search request.
838#[derive(Debug, Default, Clone, Serialize, Deserialize)]
839pub struct CustomerSearchRequest {
840    /// The request timeout in seconds.
841    #[serde(rename = "timeout")]
842    pub timeout: i32,
843    /// Whether or not to route transaction to the test gateway.
844    #[serde(rename = "test")]
845    pub test: bool,
846    /// A user-assigned reference that can be used to recall or reverse transactions.
847    #[serde(rename = "transactionRef", default)]
848    pub transaction_ref: String,
849    /// That the transaction reference was autogenerated and should be ignored for the
850/// purposes of duplicate detection.
851    #[serde(rename = "autogeneratedRef")]
852    pub autogenerated_ref: bool,
853    /// Defers the response to the transaction and returns immediately. Callers should
854/// retrive the transaction result using the Transaction Status API.
855    #[serde(rename = "async")]
856    pub async_yo: bool,
857    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
858/// transaction result using the Transaction Status API.
859    #[serde(rename = "queue")]
860    pub queue: bool,
861    /// Whether or not the request should block until all cards have been removed from the card
862/// reader.
863    #[serde(rename = "waitForRemovedCard", default)]
864    pub wait_for_removed_card: bool,
865    /// Override any in-progress transactions.
866    #[serde(rename = "force", default)]
867    pub force: bool,
868    /// An identifier from an external point of sale system.
869    #[serde(rename = "orderRef", default)]
870    pub order_ref: String,
871    /// The settlement account for merchants with split settlements.
872    #[serde(rename = "destinationAccount", default)]
873    pub destination_account: String,
874    /// Can include a code used to trigger simulated conditions for the purposes of testing and
875/// certification. Valid for test merchant accounts only.
876    #[serde(rename = "testCase", default)]
877    pub test_case: String,
878    /// Search query for customer searches.
879    #[serde(rename = "query")]
880    pub query: String,
881
882}
883
884/// Models a customer data search request.
885#[derive(Debug, Default, Clone, Serialize, Deserialize)]
886pub struct UpdateCustomerRequest {
887    /// The request timeout in seconds.
888    #[serde(rename = "timeout")]
889    pub timeout: i32,
890    /// Whether or not to route transaction to the test gateway.
891    #[serde(rename = "test")]
892    pub test: bool,
893    /// A user-assigned reference that can be used to recall or reverse transactions.
894    #[serde(rename = "transactionRef", default)]
895    pub transaction_ref: String,
896    /// That the transaction reference was autogenerated and should be ignored for the
897/// purposes of duplicate detection.
898    #[serde(rename = "autogeneratedRef")]
899    pub autogenerated_ref: bool,
900    /// Defers the response to the transaction and returns immediately. Callers should
901/// retrive the transaction result using the Transaction Status API.
902    #[serde(rename = "async")]
903    pub async_yo: bool,
904    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
905/// transaction result using the Transaction Status API.
906    #[serde(rename = "queue")]
907    pub queue: bool,
908    /// Whether or not the request should block until all cards have been removed from the card
909/// reader.
910    #[serde(rename = "waitForRemovedCard", default)]
911    pub wait_for_removed_card: bool,
912    /// Override any in-progress transactions.
913    #[serde(rename = "force", default)]
914    pub force: bool,
915    /// An identifier from an external point of sale system.
916    #[serde(rename = "orderRef", default)]
917    pub order_ref: String,
918    /// The settlement account for merchants with split settlements.
919    #[serde(rename = "destinationAccount", default)]
920    pub destination_account: String,
921    /// Can include a code used to trigger simulated conditions for the purposes of testing and
922/// certification. Valid for test merchant accounts only.
923    #[serde(rename = "testCase", default)]
924    pub test_case: String,
925    /// Models a customer update request.
926    #[serde(rename = "customer")]
927    pub customer: Customer,
928
929}
930
931/// Models customer search results.
932#[derive(Debug, Default, Clone, Serialize, Deserialize)]
933pub struct CustomerSearchResponse {
934    /// Whether or not the request succeeded.
935    #[serde(rename = "success")]
936    pub success: bool,
937    /// The error, if an error occurred.
938    #[serde(rename = "error")]
939    pub error: String,
940    /// A narrative description of the transaction result.
941    #[serde(rename = "responseDescription")]
942    pub response_description: String,
943    /// The customer results matching the search query.
944    #[serde(rename = "customers")]
945    pub customers: Option<Vec<Customer>>,
946
947}
948
949/// Models a customer record.
950#[derive(Debug, Default, Clone, Serialize, Deserialize)]
951pub struct Customer {
952    /// BlockChyp assigned customer id.
953    #[serde(rename = "id")]
954    pub id: String,
955    /// Optional customer ref that can be used for the client's system's customer id.
956    #[serde(rename = "customerRef")]
957    pub customer_ref: String,
958    /// Customer's first name.
959    #[serde(rename = "firstName")]
960    pub first_name: String,
961    /// Customer's last name.
962    #[serde(rename = "lastName")]
963    pub last_name: String,
964    /// Customer's company name.
965    #[serde(rename = "companyName")]
966    pub company_name: String,
967    /// Customer's email address.
968    #[serde(rename = "emailAddress")]
969    pub email_address: String,
970    /// Customer's SMS or mobile number.
971    #[serde(rename = "smsNumber")]
972    pub sms_number: String,
973    /// Model saved payment methods associated with a customer.
974    #[serde(rename = "paymentMethods")]
975    pub payment_methods: Option<Vec<CustomerToken>>,
976
977}
978
979/// Retrieves token metadata.
980#[derive(Debug, Default, Clone, Serialize, Deserialize)]
981pub struct TokenMetadataRequest {
982    /// The request timeout in seconds.
983    #[serde(rename = "timeout")]
984    pub timeout: i32,
985    /// Whether or not to route transaction to the test gateway.
986    #[serde(rename = "test")]
987    pub test: bool,
988    /// A user-assigned reference that can be used to recall or reverse transactions.
989    #[serde(rename = "transactionRef", default)]
990    pub transaction_ref: String,
991    /// That the transaction reference was autogenerated and should be ignored for the
992/// purposes of duplicate detection.
993    #[serde(rename = "autogeneratedRef")]
994    pub autogenerated_ref: bool,
995    /// Defers the response to the transaction and returns immediately. Callers should
996/// retrive the transaction result using the Transaction Status API.
997    #[serde(rename = "async")]
998    pub async_yo: bool,
999    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
1000/// transaction result using the Transaction Status API.
1001    #[serde(rename = "queue")]
1002    pub queue: bool,
1003    /// Whether or not the request should block until all cards have been removed from the card
1004/// reader.
1005    #[serde(rename = "waitForRemovedCard", default)]
1006    pub wait_for_removed_card: bool,
1007    /// Override any in-progress transactions.
1008    #[serde(rename = "force", default)]
1009    pub force: bool,
1010    /// An identifier from an external point of sale system.
1011    #[serde(rename = "orderRef", default)]
1012    pub order_ref: String,
1013    /// The settlement account for merchants with split settlements.
1014    #[serde(rename = "destinationAccount", default)]
1015    pub destination_account: String,
1016    /// Can include a code used to trigger simulated conditions for the purposes of testing and
1017/// certification. Valid for test merchant accounts only.
1018    #[serde(rename = "testCase", default)]
1019    pub test_case: String,
1020    /// The token to retrieve.
1021    #[serde(rename = "token")]
1022    pub token: String,
1023
1024}
1025
1026/// Models a payment token metadata response.
1027#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1028pub struct TokenMetadataResponse {
1029    /// Whether or not the request succeeded.
1030    #[serde(rename = "success")]
1031    pub success: bool,
1032    /// The error, if an error occurred.
1033    #[serde(rename = "error")]
1034    pub error: String,
1035    /// A narrative description of the transaction result.
1036    #[serde(rename = "responseDescription")]
1037    pub response_description: String,
1038    /// The token metadata for a given query.
1039    #[serde(rename = "token")]
1040    pub token: CustomerToken,
1041    /// Details about a payment card derived from its BIN/IIN.
1042    #[serde(rename = "cardMetadata", default)]
1043    pub card_metadata: Option<CardMetadata>,
1044
1045}
1046
1047/// Updates a payment token.
1048#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1049pub struct UpdateTokenRequest {
1050    /// The request timeout in seconds.
1051    #[serde(rename = "timeout")]
1052    pub timeout: i32,
1053    /// Whether or not to route transaction to the test gateway.
1054    #[serde(rename = "test")]
1055    pub test: bool,
1056    /// The token to update.
1057    #[serde(rename = "token")]
1058    pub token: String,
1059    /// Bank account holder type (personal or business).
1060    #[serde(rename = "accountHolderType")]
1061    pub account_holder_type: String,
1062    /// Bank account type (checking or saving).
1063    #[serde(rename = "accountType")]
1064    pub account_type: String,
1065    /// Bank name.
1066    #[serde(rename = "bankName")]
1067    pub bank_name: String,
1068    /// Card holder name.
1069    #[serde(rename = "cardHolderName")]
1070    pub card_holder_name: String,
1071    /// Expiry month.
1072    #[serde(rename = "expiryMonth")]
1073    pub expiry_month: String,
1074    /// Expiry year.
1075    #[serde(rename = "expiryYear")]
1076    pub expiry_year: String,
1077    /// Address.
1078    #[serde(rename = "address")]
1079    pub address: String,
1080    /// Postal code.
1081    #[serde(rename = "postalCode")]
1082    pub postal_code: String,
1083
1084}
1085
1086/// The response to a update token request.
1087#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1088pub struct UpdateTokenResponse {
1089    /// Whether or not the request succeeded.
1090    #[serde(rename = "success")]
1091    pub success: bool,
1092    /// The error, if an error occurred.
1093    #[serde(rename = "error")]
1094    pub error: String,
1095    /// A narrative description of the transaction result.
1096    #[serde(rename = "responseDescription")]
1097    pub response_description: String,
1098    /// The updated token for a given query.
1099    #[serde(rename = "token")]
1100    pub token: CustomerToken,
1101
1102}
1103
1104/// Models a customer token.
1105#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1106pub struct CustomerToken {
1107    /// BlockChyp assigned customer id.
1108    #[serde(rename = "token")]
1109    pub token: String,
1110    /// Masked primary account number.
1111    #[serde(rename = "maskedPan")]
1112    pub masked_pan: String,
1113    /// Expiration month.
1114    #[serde(rename = "expiryMonth")]
1115    pub expiry_month: String,
1116    /// Expiration month.
1117    #[serde(rename = "expiryYear")]
1118    pub expiry_year: String,
1119    /// Payment type.
1120    #[serde(rename = "paymentType")]
1121    pub payment_type: String,
1122    /// Bank account type (checking, saving).
1123    #[serde(rename = "accountType")]
1124    pub account_type: String,
1125    /// Bank account holder type (personal, business).
1126    #[serde(rename = "accountHolderType")]
1127    pub account_holder_type: String,
1128    /// Bank name.
1129    #[serde(rename = "bankName")]
1130    pub bank_name: String,
1131    /// Routing number.
1132    #[serde(rename = "routingNumber")]
1133    pub routing_number: String,
1134    /// Token hash (generated with a static salt, Merchant ID, Registration Date and PAN.
1135    #[serde(rename = "tokenHash")]
1136    pub token_hash: String,
1137    /// Card bin.
1138    #[serde(rename = "bin")]
1139    pub bin: String,
1140    /// The card postal code.
1141    #[serde(rename = "postalCode", default)]
1142    pub postal_code: String,
1143    /// The card address.
1144    #[serde(rename = "address", default)]
1145    pub address: String,
1146    /// The card country.
1147    #[serde(rename = "country", default)]
1148    pub country: String,
1149    /// The card holder name.
1150    #[serde(rename = "cardHolderName", default)]
1151    pub card_holder_name: String,
1152    /// Models customer records associated with a payment token.
1153    #[serde(rename = "customers")]
1154    pub customers: Option<Vec<Customer>>,
1155
1156}
1157
1158/// The response to a text prompt request.
1159#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1160pub struct TextPromptResponse {
1161    /// Whether or not the request succeeded.
1162    #[serde(rename = "success")]
1163    pub success: bool,
1164    /// The error, if an error occurred.
1165    #[serde(rename = "error")]
1166    pub error: String,
1167    /// A narrative description of the transaction result.
1168    #[serde(rename = "responseDescription")]
1169    pub response_description: String,
1170    /// The text prompt response.
1171    #[serde(rename = "response")]
1172    pub response: String,
1173
1174}
1175
1176/// The response to a boolean prompt request.
1177#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1178pub struct BooleanPromptResponse {
1179    /// Whether or not the request succeeded.
1180    #[serde(rename = "success")]
1181    pub success: bool,
1182    /// The error, if an error occurred.
1183    #[serde(rename = "error")]
1184    pub error: String,
1185    /// A narrative description of the transaction result.
1186    #[serde(rename = "responseDescription")]
1187    pub response_description: String,
1188    /// The boolean prompt response.
1189    #[serde(rename = "response")]
1190    pub response: bool,
1191
1192}
1193
1194/// Shows details about a white listed card.
1195#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1196pub struct WhiteListedCard {
1197    /// The card BIN.
1198    #[serde(rename = "bin")]
1199    pub bin: String,
1200    /// The track 1 data from the card.
1201    #[serde(rename = "track1")]
1202    pub track_1: String,
1203    /// The track 2 data from the card.
1204    #[serde(rename = "track2")]
1205    pub track_2: String,
1206    /// The card primary account number.
1207    #[serde(rename = "pan")]
1208    pub pan: String,
1209
1210}
1211
1212/// An authorization request for a charge, preauth, or reverse transaction.
1213#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1214pub struct AuthorizationRequest {
1215    /// The request timeout in seconds.
1216    #[serde(rename = "timeout")]
1217    pub timeout: i32,
1218    /// Whether or not to route transaction to the test gateway.
1219    #[serde(rename = "test")]
1220    pub test: bool,
1221    /// A user-assigned reference that can be used to recall or reverse transactions.
1222    #[serde(rename = "transactionRef", default)]
1223    pub transaction_ref: String,
1224    /// That the transaction reference was autogenerated and should be ignored for the
1225/// purposes of duplicate detection.
1226    #[serde(rename = "autogeneratedRef")]
1227    pub autogenerated_ref: bool,
1228    /// Defers the response to the transaction and returns immediately. Callers should
1229/// retrive the transaction result using the Transaction Status API.
1230    #[serde(rename = "async")]
1231    pub async_yo: bool,
1232    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
1233/// transaction result using the Transaction Status API.
1234    #[serde(rename = "queue")]
1235    pub queue: bool,
1236    /// Whether or not the request should block until all cards have been removed from the card
1237/// reader.
1238    #[serde(rename = "waitForRemovedCard", default)]
1239    pub wait_for_removed_card: bool,
1240    /// Override any in-progress transactions.
1241    #[serde(rename = "force", default)]
1242    pub force: bool,
1243    /// An identifier from an external point of sale system.
1244    #[serde(rename = "orderRef", default)]
1245    pub order_ref: String,
1246    /// The settlement account for merchants with split settlements.
1247    #[serde(rename = "destinationAccount", default)]
1248    pub destination_account: String,
1249    /// Can include a code used to trigger simulated conditions for the purposes of testing and
1250/// certification. Valid for test merchant accounts only.
1251    #[serde(rename = "testCase", default)]
1252    pub test_case: String,
1253    /// The payment token to be used for this transaction. This should be used for recurring
1254/// transactions.
1255    #[serde(rename = "token", default)]
1256    pub token: String,
1257    /// Track 1 magnetic stripe data.
1258    #[serde(rename = "track1", default)]
1259    pub track_1: String,
1260    /// Track 2 magnetic stripe data.
1261    #[serde(rename = "track2", default)]
1262    pub track_2: String,
1263    /// The primary account number. We recommend using the terminal or e-commerce
1264/// tokenization libraries instead of passing account numbers in directly, as this would
1265/// put your application in PCI scope.
1266    #[serde(rename = "pan", default)]
1267    pub pan: String,
1268    /// The ACH routing number for ACH transactions.
1269    #[serde(rename = "routingNumber", default)]
1270    pub routing_number: String,
1271    /// The cardholder name. Only required if the request includes a primary account number or
1272/// track data.
1273    #[serde(rename = "cardholderName", default)]
1274    pub cardholder_name: String,
1275    /// The card expiration month for use with PAN based transactions.
1276    #[serde(rename = "expMonth", default)]
1277    pub exp_month: String,
1278    /// The card expiration year for use with PAN based transactions.
1279    #[serde(rename = "expYear", default)]
1280    pub exp_year: String,
1281    /// The card CVV for use with PAN based transactions.
1282    #[serde(rename = "cvv", default)]
1283    pub cvv: String,
1284    /// The cardholder address for use with address verification.
1285    #[serde(rename = "address", default)]
1286    pub address: String,
1287    /// The cardholder postal code for use with address verification.
1288    #[serde(rename = "postalCode", default)]
1289    pub postal_code: String,
1290    /// The cardholder country.
1291    #[serde(rename = "country", default)]
1292    pub country: String,
1293    /// That the payment entry method is a manual keyed transaction. If this is true, no other
1294/// payment method will be accepted.
1295    #[serde(rename = "manualEntry", default)]
1296    pub manual_entry: bool,
1297    /// The key serial number used for DUKPT encryption.
1298    #[serde(rename = "ksn", default)]
1299    pub ksn: String,
1300    /// The encrypted pin block.
1301    #[serde(rename = "pinBlock", default)]
1302    pub pin_block: String,
1303    /// Designates categories of cards: credit, debit, EBT.
1304    #[serde(rename = "cardType", default)]
1305    pub card_type: CardType,
1306    /// Designates brands of payment methods: Visa, Discover, etc.
1307    #[serde(rename = "paymentType", default)]
1308    pub payment_type: String,
1309    /// The transaction currency code.
1310    #[serde(rename = "currencyCode")]
1311    pub currency_code: String,
1312    /// The requested amount.
1313    #[serde(rename = "amount")]
1314    pub amount: String,
1315    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
1316    #[serde(rename = "taxExempt")]
1317    pub tax_exempt: bool,
1318    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
1319    #[serde(rename = "surcharge")]
1320    pub surcharge: bool,
1321    /// A flag that applies a discount to negate the surcharge for debit transactions or other
1322/// surcharge ineligible payment methods.
1323    #[serde(rename = "cashDiscount")]
1324    pub cash_discount: bool,
1325    /// A location on the filesystem which a customer signature should be written to.
1326    #[serde(rename = "sigFile", default)]
1327    pub sig_file: String,
1328    /// The image format to be used for returning signatures.
1329    #[serde(rename = "sigFormat", default)]
1330    pub sig_format: SignatureFormat,
1331    /// The width that the signature image should be scaled to, preserving the aspect ratio. If
1332/// not provided, the signature is returned in the terminal's max resolution.
1333    #[serde(rename = "sigWidth", default)]
1334    pub sig_width: i32,
1335    /// Whether or not signature prompt should be skipped on the terminal. The terminal will
1336/// indicate whether or not a signature is required by the card in the receipt suggestions
1337/// response.
1338    #[serde(rename = "disableSignature", default)]
1339    pub disable_signature: bool,
1340    /// The tip amount.
1341    #[serde(rename = "tipAmount", default)]
1342    pub tip_amount: String,
1343    /// The tax amount.
1344    #[serde(rename = "taxAmount", default)]
1345    pub tax_amount: String,
1346    /// The name of the target payment terminal.
1347    #[serde(rename = "terminalName", default)]
1348    pub terminal_name: String,
1349    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
1350/// This is a diagnostic settings that can be used only for test transactions.
1351    #[serde(rename = "resetConnection")]
1352    pub reset_connection: bool,
1353    /// Can be used to update a pre-auth to a new amount, sometimes called incremental auth.
1354    #[serde(rename = "transactionId", default)]
1355    pub transaction_id: String,
1356    /// Used to validate online gift card authorizations.
1357    #[serde(rename = "onlineAuthCode", default)]
1358    pub online_auth_code: String,
1359    /// That the payment method should be added to the token vault alongside the
1360/// authorization.
1361    #[serde(rename = "enroll", default)]
1362    pub enroll: bool,
1363    /// Duplicate detection should be bypassed.
1364    #[serde(rename = "bypassDupeFilter", default)]
1365    pub bypass_dupe_filter: bool,
1366    /// A narrative description of the transaction.
1367    #[serde(rename = "description", default)]
1368    pub description: String,
1369    /// That the terminal should request a tip from the user before starting the transaction.
1370    #[serde(rename = "promptForTip", default)]
1371    pub prompt_for_tip: bool,
1372    /// That cash back should be enabled for supported cards.
1373    #[serde(rename = "cashBackEnabled", default)]
1374    pub cash_back_enabled: bool,
1375    /// That this transaction should be treated as MOTO with a card on file.
1376    #[serde(rename = "cardOnFile", default)]
1377    pub card_on_file: bool,
1378    /// That this transaction should be treated as a recurring transaction.
1379    #[serde(rename = "recurring", default)]
1380    pub recurring: bool,
1381    /// Manually sets the CIT (Customer Initiated Transaction) flag.
1382    #[serde(rename = "cit", default)]
1383    pub cit: bool,
1384    /// Manually sets the MIT (Merchant Initiated Transaction) flag.
1385    #[serde(rename = "mit", default)]
1386    pub mit: bool,
1387    /// That this transaction should be treated as a subscription recurring transaction.
1388    #[serde(rename = "subscription", default)]
1389    pub subscription: bool,
1390    /// The purchase order number, if known.
1391    #[serde(rename = "purchaseOrderNumber", default)]
1392    pub purchase_order_number: String,
1393    /// The supplier reference number, if known.
1394    #[serde(rename = "supplierReferenceNumber", default)]
1395    pub supplier_reference_number: String,
1396    /// An item to display. Can be overwritten or appended, based on the request type.
1397    #[serde(rename = "lineItems")]
1398    pub line_items: Option<Vec<TransactionDisplayItem>>,
1399    /// A map of alternate currencies and the price in each currency. Use only if you want to set
1400/// your own exchange rate for a crypto transaction.
1401    #[serde(rename = "altPrices", default)]
1402    pub alt_prices: HashMap<String, String>,
1403    /// Customer information.
1404    #[serde(rename = "customer")]
1405    pub customer: Option<Customer>,
1406    /// How partial pennies should be rounded for calculated values like surcharges.
1407/// Rounding up is the default behavior.
1408    #[serde(rename = "roundingMode")]
1409    pub rounding_mode: Option<RoundingMode>,
1410    /// Details for HSA/FSA transactions.
1411    #[serde(rename = "healthcareMetadata", default)]
1412    pub healthcare_metadata: Option<HealthcareMetadata>,
1413    /// That the transaction should be a cryptocurrency transaction. Value should be a crypto
1414/// currency code (ETH, BTC) or ANY to prompt the user to choose from supported
1415/// cryptocurrencies.
1416    #[serde(rename = "cryptocurrency", default)]
1417    pub cryptocurrency: Option<String>,
1418    /// An optional parameter that can be used to force a crypto transaction onto a level one or
1419/// level two network. Valid values are L1 and L2. Defaults to L1.
1420    #[serde(rename = "cryptoNetwork", default)]
1421    pub crypto_network: Option<String>,
1422    /// Can be used to specify a specific receive address for a crypto transaction. Disabled by
1423/// default. This should only be used by sophisticated users with access to properly
1424/// configured hot wallets.
1425    #[serde(rename = "cryptoReceiveAddress", default)]
1426    pub crypto_receive_address: Option<String>,
1427    /// Can optionally add a label to the payment request if the target cryptocurrency
1428/// supports labels. Defaults to the merchant's DBA Name.
1429    #[serde(rename = "paymentRequestLabel", default)]
1430    pub payment_request_label: Option<String>,
1431    /// Can optionally add a message to the payment request if the target cryptocurrency
1432/// supports labels. Defaults to empty.
1433    #[serde(rename = "paymentRequestMessage", default)]
1434    pub payment_request_message: Option<String>,
1435    /// Instructs the terminal to simulate a post auth chip rejection that would trigger an
1436/// automatic reversal.
1437    #[serde(rename = "simulateChipRejection", default)]
1438    pub simulate_chip_rejection: bool,
1439    /// Instructs the terminal to simulate an out of order automatic reversal.
1440    #[serde(rename = "simulateOutOfOrderReversal", default)]
1441    pub simulate_out_of_order_reversal: bool,
1442    /// Causes auto-reversals on the terminal to be executed asyncronously. Use with caution
1443/// and in conjunction with the transaction status API.
1444    #[serde(rename = "asyncReversals", default)]
1445    pub async_reversals: bool,
1446    /// A passthrough surcharge amount. This surcharge amount will be passed directly to the
1447/// gateway and is not directly calculated.
1448    #[serde(rename = "passthroughSurcharge", default)]
1449    pub passthrough_surcharge: String,
1450    /// Marks a transaction as HSA/FSA.
1451    #[serde(rename = "healthcare", default)]
1452    pub healthcare: bool,
1453    /// The total amount to process as healthcare.
1454    #[serde(rename = "healthcareTotal", default)]
1455    pub healthcare_total: String,
1456    /// The total amount to process as ebt.
1457    #[serde(rename = "ebtTotal", default)]
1458    pub ebt_total: String,
1459    /// That this transaction will include a card metadata lookup.
1460    #[serde(rename = "cardMetadataLookup", default)]
1461    pub card_metadata_lookup: bool,
1462    /// The total discount amount for the transaction, and will overide additive logic for
1463/// line item discounts.
1464    #[serde(rename = "totalDiscountAmount", default)]
1465    pub total_discount_amount: String,
1466    /// The shipping cost associated with the transaction.
1467    #[serde(rename = "shippingAmount", default)]
1468    pub shipping_amount: String,
1469    /// The duty amount associated with the transaction.
1470    #[serde(rename = "dutyAmount", default)]
1471    pub duty_amount: String,
1472    /// The processor ID associated with the transaction.
1473    #[serde(rename = "processorId", default)]
1474    pub processor_id: String,
1475    /// The external customer ID associated with the transaction.
1476    #[serde(rename = "externalCustomerId", default)]
1477    pub external_customer_id: String,
1478    /// Three character, numeric, ship-to country code. Defaults to '840' (USA) if not
1479/// specified.
1480    #[serde(rename = "destinationCountryCode", default)]
1481    pub destination_country_code: String,
1482    /// Nine character postal code for shipping origin addresses. For US addresses, this is a
1483/// 5+4 ZIP or five digit ZIP.
1484    #[serde(rename = "shipFromPostalCode", default)]
1485    pub ship_from_postal_code: String,
1486    /// Nine character postal code for shipping destination addresses. For US addresses,
1487/// this is a 5+4 ZIP or five digit ZIP.
1488    #[serde(rename = "shipToPostalCode", default)]
1489    pub ship_to_postal_code: String,
1490    /// The purchase order date.
1491    #[serde(rename = "orderDate", default)]
1492    pub order_date: Option<DateTime<Utc>>,
1493
1494}
1495
1496/// Essential information about a payment card derived from its BIN/IIN.
1497#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1498pub struct CardMetadata {
1499    /// The brand or network of the card (e.g., Visa, Mastercard, Amex).
1500    #[serde(rename = "cardBrand")]
1501    pub card_brand: String,
1502    /// The name of the financial institution that issued the card.
1503    #[serde(rename = "issuerName")]
1504    pub issuer_name: String,
1505    /// Whether the card supports Level 3 processing for detailed transaction data.
1506    #[serde(rename = "l3")]
1507    pub l_3: bool,
1508    /// Whether the card supports Level 2 processing for additional transaction data.
1509    #[serde(rename = "l2")]
1510    pub l_2: bool,
1511    /// The general category or type of the card product.
1512    #[serde(rename = "productType")]
1513    pub product_type: String,
1514    /// The specific name or designation of the card product.
1515    #[serde(rename = "productName")]
1516    pub product_name: String,
1517    /// Whether the card is an Electronic Benefit Transfer (EBT) card.
1518    #[serde(rename = "ebt")]
1519    pub ebt: bool,
1520    /// Whether the card is a debit card.
1521    #[serde(rename = "debit")]
1522    pub debit: bool,
1523    /// Whether the card is a healthcare-specific payment card.
1524    #[serde(rename = "healthcare")]
1525    pub healthcare: bool,
1526    /// Whether the card is a prepaid card.
1527    #[serde(rename = "prepaid")]
1528    pub prepaid: bool,
1529    /// The geographical region associated with the card's issuer.
1530    #[serde(rename = "region")]
1531    pub region: String,
1532    /// The country associated with the card's issuer.
1533    #[serde(rename = "country")]
1534    pub country: String,
1535
1536}
1537
1538/// Retrieves card metadata.
1539#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1540pub struct CardMetadataRequest {
1541    /// The request timeout in seconds.
1542    #[serde(rename = "timeout")]
1543    pub timeout: i32,
1544    /// Whether or not to route transaction to the test gateway.
1545    #[serde(rename = "test")]
1546    pub test: bool,
1547    /// A user-assigned reference that can be used to recall or reverse transactions.
1548    #[serde(rename = "transactionRef", default)]
1549    pub transaction_ref: String,
1550    /// That the transaction reference was autogenerated and should be ignored for the
1551/// purposes of duplicate detection.
1552    #[serde(rename = "autogeneratedRef")]
1553    pub autogenerated_ref: bool,
1554    /// Defers the response to the transaction and returns immediately. Callers should
1555/// retrive the transaction result using the Transaction Status API.
1556    #[serde(rename = "async")]
1557    pub async_yo: bool,
1558    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
1559/// transaction result using the Transaction Status API.
1560    #[serde(rename = "queue")]
1561    pub queue: bool,
1562    /// Whether or not the request should block until all cards have been removed from the card
1563/// reader.
1564    #[serde(rename = "waitForRemovedCard", default)]
1565    pub wait_for_removed_card: bool,
1566    /// Override any in-progress transactions.
1567    #[serde(rename = "force", default)]
1568    pub force: bool,
1569    /// An identifier from an external point of sale system.
1570    #[serde(rename = "orderRef", default)]
1571    pub order_ref: String,
1572    /// The settlement account for merchants with split settlements.
1573    #[serde(rename = "destinationAccount", default)]
1574    pub destination_account: String,
1575    /// Can include a code used to trigger simulated conditions for the purposes of testing and
1576/// certification. Valid for test merchant accounts only.
1577    #[serde(rename = "testCase", default)]
1578    pub test_case: String,
1579    /// The payment token to be used for this transaction. This should be used for recurring
1580/// transactions.
1581    #[serde(rename = "token", default)]
1582    pub token: String,
1583    /// Track 1 magnetic stripe data.
1584    #[serde(rename = "track1", default)]
1585    pub track_1: String,
1586    /// Track 2 magnetic stripe data.
1587    #[serde(rename = "track2", default)]
1588    pub track_2: String,
1589    /// The primary account number. We recommend using the terminal or e-commerce
1590/// tokenization libraries instead of passing account numbers in directly, as this would
1591/// put your application in PCI scope.
1592    #[serde(rename = "pan", default)]
1593    pub pan: String,
1594    /// The ACH routing number for ACH transactions.
1595    #[serde(rename = "routingNumber", default)]
1596    pub routing_number: String,
1597    /// The cardholder name. Only required if the request includes a primary account number or
1598/// track data.
1599    #[serde(rename = "cardholderName", default)]
1600    pub cardholder_name: String,
1601    /// The card expiration month for use with PAN based transactions.
1602    #[serde(rename = "expMonth", default)]
1603    pub exp_month: String,
1604    /// The card expiration year for use with PAN based transactions.
1605    #[serde(rename = "expYear", default)]
1606    pub exp_year: String,
1607    /// The card CVV for use with PAN based transactions.
1608    #[serde(rename = "cvv", default)]
1609    pub cvv: String,
1610    /// The cardholder address for use with address verification.
1611    #[serde(rename = "address", default)]
1612    pub address: String,
1613    /// The cardholder postal code for use with address verification.
1614    #[serde(rename = "postalCode", default)]
1615    pub postal_code: String,
1616    /// The cardholder country.
1617    #[serde(rename = "country", default)]
1618    pub country: String,
1619    /// That the payment entry method is a manual keyed transaction. If this is true, no other
1620/// payment method will be accepted.
1621    #[serde(rename = "manualEntry", default)]
1622    pub manual_entry: bool,
1623    /// The key serial number used for DUKPT encryption.
1624    #[serde(rename = "ksn", default)]
1625    pub ksn: String,
1626    /// The encrypted pin block.
1627    #[serde(rename = "pinBlock", default)]
1628    pub pin_block: String,
1629    /// Designates categories of cards: credit, debit, EBT.
1630    #[serde(rename = "cardType", default)]
1631    pub card_type: CardType,
1632    /// Designates brands of payment methods: Visa, Discover, etc.
1633    #[serde(rename = "paymentType", default)]
1634    pub payment_type: String,
1635    /// The name of the target payment terminal.
1636    #[serde(rename = "terminalName", default)]
1637    pub terminal_name: String,
1638    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
1639/// This is a diagnostic settings that can be used only for test transactions.
1640    #[serde(rename = "resetConnection")]
1641    pub reset_connection: bool,
1642    /// Marks a transaction as HSA/FSA.
1643    #[serde(rename = "healthcare", default)]
1644    pub healthcare: bool,
1645
1646}
1647
1648/// The response to a card metadata request.
1649#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1650pub struct CardMetadataResponse {
1651    /// Whether or not the request succeeded.
1652    #[serde(rename = "success")]
1653    pub success: bool,
1654    /// The error, if an error occurred.
1655    #[serde(rename = "error")]
1656    pub error: String,
1657    /// A narrative description of the transaction result.
1658    #[serde(rename = "responseDescription")]
1659    pub response_description: String,
1660    /// The payment token, if the payment was enrolled in the vault.
1661    #[serde(rename = "token", default)]
1662    pub token: String,
1663    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
1664    #[serde(rename = "entryMethod", default)]
1665    pub entry_method: String,
1666    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
1667    #[serde(rename = "paymentType", default)]
1668    pub payment_type: String,
1669    /// Provides network level detail on how a transaction was routed, especially for debit
1670/// transactions.
1671    #[serde(rename = "network", default)]
1672    pub network: String,
1673    /// Identifies the card association based on bin number. Used primarily used to indicate
1674/// the major logo on a card, even when debit transactions are routed on a different
1675/// network.
1676    #[serde(rename = "logo", default)]
1677    pub logo: String,
1678    /// The masked primary account number.
1679    #[serde(rename = "maskedPan", default)]
1680    pub masked_pan: String,
1681    /// The BlockChyp public key if the user presented a BlockChyp payment card.
1682    #[serde(rename = "publicKey", default)]
1683    pub public_key: String,
1684    /// That the transaction did something that would put the system in PCI scope.
1685    #[serde(rename = "ScopeAlert", default)]
1686    pub scope_alert: bool,
1687    /// The cardholder name.
1688    #[serde(rename = "cardHolder", default)]
1689    pub card_holder: String,
1690    /// The card expiration month in MM format.
1691    #[serde(rename = "expMonth", default)]
1692    pub exp_month: String,
1693    /// The card expiration year in YY format.
1694    #[serde(rename = "expYear", default)]
1695    pub exp_year: String,
1696    /// The card postal code.
1697    #[serde(rename = "postalCode", default)]
1698    pub postal_code: String,
1699    /// The card address.
1700    #[serde(rename = "address", default)]
1701    pub address: String,
1702    /// The card country.
1703    #[serde(rename = "country", default)]
1704    pub country: String,
1705    /// Address verification results if address information was submitted.
1706    #[serde(rename = "avsResponse")]
1707    pub avs_response: AVSResponse,
1708    /// The CVV verification result if CVV was submitted.
1709    #[serde(rename = "cvvResponse", default)]
1710    pub cvv_response: String,
1711    /// Suggested receipt fields.
1712    #[serde(rename = "receiptSuggestions")]
1713    pub receipt_suggestions: ReceiptSuggestions,
1714    /// Customer data, if any. Preserved for reverse compatibility.
1715    #[serde(rename = "customer")]
1716    pub customer: Option<Customer>,
1717    /// Customer data, if any.
1718    #[serde(rename = "customers")]
1719    pub customers: Option<Vec<Customer>>,
1720    /// Details about a payment card derived from its BIN/IIN.
1721    #[serde(rename = "cardMetadata", default)]
1722    pub card_metadata: Option<CardMetadata>,
1723
1724}
1725
1726/// A request for the remaining balance on a payment type.
1727#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1728pub struct BalanceRequest {
1729    /// The request timeout in seconds.
1730    #[serde(rename = "timeout")]
1731    pub timeout: i32,
1732    /// Whether or not to route transaction to the test gateway.
1733    #[serde(rename = "test")]
1734    pub test: bool,
1735    /// A user-assigned reference that can be used to recall or reverse transactions.
1736    #[serde(rename = "transactionRef", default)]
1737    pub transaction_ref: String,
1738    /// That the transaction reference was autogenerated and should be ignored for the
1739/// purposes of duplicate detection.
1740    #[serde(rename = "autogeneratedRef")]
1741    pub autogenerated_ref: bool,
1742    /// Defers the response to the transaction and returns immediately. Callers should
1743/// retrive the transaction result using the Transaction Status API.
1744    #[serde(rename = "async")]
1745    pub async_yo: bool,
1746    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
1747/// transaction result using the Transaction Status API.
1748    #[serde(rename = "queue")]
1749    pub queue: bool,
1750    /// Whether or not the request should block until all cards have been removed from the card
1751/// reader.
1752    #[serde(rename = "waitForRemovedCard", default)]
1753    pub wait_for_removed_card: bool,
1754    /// Override any in-progress transactions.
1755    #[serde(rename = "force", default)]
1756    pub force: bool,
1757    /// An identifier from an external point of sale system.
1758    #[serde(rename = "orderRef", default)]
1759    pub order_ref: String,
1760    /// The settlement account for merchants with split settlements.
1761    #[serde(rename = "destinationAccount", default)]
1762    pub destination_account: String,
1763    /// Can include a code used to trigger simulated conditions for the purposes of testing and
1764/// certification. Valid for test merchant accounts only.
1765    #[serde(rename = "testCase", default)]
1766    pub test_case: String,
1767    /// The payment token to be used for this transaction. This should be used for recurring
1768/// transactions.
1769    #[serde(rename = "token", default)]
1770    pub token: String,
1771    /// Track 1 magnetic stripe data.
1772    #[serde(rename = "track1", default)]
1773    pub track_1: String,
1774    /// Track 2 magnetic stripe data.
1775    #[serde(rename = "track2", default)]
1776    pub track_2: String,
1777    /// The primary account number. We recommend using the terminal or e-commerce
1778/// tokenization libraries instead of passing account numbers in directly, as this would
1779/// put your application in PCI scope.
1780    #[serde(rename = "pan", default)]
1781    pub pan: String,
1782    /// The ACH routing number for ACH transactions.
1783    #[serde(rename = "routingNumber", default)]
1784    pub routing_number: String,
1785    /// The cardholder name. Only required if the request includes a primary account number or
1786/// track data.
1787    #[serde(rename = "cardholderName", default)]
1788    pub cardholder_name: String,
1789    /// The card expiration month for use with PAN based transactions.
1790    #[serde(rename = "expMonth", default)]
1791    pub exp_month: String,
1792    /// The card expiration year for use with PAN based transactions.
1793    #[serde(rename = "expYear", default)]
1794    pub exp_year: String,
1795    /// The card CVV for use with PAN based transactions.
1796    #[serde(rename = "cvv", default)]
1797    pub cvv: String,
1798    /// The cardholder address for use with address verification.
1799    #[serde(rename = "address", default)]
1800    pub address: String,
1801    /// The cardholder postal code for use with address verification.
1802    #[serde(rename = "postalCode", default)]
1803    pub postal_code: String,
1804    /// The cardholder country.
1805    #[serde(rename = "country", default)]
1806    pub country: String,
1807    /// That the payment entry method is a manual keyed transaction. If this is true, no other
1808/// payment method will be accepted.
1809    #[serde(rename = "manualEntry", default)]
1810    pub manual_entry: bool,
1811    /// The key serial number used for DUKPT encryption.
1812    #[serde(rename = "ksn", default)]
1813    pub ksn: String,
1814    /// The encrypted pin block.
1815    #[serde(rename = "pinBlock", default)]
1816    pub pin_block: String,
1817    /// Designates categories of cards: credit, debit, EBT.
1818    #[serde(rename = "cardType", default)]
1819    pub card_type: CardType,
1820    /// Designates brands of payment methods: Visa, Discover, etc.
1821    #[serde(rename = "paymentType", default)]
1822    pub payment_type: String,
1823    /// The name of the target payment terminal.
1824    #[serde(rename = "terminalName", default)]
1825    pub terminal_name: String,
1826    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
1827/// This is a diagnostic settings that can be used only for test transactions.
1828    #[serde(rename = "resetConnection")]
1829    pub reset_connection: bool,
1830
1831}
1832
1833/// The response to a balance request.
1834#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1835pub struct BalanceResponse {
1836    /// Whether or not the request succeeded.
1837    #[serde(rename = "success")]
1838    pub success: bool,
1839    /// The error, if an error occurred.
1840    #[serde(rename = "error")]
1841    pub error: String,
1842    /// A narrative description of the transaction result.
1843    #[serde(rename = "responseDescription")]
1844    pub response_description: String,
1845    /// The ID assigned to the transaction.
1846    #[serde(rename = "transactionId")]
1847    pub transaction_id: String,
1848    /// The ID assigned to the batch.
1849    #[serde(rename = "batchId", default)]
1850    pub batch_id: String,
1851    /// The transaction reference string assigned to the transaction request. If no
1852/// transaction ref was assiged on the request, then the gateway will randomly generate
1853/// one.
1854    #[serde(rename = "transactionRef", default)]
1855    pub transaction_ref: String,
1856    /// The type of transaction.
1857    #[serde(rename = "transactionType")]
1858    pub transaction_type: String,
1859    /// The timestamp of the transaction.
1860    #[serde(rename = "timestamp")]
1861    pub timestamp: String,
1862    /// The hash of the last tick block.
1863    #[serde(rename = "tickBlock")]
1864    pub tick_block: String,
1865    /// That the transaction was processed on the test gateway.
1866    #[serde(rename = "test")]
1867    pub test: bool,
1868    /// The settlement account for merchants with split settlements.
1869    #[serde(rename = "destinationAccount", default)]
1870    pub destination_account: String,
1871    /// The ECC signature of the response. Can be used to ensure that it was signed by the
1872/// terminal and detect man-in-the middle attacks.
1873    #[serde(rename = "sig", default)]
1874    pub sig: String,
1875    /// The payment token, if the payment was enrolled in the vault.
1876    #[serde(rename = "token", default)]
1877    pub token: String,
1878    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
1879    #[serde(rename = "entryMethod", default)]
1880    pub entry_method: String,
1881    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
1882    #[serde(rename = "paymentType", default)]
1883    pub payment_type: String,
1884    /// Provides network level detail on how a transaction was routed, especially for debit
1885/// transactions.
1886    #[serde(rename = "network", default)]
1887    pub network: String,
1888    /// Identifies the card association based on bin number. Used primarily used to indicate
1889/// the major logo on a card, even when debit transactions are routed on a different
1890/// network.
1891    #[serde(rename = "logo", default)]
1892    pub logo: String,
1893    /// The masked primary account number.
1894    #[serde(rename = "maskedPan", default)]
1895    pub masked_pan: String,
1896    /// The BlockChyp public key if the user presented a BlockChyp payment card.
1897    #[serde(rename = "publicKey", default)]
1898    pub public_key: String,
1899    /// That the transaction did something that would put the system in PCI scope.
1900    #[serde(rename = "ScopeAlert", default)]
1901    pub scope_alert: bool,
1902    /// The cardholder name.
1903    #[serde(rename = "cardHolder", default)]
1904    pub card_holder: String,
1905    /// The card expiration month in MM format.
1906    #[serde(rename = "expMonth", default)]
1907    pub exp_month: String,
1908    /// The card expiration year in YY format.
1909    #[serde(rename = "expYear", default)]
1910    pub exp_year: String,
1911    /// The card postal code.
1912    #[serde(rename = "postalCode", default)]
1913    pub postal_code: String,
1914    /// The card address.
1915    #[serde(rename = "address", default)]
1916    pub address: String,
1917    /// The card country.
1918    #[serde(rename = "country", default)]
1919    pub country: String,
1920    /// Address verification results if address information was submitted.
1921    #[serde(rename = "avsResponse")]
1922    pub avs_response: AVSResponse,
1923    /// The CVV verification result if CVV was submitted.
1924    #[serde(rename = "cvvResponse", default)]
1925    pub cvv_response: String,
1926    /// Suggested receipt fields.
1927    #[serde(rename = "receiptSuggestions")]
1928    pub receipt_suggestions: ReceiptSuggestions,
1929    /// Customer data, if any. Preserved for reverse compatibility.
1930    #[serde(rename = "customer")]
1931    pub customer: Option<Customer>,
1932    /// Customer data, if any.
1933    #[serde(rename = "customers")]
1934    pub customers: Option<Vec<Customer>>,
1935    /// Remaining balance on the payment method.
1936    #[serde(rename = "remainingBalance", default)]
1937    pub remaining_balance: String,
1938
1939}
1940
1941/// A refund request.
1942#[derive(Debug, Default, Clone, Serialize, Deserialize)]
1943pub struct RefundRequest {
1944    /// The request timeout in seconds.
1945    #[serde(rename = "timeout")]
1946    pub timeout: i32,
1947    /// Whether or not to route transaction to the test gateway.
1948    #[serde(rename = "test")]
1949    pub test: bool,
1950    /// A user-assigned reference that can be used to recall or reverse transactions.
1951    #[serde(rename = "transactionRef", default)]
1952    pub transaction_ref: String,
1953    /// That the transaction reference was autogenerated and should be ignored for the
1954/// purposes of duplicate detection.
1955    #[serde(rename = "autogeneratedRef")]
1956    pub autogenerated_ref: bool,
1957    /// Defers the response to the transaction and returns immediately. Callers should
1958/// retrive the transaction result using the Transaction Status API.
1959    #[serde(rename = "async")]
1960    pub async_yo: bool,
1961    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
1962/// transaction result using the Transaction Status API.
1963    #[serde(rename = "queue")]
1964    pub queue: bool,
1965    /// Whether or not the request should block until all cards have been removed from the card
1966/// reader.
1967    #[serde(rename = "waitForRemovedCard", default)]
1968    pub wait_for_removed_card: bool,
1969    /// Override any in-progress transactions.
1970    #[serde(rename = "force", default)]
1971    pub force: bool,
1972    /// An identifier from an external point of sale system.
1973    #[serde(rename = "orderRef", default)]
1974    pub order_ref: String,
1975    /// The settlement account for merchants with split settlements.
1976    #[serde(rename = "destinationAccount", default)]
1977    pub destination_account: String,
1978    /// Can include a code used to trigger simulated conditions for the purposes of testing and
1979/// certification. Valid for test merchant accounts only.
1980    #[serde(rename = "testCase", default)]
1981    pub test_case: String,
1982    /// The payment token to be used for this transaction. This should be used for recurring
1983/// transactions.
1984    #[serde(rename = "token", default)]
1985    pub token: String,
1986    /// Track 1 magnetic stripe data.
1987    #[serde(rename = "track1", default)]
1988    pub track_1: String,
1989    /// Track 2 magnetic stripe data.
1990    #[serde(rename = "track2", default)]
1991    pub track_2: String,
1992    /// The primary account number. We recommend using the terminal or e-commerce
1993/// tokenization libraries instead of passing account numbers in directly, as this would
1994/// put your application in PCI scope.
1995    #[serde(rename = "pan", default)]
1996    pub pan: String,
1997    /// The ACH routing number for ACH transactions.
1998    #[serde(rename = "routingNumber", default)]
1999    pub routing_number: String,
2000    /// The cardholder name. Only required if the request includes a primary account number or
2001/// track data.
2002    #[serde(rename = "cardholderName", default)]
2003    pub cardholder_name: String,
2004    /// The card expiration month for use with PAN based transactions.
2005    #[serde(rename = "expMonth", default)]
2006    pub exp_month: String,
2007    /// The card expiration year for use with PAN based transactions.
2008    #[serde(rename = "expYear", default)]
2009    pub exp_year: String,
2010    /// The card CVV for use with PAN based transactions.
2011    #[serde(rename = "cvv", default)]
2012    pub cvv: String,
2013    /// The cardholder address for use with address verification.
2014    #[serde(rename = "address", default)]
2015    pub address: String,
2016    /// The cardholder postal code for use with address verification.
2017    #[serde(rename = "postalCode", default)]
2018    pub postal_code: String,
2019    /// The cardholder country.
2020    #[serde(rename = "country", default)]
2021    pub country: String,
2022    /// That the payment entry method is a manual keyed transaction. If this is true, no other
2023/// payment method will be accepted.
2024    #[serde(rename = "manualEntry", default)]
2025    pub manual_entry: bool,
2026    /// The key serial number used for DUKPT encryption.
2027    #[serde(rename = "ksn", default)]
2028    pub ksn: String,
2029    /// The encrypted pin block.
2030    #[serde(rename = "pinBlock", default)]
2031    pub pin_block: String,
2032    /// Designates categories of cards: credit, debit, EBT.
2033    #[serde(rename = "cardType", default)]
2034    pub card_type: CardType,
2035    /// Designates brands of payment methods: Visa, Discover, etc.
2036    #[serde(rename = "paymentType", default)]
2037    pub payment_type: String,
2038    /// The ID of the previous transaction being referenced.
2039    #[serde(rename = "transactionId")]
2040    pub transaction_id: String,
2041    /// The transaction currency code.
2042    #[serde(rename = "currencyCode")]
2043    pub currency_code: String,
2044    /// The requested amount.
2045    #[serde(rename = "amount")]
2046    pub amount: String,
2047    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
2048    #[serde(rename = "taxExempt")]
2049    pub tax_exempt: bool,
2050    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
2051    #[serde(rename = "surcharge")]
2052    pub surcharge: bool,
2053    /// A flag that applies a discount to negate the surcharge for debit transactions or other
2054/// surcharge ineligible payment methods.
2055    #[serde(rename = "cashDiscount")]
2056    pub cash_discount: bool,
2057    /// A location on the filesystem which a customer signature should be written to.
2058    #[serde(rename = "sigFile", default)]
2059    pub sig_file: String,
2060    /// The image format to be used for returning signatures.
2061    #[serde(rename = "sigFormat", default)]
2062    pub sig_format: SignatureFormat,
2063    /// The width that the signature image should be scaled to, preserving the aspect ratio. If
2064/// not provided, the signature is returned in the terminal's max resolution.
2065    #[serde(rename = "sigWidth", default)]
2066    pub sig_width: i32,
2067    /// Whether or not signature prompt should be skipped on the terminal. The terminal will
2068/// indicate whether or not a signature is required by the card in the receipt suggestions
2069/// response.
2070    #[serde(rename = "disableSignature", default)]
2071    pub disable_signature: bool,
2072    /// The tip amount.
2073    #[serde(rename = "tipAmount", default)]
2074    pub tip_amount: String,
2075    /// The tax amount.
2076    #[serde(rename = "taxAmount", default)]
2077    pub tax_amount: String,
2078    /// The name of the target payment terminal.
2079    #[serde(rename = "terminalName", default)]
2080    pub terminal_name: String,
2081    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
2082/// This is a diagnostic settings that can be used only for test transactions.
2083    #[serde(rename = "resetConnection")]
2084    pub reset_connection: bool,
2085    /// Details for HSA/FSA transactions.
2086    #[serde(rename = "healthcareMetadata", default)]
2087    pub healthcare_metadata: Option<HealthcareMetadata>,
2088    /// Instructs the terminal to simulate a post auth chip rejection that would trigger an
2089/// automatic reversal.
2090    #[serde(rename = "simulateChipRejection", default)]
2091    pub simulate_chip_rejection: bool,
2092    /// Instructs the terminal to simulate an out of order automatic reversal.
2093    #[serde(rename = "simulateOutOfOrderReversal", default)]
2094    pub simulate_out_of_order_reversal: bool,
2095    /// Causes auto-reversals on the terminal to be executed asyncronously. Use with caution
2096/// and in conjunction with the transaction status API.
2097    #[serde(rename = "asyncReversals", default)]
2098    pub async_reversals: bool,
2099    /// Manually sets the CIT (Customer Initiated Transaction) flag.
2100    #[serde(rename = "cit", default)]
2101    pub cit: bool,
2102    /// Manually sets the MIT (Merchant Initiated Transaction) flag.
2103    #[serde(rename = "mit", default)]
2104    pub mit: bool,
2105    /// That this transaction will include a card metadata lookup.
2106    #[serde(rename = "cardMetadataLookup", default)]
2107    pub card_metadata_lookup: bool,
2108
2109}
2110
2111/// The information needed to capture a preauth.
2112#[derive(Debug, Default, Clone, Serialize, Deserialize)]
2113pub struct CaptureRequest {
2114    /// The request timeout in seconds.
2115    #[serde(rename = "timeout")]
2116    pub timeout: i32,
2117    /// Whether or not to route transaction to the test gateway.
2118    #[serde(rename = "test")]
2119    pub test: bool,
2120    /// A user-assigned reference that can be used to recall or reverse transactions.
2121    #[serde(rename = "transactionRef", default)]
2122    pub transaction_ref: String,
2123    /// That the transaction reference was autogenerated and should be ignored for the
2124/// purposes of duplicate detection.
2125    #[serde(rename = "autogeneratedRef")]
2126    pub autogenerated_ref: bool,
2127    /// Defers the response to the transaction and returns immediately. Callers should
2128/// retrive the transaction result using the Transaction Status API.
2129    #[serde(rename = "async")]
2130    pub async_yo: bool,
2131    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
2132/// transaction result using the Transaction Status API.
2133    #[serde(rename = "queue")]
2134    pub queue: bool,
2135    /// Whether or not the request should block until all cards have been removed from the card
2136/// reader.
2137    #[serde(rename = "waitForRemovedCard", default)]
2138    pub wait_for_removed_card: bool,
2139    /// Override any in-progress transactions.
2140    #[serde(rename = "force", default)]
2141    pub force: bool,
2142    /// An identifier from an external point of sale system.
2143    #[serde(rename = "orderRef", default)]
2144    pub order_ref: String,
2145    /// The settlement account for merchants with split settlements.
2146    #[serde(rename = "destinationAccount", default)]
2147    pub destination_account: String,
2148    /// Can include a code used to trigger simulated conditions for the purposes of testing and
2149/// certification. Valid for test merchant accounts only.
2150    #[serde(rename = "testCase", default)]
2151    pub test_case: String,
2152    /// The ID of the previous transaction being referenced.
2153    #[serde(rename = "transactionId")]
2154    pub transaction_id: String,
2155    /// The transaction currency code.
2156    #[serde(rename = "currencyCode")]
2157    pub currency_code: String,
2158    /// The requested amount.
2159    #[serde(rename = "amount")]
2160    pub amount: String,
2161    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
2162    #[serde(rename = "taxExempt")]
2163    pub tax_exempt: bool,
2164    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
2165    #[serde(rename = "surcharge")]
2166    pub surcharge: bool,
2167    /// A flag that applies a discount to negate the surcharge for debit transactions or other
2168/// surcharge ineligible payment methods.
2169    #[serde(rename = "cashDiscount")]
2170    pub cash_discount: bool,
2171    /// The tip amount.
2172    #[serde(rename = "tipAmount", default)]
2173    pub tip_amount: String,
2174    /// The tax amount.
2175    #[serde(rename = "taxAmount", default)]
2176    pub tax_amount: String,
2177    /// The number of shipments the original authorization will be broken into.
2178    #[serde(rename = "shipmentCount")]
2179    pub shipment_count: i32,
2180    /// Which shipment this particular capture is for.
2181    #[serde(rename = "shipmentNumber")]
2182    pub shipment_number: i32,
2183    /// A passthrough surcharge amount. This surcharge amount will be passed directly to the
2184/// gateway and is not directly calculated.
2185    #[serde(rename = "passthroughSurcharge", default)]
2186    pub passthrough_surcharge: String,
2187
2188}
2189
2190/// The response to a capture request.
2191#[derive(Debug, Default, Clone, Serialize, Deserialize)]
2192pub struct CaptureResponse {
2193    /// Whether or not the request succeeded.
2194    #[serde(rename = "success")]
2195    pub success: bool,
2196    /// The error, if an error occurred.
2197    #[serde(rename = "error")]
2198    pub error: String,
2199    /// A narrative description of the transaction result.
2200    #[serde(rename = "responseDescription")]
2201    pub response_description: String,
2202    /// That the transaction was approved.
2203    #[serde(rename = "approved")]
2204    pub approved: bool,
2205    /// The auth code from the payment network.
2206    #[serde(rename = "authCode", default)]
2207    pub auth_code: String,
2208    /// The code returned by the terminal or the card issuer to indicate the disposition of the
2209/// message.
2210    #[serde(rename = "authResponseCode", default)]
2211    pub auth_response_code: String,
2212    /// The ID assigned to the transaction.
2213    #[serde(rename = "transactionId")]
2214    pub transaction_id: String,
2215    /// The ID assigned to the batch.
2216    #[serde(rename = "batchId", default)]
2217    pub batch_id: String,
2218    /// The transaction reference string assigned to the transaction request. If no
2219/// transaction ref was assiged on the request, then the gateway will randomly generate
2220/// one.
2221    #[serde(rename = "transactionRef", default)]
2222    pub transaction_ref: String,
2223    /// The type of transaction.
2224    #[serde(rename = "transactionType")]
2225    pub transaction_type: String,
2226    /// The timestamp of the transaction.
2227    #[serde(rename = "timestamp")]
2228    pub timestamp: String,
2229    /// The hash of the last tick block.
2230    #[serde(rename = "tickBlock")]
2231    pub tick_block: String,
2232    /// That the transaction was processed on the test gateway.
2233    #[serde(rename = "test")]
2234    pub test: bool,
2235    /// The settlement account for merchants with split settlements.
2236    #[serde(rename = "destinationAccount", default)]
2237    pub destination_account: String,
2238    /// The ECC signature of the response. Can be used to ensure that it was signed by the
2239/// terminal and detect man-in-the middle attacks.
2240    #[serde(rename = "sig", default)]
2241    pub sig: String,
2242    /// Whether or not the transaction was approved for a partial amount.
2243    #[serde(rename = "partialAuth")]
2244    pub partial_auth: bool,
2245    /// Whether or not an alternate currency was used.
2246    #[serde(rename = "altCurrency")]
2247    pub alt_currency: bool,
2248    /// Whether or not a request was settled on an FSA card.
2249    #[serde(rename = "fsaAuth")]
2250    pub fsa_auth: bool,
2251    /// The currency code used for the transaction.
2252    #[serde(rename = "currencyCode")]
2253    pub currency_code: String,
2254    /// The requested amount.
2255    #[serde(rename = "requestedAmount")]
2256    pub requested_amount: String,
2257    /// The authorized amount. May not match the requested amount in the event of a partial
2258/// auth.
2259    #[serde(rename = "authorizedAmount")]
2260    pub authorized_amount: String,
2261    /// The remaining balance on the payment method.
2262    #[serde(rename = "remainingBalance")]
2263    pub remaining_balance: String,
2264    /// The tip amount.
2265    #[serde(rename = "tipAmount")]
2266    pub tip_amount: String,
2267    /// The tax amount.
2268    #[serde(rename = "taxAmount")]
2269    pub tax_amount: String,
2270    /// The cash back amount the customer requested during the transaction.
2271    #[serde(rename = "requestedCashBackAmount")]
2272    pub requested_cash_back_amount: String,
2273    /// The amount of cash back authorized by the gateway. This amount will be the entire amount
2274/// requested, or zero.
2275    #[serde(rename = "authorizedCashBackAmount")]
2276    pub authorized_cash_back_amount: String,
2277    /// The payment token, if the payment was enrolled in the vault.
2278    #[serde(rename = "token", default)]
2279    pub token: String,
2280    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
2281    #[serde(rename = "entryMethod", default)]
2282    pub entry_method: String,
2283    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
2284    #[serde(rename = "paymentType", default)]
2285    pub payment_type: String,
2286    /// Provides network level detail on how a transaction was routed, especially for debit
2287/// transactions.
2288    #[serde(rename = "network", default)]
2289    pub network: String,
2290    /// Identifies the card association based on bin number. Used primarily used to indicate
2291/// the major logo on a card, even when debit transactions are routed on a different
2292/// network.
2293    #[serde(rename = "logo", default)]
2294    pub logo: String,
2295    /// The masked primary account number.
2296    #[serde(rename = "maskedPan", default)]
2297    pub masked_pan: String,
2298    /// The BlockChyp public key if the user presented a BlockChyp payment card.
2299    #[serde(rename = "publicKey", default)]
2300    pub public_key: String,
2301    /// That the transaction did something that would put the system in PCI scope.
2302    #[serde(rename = "ScopeAlert", default)]
2303    pub scope_alert: bool,
2304    /// The cardholder name.
2305    #[serde(rename = "cardHolder", default)]
2306    pub card_holder: String,
2307    /// The card expiration month in MM format.
2308    #[serde(rename = "expMonth", default)]
2309    pub exp_month: String,
2310    /// The card expiration year in YY format.
2311    #[serde(rename = "expYear", default)]
2312    pub exp_year: String,
2313    /// The card postal code.
2314    #[serde(rename = "postalCode", default)]
2315    pub postal_code: String,
2316    /// The card address.
2317    #[serde(rename = "address", default)]
2318    pub address: String,
2319    /// The card country.
2320    #[serde(rename = "country", default)]
2321    pub country: String,
2322    /// Address verification results if address information was submitted.
2323    #[serde(rename = "avsResponse")]
2324    pub avs_response: AVSResponse,
2325    /// The CVV verification result if CVV was submitted.
2326    #[serde(rename = "cvvResponse", default)]
2327    pub cvv_response: String,
2328    /// Suggested receipt fields.
2329    #[serde(rename = "receiptSuggestions")]
2330    pub receipt_suggestions: ReceiptSuggestions,
2331    /// Customer data, if any. Preserved for reverse compatibility.
2332    #[serde(rename = "customer")]
2333    pub customer: Option<Customer>,
2334    /// Customer data, if any.
2335    #[serde(rename = "customers")]
2336    pub customers: Option<Vec<Customer>>,
2337
2338}
2339
2340/// A void request.
2341#[derive(Debug, Default, Clone, Serialize, Deserialize)]
2342pub struct VoidRequest {
2343    /// The request timeout in seconds.
2344    #[serde(rename = "timeout")]
2345    pub timeout: i32,
2346    /// Whether or not to route transaction to the test gateway.
2347    #[serde(rename = "test")]
2348    pub test: bool,
2349    /// A user-assigned reference that can be used to recall or reverse transactions.
2350    #[serde(rename = "transactionRef", default)]
2351    pub transaction_ref: String,
2352    /// That the transaction reference was autogenerated and should be ignored for the
2353/// purposes of duplicate detection.
2354    #[serde(rename = "autogeneratedRef")]
2355    pub autogenerated_ref: bool,
2356    /// Defers the response to the transaction and returns immediately. Callers should
2357/// retrive the transaction result using the Transaction Status API.
2358    #[serde(rename = "async")]
2359    pub async_yo: bool,
2360    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
2361/// transaction result using the Transaction Status API.
2362    #[serde(rename = "queue")]
2363    pub queue: bool,
2364    /// Whether or not the request should block until all cards have been removed from the card
2365/// reader.
2366    #[serde(rename = "waitForRemovedCard", default)]
2367    pub wait_for_removed_card: bool,
2368    /// Override any in-progress transactions.
2369    #[serde(rename = "force", default)]
2370    pub force: bool,
2371    /// An identifier from an external point of sale system.
2372    #[serde(rename = "orderRef", default)]
2373    pub order_ref: String,
2374    /// The settlement account for merchants with split settlements.
2375    #[serde(rename = "destinationAccount", default)]
2376    pub destination_account: String,
2377    /// Can include a code used to trigger simulated conditions for the purposes of testing and
2378/// certification. Valid for test merchant accounts only.
2379    #[serde(rename = "testCase", default)]
2380    pub test_case: String,
2381    /// The ID of the previous transaction being referenced.
2382    #[serde(rename = "transactionId")]
2383    pub transaction_id: String,
2384
2385}
2386
2387/// The response to a void request.
2388#[derive(Debug, Default, Clone, Serialize, Deserialize)]
2389pub struct VoidResponse {
2390    /// Whether or not the request succeeded.
2391    #[serde(rename = "success")]
2392    pub success: bool,
2393    /// The error, if an error occurred.
2394    #[serde(rename = "error")]
2395    pub error: String,
2396    /// A narrative description of the transaction result.
2397    #[serde(rename = "responseDescription")]
2398    pub response_description: String,
2399    /// That the transaction was approved.
2400    #[serde(rename = "approved")]
2401    pub approved: bool,
2402    /// The auth code from the payment network.
2403    #[serde(rename = "authCode", default)]
2404    pub auth_code: String,
2405    /// The code returned by the terminal or the card issuer to indicate the disposition of the
2406/// message.
2407    #[serde(rename = "authResponseCode", default)]
2408    pub auth_response_code: String,
2409    /// The ID assigned to the transaction.
2410    #[serde(rename = "transactionId")]
2411    pub transaction_id: String,
2412    /// The ID assigned to the batch.
2413    #[serde(rename = "batchId", default)]
2414    pub batch_id: String,
2415    /// The transaction reference string assigned to the transaction request. If no
2416/// transaction ref was assiged on the request, then the gateway will randomly generate
2417/// one.
2418    #[serde(rename = "transactionRef", default)]
2419    pub transaction_ref: String,
2420    /// The type of transaction.
2421    #[serde(rename = "transactionType")]
2422    pub transaction_type: String,
2423    /// The timestamp of the transaction.
2424    #[serde(rename = "timestamp")]
2425    pub timestamp: String,
2426    /// The hash of the last tick block.
2427    #[serde(rename = "tickBlock")]
2428    pub tick_block: String,
2429    /// That the transaction was processed on the test gateway.
2430    #[serde(rename = "test")]
2431    pub test: bool,
2432    /// The settlement account for merchants with split settlements.
2433    #[serde(rename = "destinationAccount", default)]
2434    pub destination_account: String,
2435    /// The ECC signature of the response. Can be used to ensure that it was signed by the
2436/// terminal and detect man-in-the middle attacks.
2437    #[serde(rename = "sig", default)]
2438    pub sig: String,
2439    /// The payment token, if the payment was enrolled in the vault.
2440    #[serde(rename = "token", default)]
2441    pub token: String,
2442    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
2443    #[serde(rename = "entryMethod", default)]
2444    pub entry_method: String,
2445    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
2446    #[serde(rename = "paymentType", default)]
2447    pub payment_type: String,
2448    /// Provides network level detail on how a transaction was routed, especially for debit
2449/// transactions.
2450    #[serde(rename = "network", default)]
2451    pub network: String,
2452    /// Identifies the card association based on bin number. Used primarily used to indicate
2453/// the major logo on a card, even when debit transactions are routed on a different
2454/// network.
2455    #[serde(rename = "logo", default)]
2456    pub logo: String,
2457    /// The masked primary account number.
2458    #[serde(rename = "maskedPan", default)]
2459    pub masked_pan: String,
2460    /// The BlockChyp public key if the user presented a BlockChyp payment card.
2461    #[serde(rename = "publicKey", default)]
2462    pub public_key: String,
2463    /// That the transaction did something that would put the system in PCI scope.
2464    #[serde(rename = "ScopeAlert", default)]
2465    pub scope_alert: bool,
2466    /// The cardholder name.
2467    #[serde(rename = "cardHolder", default)]
2468    pub card_holder: String,
2469    /// The card expiration month in MM format.
2470    #[serde(rename = "expMonth", default)]
2471    pub exp_month: String,
2472    /// The card expiration year in YY format.
2473    #[serde(rename = "expYear", default)]
2474    pub exp_year: String,
2475    /// The card postal code.
2476    #[serde(rename = "postalCode", default)]
2477    pub postal_code: String,
2478    /// The card address.
2479    #[serde(rename = "address", default)]
2480    pub address: String,
2481    /// The card country.
2482    #[serde(rename = "country", default)]
2483    pub country: String,
2484    /// Address verification results if address information was submitted.
2485    #[serde(rename = "avsResponse")]
2486    pub avs_response: AVSResponse,
2487    /// The CVV verification result if CVV was submitted.
2488    #[serde(rename = "cvvResponse", default)]
2489    pub cvv_response: String,
2490    /// Suggested receipt fields.
2491    #[serde(rename = "receiptSuggestions")]
2492    pub receipt_suggestions: ReceiptSuggestions,
2493    /// Customer data, if any. Preserved for reverse compatibility.
2494    #[serde(rename = "customer")]
2495    pub customer: Option<Customer>,
2496    /// Customer data, if any.
2497    #[serde(rename = "customers")]
2498    pub customers: Option<Vec<Customer>>,
2499    /// The hex encoded signature data.
2500    #[serde(rename = "sigFile", default)]
2501    pub sig_file: String,
2502
2503}
2504
2505/// The information needed to enroll a new payment method in the token vault.
2506#[derive(Debug, Default, Clone, Serialize, Deserialize)]
2507pub struct EnrollRequest {
2508    /// The request timeout in seconds.
2509    #[serde(rename = "timeout")]
2510    pub timeout: i32,
2511    /// Whether or not to route transaction to the test gateway.
2512    #[serde(rename = "test")]
2513    pub test: bool,
2514    /// A user-assigned reference that can be used to recall or reverse transactions.
2515    #[serde(rename = "transactionRef", default)]
2516    pub transaction_ref: String,
2517    /// That the transaction reference was autogenerated and should be ignored for the
2518/// purposes of duplicate detection.
2519    #[serde(rename = "autogeneratedRef")]
2520    pub autogenerated_ref: bool,
2521    /// Defers the response to the transaction and returns immediately. Callers should
2522/// retrive the transaction result using the Transaction Status API.
2523    #[serde(rename = "async")]
2524    pub async_yo: bool,
2525    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
2526/// transaction result using the Transaction Status API.
2527    #[serde(rename = "queue")]
2528    pub queue: bool,
2529    /// Whether or not the request should block until all cards have been removed from the card
2530/// reader.
2531    #[serde(rename = "waitForRemovedCard", default)]
2532    pub wait_for_removed_card: bool,
2533    /// Override any in-progress transactions.
2534    #[serde(rename = "force", default)]
2535    pub force: bool,
2536    /// An identifier from an external point of sale system.
2537    #[serde(rename = "orderRef", default)]
2538    pub order_ref: String,
2539    /// The settlement account for merchants with split settlements.
2540    #[serde(rename = "destinationAccount", default)]
2541    pub destination_account: String,
2542    /// Can include a code used to trigger simulated conditions for the purposes of testing and
2543/// certification. Valid for test merchant accounts only.
2544    #[serde(rename = "testCase", default)]
2545    pub test_case: String,
2546    /// The payment token to be used for this transaction. This should be used for recurring
2547/// transactions.
2548    #[serde(rename = "token", default)]
2549    pub token: String,
2550    /// Track 1 magnetic stripe data.
2551    #[serde(rename = "track1", default)]
2552    pub track_1: String,
2553    /// Track 2 magnetic stripe data.
2554    #[serde(rename = "track2", default)]
2555    pub track_2: String,
2556    /// The primary account number. We recommend using the terminal or e-commerce
2557/// tokenization libraries instead of passing account numbers in directly, as this would
2558/// put your application in PCI scope.
2559    #[serde(rename = "pan", default)]
2560    pub pan: String,
2561    /// The ACH routing number for ACH transactions.
2562    #[serde(rename = "routingNumber", default)]
2563    pub routing_number: String,
2564    /// The cardholder name. Only required if the request includes a primary account number or
2565/// track data.
2566    #[serde(rename = "cardholderName", default)]
2567    pub cardholder_name: String,
2568    /// The card expiration month for use with PAN based transactions.
2569    #[serde(rename = "expMonth", default)]
2570    pub exp_month: String,
2571    /// The card expiration year for use with PAN based transactions.
2572    #[serde(rename = "expYear", default)]
2573    pub exp_year: String,
2574    /// The card CVV for use with PAN based transactions.
2575    #[serde(rename = "cvv", default)]
2576    pub cvv: String,
2577    /// The cardholder address for use with address verification.
2578    #[serde(rename = "address", default)]
2579    pub address: String,
2580    /// The cardholder postal code for use with address verification.
2581    #[serde(rename = "postalCode", default)]
2582    pub postal_code: String,
2583    /// The cardholder country.
2584    #[serde(rename = "country", default)]
2585    pub country: String,
2586    /// That the payment entry method is a manual keyed transaction. If this is true, no other
2587/// payment method will be accepted.
2588    #[serde(rename = "manualEntry", default)]
2589    pub manual_entry: bool,
2590    /// The key serial number used for DUKPT encryption.
2591    #[serde(rename = "ksn", default)]
2592    pub ksn: String,
2593    /// The encrypted pin block.
2594    #[serde(rename = "pinBlock", default)]
2595    pub pin_block: String,
2596    /// Designates categories of cards: credit, debit, EBT.
2597    #[serde(rename = "cardType", default)]
2598    pub card_type: CardType,
2599    /// Designates brands of payment methods: Visa, Discover, etc.
2600    #[serde(rename = "paymentType", default)]
2601    pub payment_type: String,
2602    /// The name of the target payment terminal.
2603    #[serde(rename = "terminalName", default)]
2604    pub terminal_name: String,
2605    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
2606/// This is a diagnostic settings that can be used only for test transactions.
2607    #[serde(rename = "resetConnection")]
2608    pub reset_connection: bool,
2609    /// The method by which the payment card was entered (MSR, CHIP, KEYED, etc.).
2610    #[serde(rename = "entryMethod", default)]
2611    pub entry_method: String,
2612    /// Customer with which the new token should be associated.
2613    #[serde(rename = "customer")]
2614    pub customer: Option<Customer>,
2615    /// That this transaction should be treated as a recurring transaction.
2616    #[serde(rename = "recurring", default)]
2617    pub recurring: bool,
2618    /// That this transaction and any using this token should be treated as a subscription
2619/// recurring transaction.
2620    #[serde(rename = "subscription", default)]
2621    pub subscription: bool,
2622    /// That this transaction will include a card metadata lookup.
2623    #[serde(rename = "cardMetadataLookup", default)]
2624    pub card_metadata_lookup: bool,
2625    /// The type of account (checking, savings, etc) for an ACH payment method.
2626    #[serde(rename = "accountType", default)]
2627    pub account_type: String,
2628    /// The type of account holder (personal, business, etc) for an ACH payment method.
2629    #[serde(rename = "accountHolderType", default)]
2630    pub account_holder_type: String,
2631    /// The bank name for an ACH payment method.
2632    #[serde(rename = "bankName", default)]
2633    pub bank_name: String,
2634
2635}
2636
2637/// The response to an enroll request.
2638#[derive(Debug, Default, Clone, Serialize, Deserialize)]
2639pub struct EnrollResponse {
2640    /// Whether or not the request succeeded.
2641    #[serde(rename = "success")]
2642    pub success: bool,
2643    /// The error, if an error occurred.
2644    #[serde(rename = "error")]
2645    pub error: String,
2646    /// A narrative description of the transaction result.
2647    #[serde(rename = "responseDescription")]
2648    pub response_description: String,
2649    /// That the transaction was approved.
2650    #[serde(rename = "approved")]
2651    pub approved: bool,
2652    /// The auth code from the payment network.
2653    #[serde(rename = "authCode", default)]
2654    pub auth_code: String,
2655    /// The code returned by the terminal or the card issuer to indicate the disposition of the
2656/// message.
2657    #[serde(rename = "authResponseCode", default)]
2658    pub auth_response_code: String,
2659    /// The ID assigned to the transaction.
2660    #[serde(rename = "transactionId")]
2661    pub transaction_id: String,
2662    /// The ID assigned to the batch.
2663    #[serde(rename = "batchId", default)]
2664    pub batch_id: String,
2665    /// The transaction reference string assigned to the transaction request. If no
2666/// transaction ref was assiged on the request, then the gateway will randomly generate
2667/// one.
2668    #[serde(rename = "transactionRef", default)]
2669    pub transaction_ref: String,
2670    /// The type of transaction.
2671    #[serde(rename = "transactionType")]
2672    pub transaction_type: String,
2673    /// The timestamp of the transaction.
2674    #[serde(rename = "timestamp")]
2675    pub timestamp: String,
2676    /// The hash of the last tick block.
2677    #[serde(rename = "tickBlock")]
2678    pub tick_block: String,
2679    /// That the transaction was processed on the test gateway.
2680    #[serde(rename = "test")]
2681    pub test: bool,
2682    /// The settlement account for merchants with split settlements.
2683    #[serde(rename = "destinationAccount", default)]
2684    pub destination_account: String,
2685    /// The ECC signature of the response. Can be used to ensure that it was signed by the
2686/// terminal and detect man-in-the middle attacks.
2687    #[serde(rename = "sig", default)]
2688    pub sig: String,
2689    /// The payment token, if the payment was enrolled in the vault.
2690    #[serde(rename = "token", default)]
2691    pub token: String,
2692    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
2693    #[serde(rename = "entryMethod", default)]
2694    pub entry_method: String,
2695    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
2696    #[serde(rename = "paymentType", default)]
2697    pub payment_type: String,
2698    /// Provides network level detail on how a transaction was routed, especially for debit
2699/// transactions.
2700    #[serde(rename = "network", default)]
2701    pub network: String,
2702    /// Identifies the card association based on bin number. Used primarily used to indicate
2703/// the major logo on a card, even when debit transactions are routed on a different
2704/// network.
2705    #[serde(rename = "logo", default)]
2706    pub logo: String,
2707    /// The masked primary account number.
2708    #[serde(rename = "maskedPan", default)]
2709    pub masked_pan: String,
2710    /// The BlockChyp public key if the user presented a BlockChyp payment card.
2711    #[serde(rename = "publicKey", default)]
2712    pub public_key: String,
2713    /// That the transaction did something that would put the system in PCI scope.
2714    #[serde(rename = "ScopeAlert", default)]
2715    pub scope_alert: bool,
2716    /// The cardholder name.
2717    #[serde(rename = "cardHolder", default)]
2718    pub card_holder: String,
2719    /// The card expiration month in MM format.
2720    #[serde(rename = "expMonth", default)]
2721    pub exp_month: String,
2722    /// The card expiration year in YY format.
2723    #[serde(rename = "expYear", default)]
2724    pub exp_year: String,
2725    /// The card postal code.
2726    #[serde(rename = "postalCode", default)]
2727    pub postal_code: String,
2728    /// The card address.
2729    #[serde(rename = "address", default)]
2730    pub address: String,
2731    /// The card country.
2732    #[serde(rename = "country", default)]
2733    pub country: String,
2734    /// Address verification results if address information was submitted.
2735    #[serde(rename = "avsResponse")]
2736    pub avs_response: AVSResponse,
2737    /// The CVV verification result if CVV was submitted.
2738    #[serde(rename = "cvvResponse", default)]
2739    pub cvv_response: String,
2740    /// Suggested receipt fields.
2741    #[serde(rename = "receiptSuggestions")]
2742    pub receipt_suggestions: ReceiptSuggestions,
2743    /// Customer data, if any. Preserved for reverse compatibility.
2744    #[serde(rename = "customer")]
2745    pub customer: Option<Customer>,
2746    /// Customer data, if any.
2747    #[serde(rename = "customers")]
2748    pub customers: Option<Vec<Customer>>,
2749    /// The hex encoded signature data.
2750    #[serde(rename = "sigFile", default)]
2751    pub sig_file: String,
2752    /// Details about a payment card derived from its BIN/IIN.
2753    #[serde(rename = "cardMetadata", default)]
2754    pub card_metadata: Option<CardMetadata>,
2755    /// The type of account (checking, savings, etc) for an ACH payment method.
2756    #[serde(rename = "accountType", default)]
2757    pub account_type: String,
2758    /// The type of account holder (personal, business, etc) for an ACH payment method.
2759    #[serde(rename = "accountHolderType", default)]
2760    pub account_holder_type: String,
2761    /// The bank name for an ACH payment method.
2762    #[serde(rename = "bankName", default)]
2763    pub bank_name: String,
2764    /// The token hash (generated with a static salt, Merchant ID, Registration Date and PAN).
2765    #[serde(rename = "tokenHash", default)]
2766    pub token_hash: String,
2767    /// The first 8 digits of the card aka the BIN.
2768    #[serde(rename = "bin", default)]
2769    pub bin: String,
2770
2771}
2772
2773/// The information needed to enroll a new payment method in the token vault.
2774#[derive(Debug, Default, Clone, Serialize, Deserialize)]
2775pub struct ClearTerminalRequest {
2776    /// The request timeout in seconds.
2777    #[serde(rename = "timeout")]
2778    pub timeout: i32,
2779    /// Whether or not to route transaction to the test gateway.
2780    #[serde(rename = "test")]
2781    pub test: bool,
2782    /// A user-assigned reference that can be used to recall or reverse transactions.
2783    #[serde(rename = "transactionRef", default)]
2784    pub transaction_ref: String,
2785    /// That the transaction reference was autogenerated and should be ignored for the
2786/// purposes of duplicate detection.
2787    #[serde(rename = "autogeneratedRef")]
2788    pub autogenerated_ref: bool,
2789    /// Defers the response to the transaction and returns immediately. Callers should
2790/// retrive the transaction result using the Transaction Status API.
2791    #[serde(rename = "async")]
2792    pub async_yo: bool,
2793    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
2794/// transaction result using the Transaction Status API.
2795    #[serde(rename = "queue")]
2796    pub queue: bool,
2797    /// Whether or not the request should block until all cards have been removed from the card
2798/// reader.
2799    #[serde(rename = "waitForRemovedCard", default)]
2800    pub wait_for_removed_card: bool,
2801    /// Override any in-progress transactions.
2802    #[serde(rename = "force", default)]
2803    pub force: bool,
2804    /// An identifier from an external point of sale system.
2805    #[serde(rename = "orderRef", default)]
2806    pub order_ref: String,
2807    /// The settlement account for merchants with split settlements.
2808    #[serde(rename = "destinationAccount", default)]
2809    pub destination_account: String,
2810    /// Can include a code used to trigger simulated conditions for the purposes of testing and
2811/// certification. Valid for test merchant accounts only.
2812    #[serde(rename = "testCase", default)]
2813    pub test_case: String,
2814    /// The name of the target payment terminal.
2815    #[serde(rename = "terminalName", default)]
2816    pub terminal_name: String,
2817    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
2818/// This is a diagnostic settings that can be used only for test transactions.
2819    #[serde(rename = "resetConnection")]
2820    pub reset_connection: bool,
2821
2822}
2823
2824/// The information needed to activate or recharge a gift card.
2825#[derive(Debug, Default, Clone, Serialize, Deserialize)]
2826pub struct GiftActivateRequest {
2827    /// The request timeout in seconds.
2828    #[serde(rename = "timeout")]
2829    pub timeout: i32,
2830    /// Whether or not to route transaction to the test gateway.
2831    #[serde(rename = "test")]
2832    pub test: bool,
2833    /// A user-assigned reference that can be used to recall or reverse transactions.
2834    #[serde(rename = "transactionRef", default)]
2835    pub transaction_ref: String,
2836    /// That the transaction reference was autogenerated and should be ignored for the
2837/// purposes of duplicate detection.
2838    #[serde(rename = "autogeneratedRef")]
2839    pub autogenerated_ref: bool,
2840    /// Defers the response to the transaction and returns immediately. Callers should
2841/// retrive the transaction result using the Transaction Status API.
2842    #[serde(rename = "async")]
2843    pub async_yo: bool,
2844    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
2845/// transaction result using the Transaction Status API.
2846    #[serde(rename = "queue")]
2847    pub queue: bool,
2848    /// Whether or not the request should block until all cards have been removed from the card
2849/// reader.
2850    #[serde(rename = "waitForRemovedCard", default)]
2851    pub wait_for_removed_card: bool,
2852    /// Override any in-progress transactions.
2853    #[serde(rename = "force", default)]
2854    pub force: bool,
2855    /// An identifier from an external point of sale system.
2856    #[serde(rename = "orderRef", default)]
2857    pub order_ref: String,
2858    /// The settlement account for merchants with split settlements.
2859    #[serde(rename = "destinationAccount", default)]
2860    pub destination_account: String,
2861    /// Can include a code used to trigger simulated conditions for the purposes of testing and
2862/// certification. Valid for test merchant accounts only.
2863    #[serde(rename = "testCase", default)]
2864    pub test_case: String,
2865    /// The transaction currency code.
2866    #[serde(rename = "currencyCode")]
2867    pub currency_code: String,
2868    /// The requested amount.
2869    #[serde(rename = "amount")]
2870    pub amount: String,
2871    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
2872    #[serde(rename = "taxExempt")]
2873    pub tax_exempt: bool,
2874    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
2875    #[serde(rename = "surcharge")]
2876    pub surcharge: bool,
2877    /// A flag that applies a discount to negate the surcharge for debit transactions or other
2878/// surcharge ineligible payment methods.
2879    #[serde(rename = "cashDiscount")]
2880    pub cash_discount: bool,
2881    /// The name of the target payment terminal.
2882    #[serde(rename = "terminalName", default)]
2883    pub terminal_name: String,
2884    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
2885/// This is a diagnostic settings that can be used only for test transactions.
2886    #[serde(rename = "resetConnection")]
2887    pub reset_connection: bool,
2888
2889}
2890
2891/// The response to a gift activate request.
2892#[derive(Debug, Default, Clone, Serialize, Deserialize)]
2893pub struct GiftActivateResponse {
2894    /// Whether or not the request succeeded.
2895    #[serde(rename = "success")]
2896    pub success: bool,
2897    /// The error, if an error occurred.
2898    #[serde(rename = "error")]
2899    pub error: String,
2900    /// A narrative description of the transaction result.
2901    #[serde(rename = "responseDescription")]
2902    pub response_description: String,
2903    /// The ID assigned to the transaction.
2904    #[serde(rename = "transactionId")]
2905    pub transaction_id: String,
2906    /// The ID assigned to the batch.
2907    #[serde(rename = "batchId", default)]
2908    pub batch_id: String,
2909    /// The transaction reference string assigned to the transaction request. If no
2910/// transaction ref was assiged on the request, then the gateway will randomly generate
2911/// one.
2912    #[serde(rename = "transactionRef", default)]
2913    pub transaction_ref: String,
2914    /// The type of transaction.
2915    #[serde(rename = "transactionType")]
2916    pub transaction_type: String,
2917    /// The timestamp of the transaction.
2918    #[serde(rename = "timestamp")]
2919    pub timestamp: String,
2920    /// The hash of the last tick block.
2921    #[serde(rename = "tickBlock")]
2922    pub tick_block: String,
2923    /// That the transaction was processed on the test gateway.
2924    #[serde(rename = "test")]
2925    pub test: bool,
2926    /// The settlement account for merchants with split settlements.
2927    #[serde(rename = "destinationAccount", default)]
2928    pub destination_account: String,
2929    /// The ECC signature of the response. Can be used to ensure that it was signed by the
2930/// terminal and detect man-in-the middle attacks.
2931    #[serde(rename = "sig", default)]
2932    pub sig: String,
2933    /// That the card was activated.
2934    #[serde(rename = "approved")]
2935    pub approved: bool,
2936    /// The amount of the transaction.
2937    #[serde(rename = "amount")]
2938    pub amount: String,
2939    /// The current balance of the gift card.
2940    #[serde(rename = "currentBalance")]
2941    pub current_balance: String,
2942    /// The currency code used for the transaction.
2943    #[serde(rename = "currencyCode")]
2944    pub currency_code: String,
2945    /// The public key of the activated card.
2946    #[serde(rename = "publicKey")]
2947    pub public_key: String,
2948    /// The masked card identifier.
2949    #[serde(rename = "maskedPan", default)]
2950    pub masked_pan: String,
2951
2952}
2953
2954/// The information needed to manually close a credit card batch.
2955#[derive(Debug, Default, Clone, Serialize, Deserialize)]
2956pub struct CloseBatchRequest {
2957    /// The request timeout in seconds.
2958    #[serde(rename = "timeout")]
2959    pub timeout: i32,
2960    /// Whether or not to route transaction to the test gateway.
2961    #[serde(rename = "test")]
2962    pub test: bool,
2963    /// A user-assigned reference that can be used to recall or reverse transactions.
2964    #[serde(rename = "transactionRef", default)]
2965    pub transaction_ref: String,
2966    /// That the transaction reference was autogenerated and should be ignored for the
2967/// purposes of duplicate detection.
2968    #[serde(rename = "autogeneratedRef")]
2969    pub autogenerated_ref: bool,
2970    /// Defers the response to the transaction and returns immediately. Callers should
2971/// retrive the transaction result using the Transaction Status API.
2972    #[serde(rename = "async")]
2973    pub async_yo: bool,
2974    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
2975/// transaction result using the Transaction Status API.
2976    #[serde(rename = "queue")]
2977    pub queue: bool,
2978    /// Whether or not the request should block until all cards have been removed from the card
2979/// reader.
2980    #[serde(rename = "waitForRemovedCard", default)]
2981    pub wait_for_removed_card: bool,
2982    /// Override any in-progress transactions.
2983    #[serde(rename = "force", default)]
2984    pub force: bool,
2985    /// An identifier from an external point of sale system.
2986    #[serde(rename = "orderRef", default)]
2987    pub order_ref: String,
2988    /// The settlement account for merchants with split settlements.
2989    #[serde(rename = "destinationAccount", default)]
2990    pub destination_account: String,
2991    /// Can include a code used to trigger simulated conditions for the purposes of testing and
2992/// certification. Valid for test merchant accounts only.
2993    #[serde(rename = "testCase", default)]
2994    pub test_case: String,
2995    /// Optional batch id.
2996    #[serde(rename = "batchId")]
2997    pub batch_id: String,
2998
2999}
3000
3001/// The response to a close batch request.
3002#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3003pub struct CloseBatchResponse {
3004    /// Whether or not the request succeeded.
3005    #[serde(rename = "success")]
3006    pub success: bool,
3007    /// The error, if an error occurred.
3008    #[serde(rename = "error")]
3009    pub error: String,
3010    /// A narrative description of the transaction result.
3011    #[serde(rename = "responseDescription")]
3012    pub response_description: String,
3013    /// The ID assigned to the transaction.
3014    #[serde(rename = "transactionId")]
3015    pub transaction_id: String,
3016    /// The ID assigned to the batch.
3017    #[serde(rename = "batchId", default)]
3018    pub batch_id: String,
3019    /// The transaction reference string assigned to the transaction request. If no
3020/// transaction ref was assiged on the request, then the gateway will randomly generate
3021/// one.
3022    #[serde(rename = "transactionRef", default)]
3023    pub transaction_ref: String,
3024    /// The type of transaction.
3025    #[serde(rename = "transactionType")]
3026    pub transaction_type: String,
3027    /// The timestamp of the transaction.
3028    #[serde(rename = "timestamp")]
3029    pub timestamp: String,
3030    /// The hash of the last tick block.
3031    #[serde(rename = "tickBlock")]
3032    pub tick_block: String,
3033    /// That the transaction was processed on the test gateway.
3034    #[serde(rename = "test")]
3035    pub test: bool,
3036    /// The settlement account for merchants with split settlements.
3037    #[serde(rename = "destinationAccount", default)]
3038    pub destination_account: String,
3039    /// The ECC signature of the response. Can be used to ensure that it was signed by the
3040/// terminal and detect man-in-the middle attacks.
3041    #[serde(rename = "sig", default)]
3042    pub sig: String,
3043    /// A collection of batches closed during the batch close operation.
3044    #[serde(rename = "batches")]
3045    pub batches: Option<Vec<BatchSummary>>,
3046
3047}
3048
3049/// The fields needed for custom Terms and Conditions prompts.
3050#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3051pub struct TermsAndConditionsRequest {
3052    /// The request timeout in seconds.
3053    #[serde(rename = "timeout")]
3054    pub timeout: i32,
3055    /// Whether or not to route transaction to the test gateway.
3056    #[serde(rename = "test")]
3057    pub test: bool,
3058    /// A user-assigned reference that can be used to recall or reverse transactions.
3059    #[serde(rename = "transactionRef", default)]
3060    pub transaction_ref: String,
3061    /// That the transaction reference was autogenerated and should be ignored for the
3062/// purposes of duplicate detection.
3063    #[serde(rename = "autogeneratedRef")]
3064    pub autogenerated_ref: bool,
3065    /// Defers the response to the transaction and returns immediately. Callers should
3066/// retrive the transaction result using the Transaction Status API.
3067    #[serde(rename = "async")]
3068    pub async_yo: bool,
3069    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
3070/// transaction result using the Transaction Status API.
3071    #[serde(rename = "queue")]
3072    pub queue: bool,
3073    /// Whether or not the request should block until all cards have been removed from the card
3074/// reader.
3075    #[serde(rename = "waitForRemovedCard", default)]
3076    pub wait_for_removed_card: bool,
3077    /// Override any in-progress transactions.
3078    #[serde(rename = "force", default)]
3079    pub force: bool,
3080    /// An identifier from an external point of sale system.
3081    #[serde(rename = "orderRef", default)]
3082    pub order_ref: String,
3083    /// The settlement account for merchants with split settlements.
3084    #[serde(rename = "destinationAccount", default)]
3085    pub destination_account: String,
3086    /// Can include a code used to trigger simulated conditions for the purposes of testing and
3087/// certification. Valid for test merchant accounts only.
3088    #[serde(rename = "testCase", default)]
3089    pub test_case: String,
3090    /// The ID of the previous transaction being referenced.
3091    #[serde(rename = "transactionId")]
3092    pub transaction_id: String,
3093    /// A location on the filesystem which a customer signature should be written to.
3094    #[serde(rename = "sigFile", default)]
3095    pub sig_file: String,
3096    /// The image format to be used for returning signatures.
3097    #[serde(rename = "sigFormat", default)]
3098    pub sig_format: SignatureFormat,
3099    /// The width that the signature image should be scaled to, preserving the aspect ratio. If
3100/// not provided, the signature is returned in the terminal's max resolution.
3101    #[serde(rename = "sigWidth", default)]
3102    pub sig_width: i32,
3103    /// Whether or not signature prompt should be skipped on the terminal. The terminal will
3104/// indicate whether or not a signature is required by the card in the receipt suggestions
3105/// response.
3106    #[serde(rename = "disableSignature", default)]
3107    pub disable_signature: bool,
3108    /// The name of the target payment terminal.
3109    #[serde(rename = "terminalName", default)]
3110    pub terminal_name: String,
3111    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
3112/// This is a diagnostic settings that can be used only for test transactions.
3113    #[serde(rename = "resetConnection")]
3114    pub reset_connection: bool,
3115    /// An alias for a Terms and Conditions template configured in the BlockChyp dashboard.
3116    #[serde(rename = "tcAlias")]
3117    pub tc_alias: String,
3118    /// The name of the Terms and Conditions the user is accepting.
3119    #[serde(rename = "tcName")]
3120    pub tc_name: String,
3121    /// The content of the terms and conditions that will be presented to the user.
3122    #[serde(rename = "tcContent")]
3123    pub tc_content: String,
3124    /// A hash of the terms and conditions content that can be used for caching.
3125    #[serde(rename = "contentHash")]
3126    pub content_hash: String,
3127    /// That a signature should be requested.
3128    #[serde(rename = "sigRequired")]
3129    pub sig_required: bool,
3130
3131}
3132
3133/// A signature capture response for Terms and Conditions.
3134#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3135pub struct TermsAndConditionsResponse {
3136    /// Whether or not the request succeeded.
3137    #[serde(rename = "success")]
3138    pub success: bool,
3139    /// The error, if an error occurred.
3140    #[serde(rename = "error")]
3141    pub error: String,
3142    /// A narrative description of the transaction result.
3143    #[serde(rename = "responseDescription")]
3144    pub response_description: String,
3145    /// The ID assigned to the transaction.
3146    #[serde(rename = "transactionId")]
3147    pub transaction_id: String,
3148    /// The ID assigned to the batch.
3149    #[serde(rename = "batchId", default)]
3150    pub batch_id: String,
3151    /// The transaction reference string assigned to the transaction request. If no
3152/// transaction ref was assiged on the request, then the gateway will randomly generate
3153/// one.
3154    #[serde(rename = "transactionRef", default)]
3155    pub transaction_ref: String,
3156    /// The type of transaction.
3157    #[serde(rename = "transactionType")]
3158    pub transaction_type: String,
3159    /// The timestamp of the transaction.
3160    #[serde(rename = "timestamp")]
3161    pub timestamp: String,
3162    /// The hash of the last tick block.
3163    #[serde(rename = "tickBlock")]
3164    pub tick_block: String,
3165    /// That the transaction was processed on the test gateway.
3166    #[serde(rename = "test")]
3167    pub test: bool,
3168    /// The settlement account for merchants with split settlements.
3169    #[serde(rename = "destinationAccount", default)]
3170    pub destination_account: String,
3171    /// The ECC signature of the response. Can be used to ensure that it was signed by the
3172/// terminal and detect man-in-the middle attacks.
3173    #[serde(rename = "sig", default)]
3174    pub sig: String,
3175    /// The hex encoded signature data.
3176    #[serde(rename = "sigFile", default)]
3177    pub sig_file: String,
3178
3179}
3180
3181/// The response to an authorization request.
3182#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3183pub struct AuthorizationResponse {
3184    /// Whether or not the request succeeded.
3185    #[serde(rename = "success")]
3186    pub success: bool,
3187    /// The error, if an error occurred.
3188    #[serde(rename = "error")]
3189    pub error: String,
3190    /// A narrative description of the transaction result.
3191    #[serde(rename = "responseDescription")]
3192    pub response_description: String,
3193    /// That the transaction was approved.
3194    #[serde(rename = "approved")]
3195    pub approved: bool,
3196    /// The auth code from the payment network.
3197    #[serde(rename = "authCode", default)]
3198    pub auth_code: String,
3199    /// The code returned by the terminal or the card issuer to indicate the disposition of the
3200/// message.
3201    #[serde(rename = "authResponseCode", default)]
3202    pub auth_response_code: String,
3203    /// The ID assigned to the transaction.
3204    #[serde(rename = "transactionId")]
3205    pub transaction_id: String,
3206    /// The ID assigned to the batch.
3207    #[serde(rename = "batchId", default)]
3208    pub batch_id: String,
3209    /// The transaction reference string assigned to the transaction request. If no
3210/// transaction ref was assiged on the request, then the gateway will randomly generate
3211/// one.
3212    #[serde(rename = "transactionRef", default)]
3213    pub transaction_ref: String,
3214    /// The type of transaction.
3215    #[serde(rename = "transactionType")]
3216    pub transaction_type: String,
3217    /// The timestamp of the transaction.
3218    #[serde(rename = "timestamp")]
3219    pub timestamp: String,
3220    /// The hash of the last tick block.
3221    #[serde(rename = "tickBlock")]
3222    pub tick_block: String,
3223    /// That the transaction was processed on the test gateway.
3224    #[serde(rename = "test")]
3225    pub test: bool,
3226    /// The settlement account for merchants with split settlements.
3227    #[serde(rename = "destinationAccount", default)]
3228    pub destination_account: String,
3229    /// The ECC signature of the response. Can be used to ensure that it was signed by the
3230/// terminal and detect man-in-the middle attacks.
3231    #[serde(rename = "sig", default)]
3232    pub sig: String,
3233    /// Whether or not the transaction was approved for a partial amount.
3234    #[serde(rename = "partialAuth")]
3235    pub partial_auth: bool,
3236    /// Whether or not an alternate currency was used.
3237    #[serde(rename = "altCurrency")]
3238    pub alt_currency: bool,
3239    /// Whether or not a request was settled on an FSA card.
3240    #[serde(rename = "fsaAuth")]
3241    pub fsa_auth: bool,
3242    /// The currency code used for the transaction.
3243    #[serde(rename = "currencyCode")]
3244    pub currency_code: String,
3245    /// The requested amount.
3246    #[serde(rename = "requestedAmount")]
3247    pub requested_amount: String,
3248    /// The authorized amount. May not match the requested amount in the event of a partial
3249/// auth.
3250    #[serde(rename = "authorizedAmount")]
3251    pub authorized_amount: String,
3252    /// The remaining balance on the payment method.
3253    #[serde(rename = "remainingBalance")]
3254    pub remaining_balance: String,
3255    /// The tip amount.
3256    #[serde(rename = "tipAmount")]
3257    pub tip_amount: String,
3258    /// The tax amount.
3259    #[serde(rename = "taxAmount")]
3260    pub tax_amount: String,
3261    /// The cash back amount the customer requested during the transaction.
3262    #[serde(rename = "requestedCashBackAmount")]
3263    pub requested_cash_back_amount: String,
3264    /// The amount of cash back authorized by the gateway. This amount will be the entire amount
3265/// requested, or zero.
3266    #[serde(rename = "authorizedCashBackAmount")]
3267    pub authorized_cash_back_amount: String,
3268    /// That the transaction has met the standard criteria for confirmation on the network.
3269/// (For example, 6 confirmations for level one bitcoin.)
3270    #[serde(rename = "confirmed")]
3271    pub confirmed: bool,
3272    /// The amount submitted to the blockchain.
3273    #[serde(rename = "cryptoAuthorizedAmount")]
3274    pub crypto_authorized_amount: String,
3275    /// The network level fee assessed for the transaction denominated in cryptocurrency.
3276/// This fee goes to channel operators and crypto miners, not BlockChyp.
3277    #[serde(rename = "cryptoNetworkFee")]
3278    pub crypto_network_fee: String,
3279    /// The three letter cryptocurrency code used for the transactions.
3280    #[serde(rename = "cryptocurrency")]
3281    pub cryptocurrency: String,
3282    /// Whether or not the transaction was processed on the level one or level two network.
3283    #[serde(rename = "cryptoNetwork")]
3284    pub crypto_network: String,
3285    /// The address on the crypto network the transaction was sent to.
3286    #[serde(rename = "cryptoReceiveAddress")]
3287    pub crypto_receive_address: String,
3288    /// Hash or other identifier that identifies the block on the cryptocurrency network, if
3289/// available or relevant.
3290    #[serde(rename = "cryptoBlock")]
3291    pub crypto_block: String,
3292    /// Hash or other transaction identifier that identifies the transaction on the
3293/// cryptocurrency network, if available or relevant.
3294    #[serde(rename = "cryptoTransactionId")]
3295    pub crypto_transaction_id: String,
3296    /// The payment request URI used for the transaction, if available.
3297    #[serde(rename = "cryptoPaymentRequest")]
3298    pub crypto_payment_request: String,
3299    /// Used for additional status information related to crypto transactions.
3300    #[serde(rename = "cryptoStatus")]
3301    pub crypto_status: String,
3302    /// The payment token, if the payment was enrolled in the vault.
3303    #[serde(rename = "token", default)]
3304    pub token: String,
3305    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
3306    #[serde(rename = "entryMethod", default)]
3307    pub entry_method: String,
3308    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
3309    #[serde(rename = "paymentType", default)]
3310    pub payment_type: String,
3311    /// Provides network level detail on how a transaction was routed, especially for debit
3312/// transactions.
3313    #[serde(rename = "network", default)]
3314    pub network: String,
3315    /// Identifies the card association based on bin number. Used primarily used to indicate
3316/// the major logo on a card, even when debit transactions are routed on a different
3317/// network.
3318    #[serde(rename = "logo", default)]
3319    pub logo: String,
3320    /// The masked primary account number.
3321    #[serde(rename = "maskedPan", default)]
3322    pub masked_pan: String,
3323    /// The BlockChyp public key if the user presented a BlockChyp payment card.
3324    #[serde(rename = "publicKey", default)]
3325    pub public_key: String,
3326    /// That the transaction did something that would put the system in PCI scope.
3327    #[serde(rename = "ScopeAlert", default)]
3328    pub scope_alert: bool,
3329    /// The cardholder name.
3330    #[serde(rename = "cardHolder", default)]
3331    pub card_holder: String,
3332    /// The card expiration month in MM format.
3333    #[serde(rename = "expMonth", default)]
3334    pub exp_month: String,
3335    /// The card expiration year in YY format.
3336    #[serde(rename = "expYear", default)]
3337    pub exp_year: String,
3338    /// The card postal code.
3339    #[serde(rename = "postalCode", default)]
3340    pub postal_code: String,
3341    /// The card address.
3342    #[serde(rename = "address", default)]
3343    pub address: String,
3344    /// The card country.
3345    #[serde(rename = "country", default)]
3346    pub country: String,
3347    /// Address verification results if address information was submitted.
3348    #[serde(rename = "avsResponse")]
3349    pub avs_response: AVSResponse,
3350    /// The CVV verification result if CVV was submitted.
3351    #[serde(rename = "cvvResponse", default)]
3352    pub cvv_response: String,
3353    /// Suggested receipt fields.
3354    #[serde(rename = "receiptSuggestions")]
3355    pub receipt_suggestions: ReceiptSuggestions,
3356    /// Customer data, if any. Preserved for reverse compatibility.
3357    #[serde(rename = "customer")]
3358    pub customer: Option<Customer>,
3359    /// Customer data, if any.
3360    #[serde(rename = "customers")]
3361    pub customers: Option<Vec<Customer>>,
3362    /// The hex encoded signature data.
3363    #[serde(rename = "sigFile", default)]
3364    pub sig_file: String,
3365    /// Card BIN ranges can be whitelisted so that they are read instead of being processed
3366/// directly. This is useful for integration with legacy gift card systems.
3367    #[serde(rename = "whiteListedCard")]
3368    pub white_listed_card: Option<WhiteListedCard>,
3369    /// That the transaction was flagged for store and forward due to network problems.
3370    #[serde(rename = "storeAndForward")]
3371    pub store_and_forward: bool,
3372    /// The current status of a transaction.
3373    #[serde(rename = "status")]
3374    pub status: String,
3375    /// Details about a payment card derived from its BIN/IIN.
3376    #[serde(rename = "cardMetadata", default)]
3377    pub card_metadata: Option<CardMetadata>,
3378
3379}
3380
3381/// Models the request for updated information about a transaction.
3382#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3383pub struct TransactionStatusRequest {
3384    /// The request timeout in seconds.
3385    #[serde(rename = "timeout")]
3386    pub timeout: i32,
3387    /// Whether or not to route transaction to the test gateway.
3388    #[serde(rename = "test")]
3389    pub test: bool,
3390    /// A user-assigned reference that can be used to recall or reverse transactions.
3391    #[serde(rename = "transactionRef", default)]
3392    pub transaction_ref: String,
3393    /// That the transaction reference was autogenerated and should be ignored for the
3394/// purposes of duplicate detection.
3395    #[serde(rename = "autogeneratedRef")]
3396    pub autogenerated_ref: bool,
3397    /// Defers the response to the transaction and returns immediately. Callers should
3398/// retrive the transaction result using the Transaction Status API.
3399    #[serde(rename = "async")]
3400    pub async_yo: bool,
3401    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
3402/// transaction result using the Transaction Status API.
3403    #[serde(rename = "queue")]
3404    pub queue: bool,
3405    /// Whether or not the request should block until all cards have been removed from the card
3406/// reader.
3407    #[serde(rename = "waitForRemovedCard", default)]
3408    pub wait_for_removed_card: bool,
3409    /// Override any in-progress transactions.
3410    #[serde(rename = "force", default)]
3411    pub force: bool,
3412    /// An identifier from an external point of sale system.
3413    #[serde(rename = "orderRef", default)]
3414    pub order_ref: String,
3415    /// The settlement account for merchants with split settlements.
3416    #[serde(rename = "destinationAccount", default)]
3417    pub destination_account: String,
3418    /// Can include a code used to trigger simulated conditions for the purposes of testing and
3419/// certification. Valid for test merchant accounts only.
3420    #[serde(rename = "testCase", default)]
3421    pub test_case: String,
3422    /// The BlockChyp assigned transaction id.
3423    #[serde(rename = "transactionId", default)]
3424    pub transaction_id: String,
3425
3426}
3427
3428/// Models the request for updated information about a payment link.
3429#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3430pub struct PaymentLinkStatusRequest {
3431    /// The request timeout in seconds.
3432    #[serde(rename = "timeout")]
3433    pub timeout: i32,
3434    /// Whether or not to route transaction to the test gateway.
3435    #[serde(rename = "test")]
3436    pub test: bool,
3437    /// The link code assigned to the payment link.
3438    #[serde(rename = "linkCode")]
3439    pub link_code: String,
3440
3441}
3442
3443/// Models the status of a payment link.
3444#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3445pub struct PaymentLinkStatusResponse {
3446    /// Whether or not the request succeeded.
3447    #[serde(rename = "success")]
3448    pub success: bool,
3449    /// The error, if an error occurred.
3450    #[serde(rename = "error")]
3451    pub error: String,
3452    /// A narrative description of the transaction result.
3453    #[serde(rename = "responseDescription")]
3454    pub response_description: String,
3455    /// The code used to retrieve the payment link.
3456    #[serde(rename = "linkCode")]
3457    pub link_code: String,
3458    /// The BlockChyp merchant id associated with a payment link.
3459    #[serde(rename = "merchantId")]
3460    pub merchant_id: String,
3461    /// The customer id associated with a payment link.
3462    #[serde(rename = "customerId", default)]
3463    pub customer_id: String,
3464    /// The user's internal reference for any transaction that may occur.
3465    #[serde(rename = "transactionRef", default)]
3466    pub transaction_ref: String,
3467    /// The user's internal reference for an order.
3468    #[serde(rename = "orderRef", default)]
3469    pub order_ref: String,
3470    /// That the order is tax exempt.
3471    #[serde(rename = "taxExempt", default)]
3472    pub tax_exempt: bool,
3473    /// That the amount to collect via the payment link.
3474    #[serde(rename = "amount", default)]
3475    pub amount: String,
3476    /// The sales tax to be collected via the payment link.
3477    #[serde(rename = "taxAmount", default)]
3478    pub tax_amount: String,
3479    /// Subject for email notifications.
3480    #[serde(rename = "subject", default)]
3481    pub subject: String,
3482    /// Id of the most recent transaction associated with the link.
3483    #[serde(rename = "transactionId", default)]
3484    pub transaction_id: String,
3485    /// Description associated with the payment link.
3486    #[serde(rename = "description", default)]
3487    pub description: String,
3488    /// Date and time the link will expire.
3489    #[serde(rename = "expiration", default)]
3490    pub expiration: Option<DateTime<Utc>>,
3491    /// Date and time the link was created.
3492    #[serde(rename = "dateCreated", default)]
3493    pub date_created: DateTime<Utc>,
3494    /// Line item level data if provided.
3495    #[serde(rename = "transactionDetails", default)]
3496    pub transaction_details: Option<TransactionDisplayTransaction>,
3497    /// The current status of the payment link.
3498    #[serde(rename = "status", default)]
3499    pub status: String,
3500    /// Alias for any terms and conditions language associated with the link.
3501    #[serde(rename = "tcAlias", default)]
3502    pub tc_alias: String,
3503    /// Name of any terms and conditions agreements associated with the payment link.
3504    #[serde(rename = "tcName", default)]
3505    pub tc_name: String,
3506    /// Full text of any terms and conditions language associated with the agreement.
3507    #[serde(rename = "tcContent", default)]
3508    pub tc_content: String,
3509    /// That the link is intended for internal use by the merchant.
3510    #[serde(rename = "cashierFacing", default)]
3511    pub cashier_facing: bool,
3512    /// That the payment method should be enrolled in the token vault.
3513    #[serde(rename = "enroll", default)]
3514    pub enroll: bool,
3515    /// That the link should only be used for enrollment in the token vault without any
3516/// underlying payment transaction.
3517    #[serde(rename = "enrollOnly", default)]
3518    pub enroll_only: bool,
3519    /// Returns details about the last transaction status.
3520    #[serde(rename = "lastTransaction", default)]
3521    pub last_transaction: Option<AuthorizationResponse>,
3522    /// Returns a list of transactions associated with the link, including any declines.
3523    #[serde(rename = "transactionHistory", default)]
3524    pub transaction_history: Option<Vec<AuthorizationResponse>>,
3525
3526}
3527
3528/// Models the status of a transaction.
3529#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3530pub struct TransactionStatus {
3531    /// Whether or not the request succeeded.
3532    #[serde(rename = "success")]
3533    pub success: bool,
3534    /// The error, if an error occurred.
3535    #[serde(rename = "error")]
3536    pub error: String,
3537    /// A narrative description of the transaction result.
3538    #[serde(rename = "responseDescription")]
3539    pub response_description: String,
3540    /// That the transaction was approved.
3541    #[serde(rename = "approved")]
3542    pub approved: bool,
3543    /// The auth code from the payment network.
3544    #[serde(rename = "authCode", default)]
3545    pub auth_code: String,
3546    /// The code returned by the terminal or the card issuer to indicate the disposition of the
3547/// message.
3548    #[serde(rename = "authResponseCode", default)]
3549    pub auth_response_code: String,
3550    /// The ID assigned to the transaction.
3551    #[serde(rename = "transactionId")]
3552    pub transaction_id: String,
3553    /// The ID assigned to the batch.
3554    #[serde(rename = "batchId", default)]
3555    pub batch_id: String,
3556    /// The transaction reference string assigned to the transaction request. If no
3557/// transaction ref was assiged on the request, then the gateway will randomly generate
3558/// one.
3559    #[serde(rename = "transactionRef", default)]
3560    pub transaction_ref: String,
3561    /// The type of transaction.
3562    #[serde(rename = "transactionType")]
3563    pub transaction_type: String,
3564    /// The timestamp of the transaction.
3565    #[serde(rename = "timestamp")]
3566    pub timestamp: String,
3567    /// The hash of the last tick block.
3568    #[serde(rename = "tickBlock")]
3569    pub tick_block: String,
3570    /// That the transaction was processed on the test gateway.
3571    #[serde(rename = "test")]
3572    pub test: bool,
3573    /// The settlement account for merchants with split settlements.
3574    #[serde(rename = "destinationAccount", default)]
3575    pub destination_account: String,
3576    /// The ECC signature of the response. Can be used to ensure that it was signed by the
3577/// terminal and detect man-in-the middle attacks.
3578    #[serde(rename = "sig", default)]
3579    pub sig: String,
3580    /// Whether or not the transaction was approved for a partial amount.
3581    #[serde(rename = "partialAuth")]
3582    pub partial_auth: bool,
3583    /// Whether or not an alternate currency was used.
3584    #[serde(rename = "altCurrency")]
3585    pub alt_currency: bool,
3586    /// Whether or not a request was settled on an FSA card.
3587    #[serde(rename = "fsaAuth")]
3588    pub fsa_auth: bool,
3589    /// The currency code used for the transaction.
3590    #[serde(rename = "currencyCode")]
3591    pub currency_code: String,
3592    /// The requested amount.
3593    #[serde(rename = "requestedAmount")]
3594    pub requested_amount: String,
3595    /// The authorized amount. May not match the requested amount in the event of a partial
3596/// auth.
3597    #[serde(rename = "authorizedAmount")]
3598    pub authorized_amount: String,
3599    /// The remaining balance on the payment method.
3600    #[serde(rename = "remainingBalance")]
3601    pub remaining_balance: String,
3602    /// The tip amount.
3603    #[serde(rename = "tipAmount")]
3604    pub tip_amount: String,
3605    /// The tax amount.
3606    #[serde(rename = "taxAmount")]
3607    pub tax_amount: String,
3608    /// The cash back amount the customer requested during the transaction.
3609    #[serde(rename = "requestedCashBackAmount")]
3610    pub requested_cash_back_amount: String,
3611    /// The amount of cash back authorized by the gateway. This amount will be the entire amount
3612/// requested, or zero.
3613    #[serde(rename = "authorizedCashBackAmount")]
3614    pub authorized_cash_back_amount: String,
3615    /// The payment token, if the payment was enrolled in the vault.
3616    #[serde(rename = "token", default)]
3617    pub token: String,
3618    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
3619    #[serde(rename = "entryMethod", default)]
3620    pub entry_method: String,
3621    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
3622    #[serde(rename = "paymentType", default)]
3623    pub payment_type: String,
3624    /// Provides network level detail on how a transaction was routed, especially for debit
3625/// transactions.
3626    #[serde(rename = "network", default)]
3627    pub network: String,
3628    /// Identifies the card association based on bin number. Used primarily used to indicate
3629/// the major logo on a card, even when debit transactions are routed on a different
3630/// network.
3631    #[serde(rename = "logo", default)]
3632    pub logo: String,
3633    /// The masked primary account number.
3634    #[serde(rename = "maskedPan", default)]
3635    pub masked_pan: String,
3636    /// The BlockChyp public key if the user presented a BlockChyp payment card.
3637    #[serde(rename = "publicKey", default)]
3638    pub public_key: String,
3639    /// That the transaction did something that would put the system in PCI scope.
3640    #[serde(rename = "ScopeAlert", default)]
3641    pub scope_alert: bool,
3642    /// The cardholder name.
3643    #[serde(rename = "cardHolder", default)]
3644    pub card_holder: String,
3645    /// The card expiration month in MM format.
3646    #[serde(rename = "expMonth", default)]
3647    pub exp_month: String,
3648    /// The card expiration year in YY format.
3649    #[serde(rename = "expYear", default)]
3650    pub exp_year: String,
3651    /// The card postal code.
3652    #[serde(rename = "postalCode", default)]
3653    pub postal_code: String,
3654    /// The card address.
3655    #[serde(rename = "address", default)]
3656    pub address: String,
3657    /// The card country.
3658    #[serde(rename = "country", default)]
3659    pub country: String,
3660    /// Address verification results if address information was submitted.
3661    #[serde(rename = "avsResponse")]
3662    pub avs_response: AVSResponse,
3663    /// The CVV verification result if CVV was submitted.
3664    #[serde(rename = "cvvResponse", default)]
3665    pub cvv_response: String,
3666    /// Suggested receipt fields.
3667    #[serde(rename = "receiptSuggestions")]
3668    pub receipt_suggestions: ReceiptSuggestions,
3669    /// Customer data, if any. Preserved for reverse compatibility.
3670    #[serde(rename = "customer")]
3671    pub customer: Option<Customer>,
3672    /// Customer data, if any.
3673    #[serde(rename = "customers")]
3674    pub customers: Option<Vec<Customer>>,
3675    /// The hex encoded signature data.
3676    #[serde(rename = "sigFile", default)]
3677    pub sig_file: String,
3678    /// That the transaction was flagged for store and forward due to network problems.
3679    #[serde(rename = "storeAndForward")]
3680    pub store_and_forward: bool,
3681
3682}
3683
3684/// An item level discount for transaction display. Discounts never combine.
3685#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3686pub struct TransactionDisplayDiscount {
3687    /// The discount description.
3688    #[serde(rename = "description")]
3689    pub description: String,
3690    /// The amount of the discount.
3691    #[serde(rename = "amount")]
3692    pub amount: String,
3693
3694}
3695
3696/// An item category in a transaction display. Groups combine if their descriptions
3697/// match. Calculated subtotal amounts are rounded to two decimal places of precision.
3698/// Quantity is a floating point number that is not rounded at all.
3699#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3700pub struct TransactionDisplayItem {
3701    /// A unique value identifying the item. This is not required, but recommended since it is
3702/// required to update or delete line items.
3703    #[serde(rename = "id")]
3704    pub id: String,
3705    /// A description of the line item.
3706    #[serde(rename = "description")]
3707    pub description: String,
3708    /// The price of the line item.
3709    #[serde(rename = "price")]
3710    pub price: String,
3711    /// The quantity of the line item.
3712    #[serde(rename = "quantity")]
3713    pub quantity: f64,
3714    /// An item category in a transaction display. Groups combine if their descriptions
3715/// match. Calculated subtotal amounts are rounded to two decimal places of precision.
3716/// Quantity is a floating point number that is not rounded at all.
3717    #[serde(rename = "extended")]
3718    pub extended: String,
3719    /// An alphanumeric code for units of measurement as used in international trade.
3720    #[serde(rename = "unitCode")]
3721    pub unit_code: String,
3722    /// An international description code of the item.
3723    #[serde(rename = "commodityCode")]
3724    pub commodity_code: String,
3725    /// A merchant-defined description code of the item.
3726    #[serde(rename = "productCode")]
3727    pub product_code: String,
3728    /// Are displayed under their corresponding item.
3729    #[serde(rename = "discounts")]
3730    pub discounts: Option<Vec<TransactionDisplayDiscount>>,
3731    /// The amount of any value added taxes which apply to the item.
3732    #[serde(rename = "taxAmount", default)]
3733    pub tax_amount: String,
3734    /// The tax rate as a percentage. Example: '8.5' for 8.5% tax rate.
3735    #[serde(rename = "taxRate", default)]
3736    pub tax_rate: String,
3737    /// How tax was applied to discounted items. '0' = no discount, '1' = tax calculated after
3738/// discount, '2' = taxcalculated before discount.
3739    #[serde(rename = "discountCode", default)]
3740    pub discount_code: String,
3741
3742}
3743
3744/// The items to display on a terminal.
3745#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3746pub struct TransactionDisplayTransaction {
3747    /// The subtotal to display.
3748    #[serde(rename = "subtotal")]
3749    pub subtotal: String,
3750    /// The tax to display.
3751    #[serde(rename = "tax")]
3752    pub tax: String,
3753    /// The total to display.
3754    #[serde(rename = "total")]
3755    pub total: String,
3756    /// An item to display. Can be overwritten or appended, based on the request type.
3757    #[serde(rename = "items")]
3758    pub items: Option<Vec<TransactionDisplayItem>>,
3759
3760}
3761
3762/// Used to start or update a transaction line item display on a terminal.
3763#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3764pub struct TransactionDisplayRequest {
3765    /// The request timeout in seconds.
3766    #[serde(rename = "timeout")]
3767    pub timeout: i32,
3768    /// Whether or not to route transaction to the test gateway.
3769    #[serde(rename = "test")]
3770    pub test: bool,
3771    /// A user-assigned reference that can be used to recall or reverse transactions.
3772    #[serde(rename = "transactionRef", default)]
3773    pub transaction_ref: String,
3774    /// That the transaction reference was autogenerated and should be ignored for the
3775/// purposes of duplicate detection.
3776    #[serde(rename = "autogeneratedRef")]
3777    pub autogenerated_ref: bool,
3778    /// Defers the response to the transaction and returns immediately. Callers should
3779/// retrive the transaction result using the Transaction Status API.
3780    #[serde(rename = "async")]
3781    pub async_yo: bool,
3782    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
3783/// transaction result using the Transaction Status API.
3784    #[serde(rename = "queue")]
3785    pub queue: bool,
3786    /// Whether or not the request should block until all cards have been removed from the card
3787/// reader.
3788    #[serde(rename = "waitForRemovedCard", default)]
3789    pub wait_for_removed_card: bool,
3790    /// Override any in-progress transactions.
3791    #[serde(rename = "force", default)]
3792    pub force: bool,
3793    /// An identifier from an external point of sale system.
3794    #[serde(rename = "orderRef", default)]
3795    pub order_ref: String,
3796    /// The settlement account for merchants with split settlements.
3797    #[serde(rename = "destinationAccount", default)]
3798    pub destination_account: String,
3799    /// Can include a code used to trigger simulated conditions for the purposes of testing and
3800/// certification. Valid for test merchant accounts only.
3801    #[serde(rename = "testCase", default)]
3802    pub test_case: String,
3803    /// The name of the target payment terminal.
3804    #[serde(rename = "terminalName", default)]
3805    pub terminal_name: String,
3806    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
3807/// This is a diagnostic settings that can be used only for test transactions.
3808    #[serde(rename = "resetConnection")]
3809    pub reset_connection: bool,
3810    /// Transaction to display on the terminal.
3811    #[serde(rename = "transaction")]
3812    pub transaction: Option<TransactionDisplayTransaction>,
3813
3814}
3815
3816/// The response to a basic API health check. If the security context permits it, the
3817/// response may also include the public key of the current merchant.
3818#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3819pub struct HeartbeatResponse {
3820    /// Whether or not the request succeeded.
3821    #[serde(rename = "success")]
3822    pub success: bool,
3823    /// The error, if an error occurred.
3824    #[serde(rename = "error")]
3825    pub error: String,
3826    /// A narrative description of the transaction result.
3827    #[serde(rename = "responseDescription")]
3828    pub response_description: String,
3829    /// The timestamp of the heartbeat.
3830    #[serde(rename = "timestamp")]
3831    pub timestamp: DateTime<Utc>,
3832    /// The public key of the clockchain. This is blockchain stuff that you don't really need to
3833/// worry about. It is a base 58 encoded and compressed eliptic curve public key. For the
3834/// production clockchain, this will always be:
3835/// '3cuhsckVUd9HzMjbdUSW17aY5kCcm1d6YAphJMUwmtXRj7WLyU'.
3836    #[serde(rename = "clockchain")]
3837    pub clockchain: String,
3838    /// The hash of the last tick block.
3839    #[serde(rename = "latestTick")]
3840    pub latest_tick: String,
3841    /// The public key for the merchant's blockchain.
3842    #[serde(rename = "merchantPublicKey")]
3843    pub merchant_public_key: String,
3844
3845}
3846
3847/// A request for the status of a terminal.
3848#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3849pub struct TerminalStatusRequest {
3850    /// The request timeout in seconds.
3851    #[serde(rename = "timeout")]
3852    pub timeout: i32,
3853    /// Whether or not to route transaction to the test gateway.
3854    #[serde(rename = "test")]
3855    pub test: bool,
3856    /// A user-assigned reference that can be used to recall or reverse transactions.
3857    #[serde(rename = "transactionRef", default)]
3858    pub transaction_ref: String,
3859    /// That the transaction reference was autogenerated and should be ignored for the
3860/// purposes of duplicate detection.
3861    #[serde(rename = "autogeneratedRef")]
3862    pub autogenerated_ref: bool,
3863    /// Defers the response to the transaction and returns immediately. Callers should
3864/// retrive the transaction result using the Transaction Status API.
3865    #[serde(rename = "async")]
3866    pub async_yo: bool,
3867    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
3868/// transaction result using the Transaction Status API.
3869    #[serde(rename = "queue")]
3870    pub queue: bool,
3871    /// Whether or not the request should block until all cards have been removed from the card
3872/// reader.
3873    #[serde(rename = "waitForRemovedCard", default)]
3874    pub wait_for_removed_card: bool,
3875    /// Override any in-progress transactions.
3876    #[serde(rename = "force", default)]
3877    pub force: bool,
3878    /// An identifier from an external point of sale system.
3879    #[serde(rename = "orderRef", default)]
3880    pub order_ref: String,
3881    /// The settlement account for merchants with split settlements.
3882    #[serde(rename = "destinationAccount", default)]
3883    pub destination_account: String,
3884    /// Can include a code used to trigger simulated conditions for the purposes of testing and
3885/// certification. Valid for test merchant accounts only.
3886    #[serde(rename = "testCase", default)]
3887    pub test_case: String,
3888    /// The name of the target payment terminal.
3889    #[serde(rename = "terminalName", default)]
3890    pub terminal_name: String,
3891    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
3892/// This is a diagnostic settings that can be used only for test transactions.
3893    #[serde(rename = "resetConnection")]
3894    pub reset_connection: bool,
3895
3896}
3897
3898/// The current status of a terminal.
3899#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3900pub struct TerminalStatusResponse {
3901    /// Whether or not the request succeeded.
3902    #[serde(rename = "success")]
3903    pub success: bool,
3904    /// The error, if an error occurred.
3905    #[serde(rename = "error")]
3906    pub error: String,
3907    /// A narrative description of the transaction result.
3908    #[serde(rename = "responseDescription")]
3909    pub response_description: String,
3910    /// That the terminal is idle.
3911    #[serde(rename = "idle")]
3912    pub idle: bool,
3913    /// Whether or not a card is currently in the card slot.
3914    #[serde(rename = "cardInSlot")]
3915    pub card_in_slot: bool,
3916    /// The operation that the terminal is performing.
3917    #[serde(rename = "status")]
3918    pub status: String,
3919    /// The transaction reference for an ongoing transaction, if one was specified at request
3920/// time.
3921    #[serde(rename = "transactionRef")]
3922    pub transaction_ref: String,
3923    /// The timestamp of the last status change.
3924    #[serde(rename = "since")]
3925    pub since: DateTime<Utc>,
3926
3927}
3928
3929/// Creates a payment link.
3930#[derive(Debug, Default, Clone, Serialize, Deserialize)]
3931pub struct PaymentLinkRequest {
3932    /// The request timeout in seconds.
3933    #[serde(rename = "timeout")]
3934    pub timeout: i32,
3935    /// Whether or not to route transaction to the test gateway.
3936    #[serde(rename = "test")]
3937    pub test: bool,
3938    /// A user-assigned reference that can be used to recall or reverse transactions.
3939    #[serde(rename = "transactionRef", default)]
3940    pub transaction_ref: String,
3941    /// That the transaction reference was autogenerated and should be ignored for the
3942/// purposes of duplicate detection.
3943    #[serde(rename = "autogeneratedRef")]
3944    pub autogenerated_ref: bool,
3945    /// Defers the response to the transaction and returns immediately. Callers should
3946/// retrive the transaction result using the Transaction Status API.
3947    #[serde(rename = "async")]
3948    pub async_yo: bool,
3949    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
3950/// transaction result using the Transaction Status API.
3951    #[serde(rename = "queue")]
3952    pub queue: bool,
3953    /// Whether or not the request should block until all cards have been removed from the card
3954/// reader.
3955    #[serde(rename = "waitForRemovedCard", default)]
3956    pub wait_for_removed_card: bool,
3957    /// Override any in-progress transactions.
3958    #[serde(rename = "force", default)]
3959    pub force: bool,
3960    /// An identifier from an external point of sale system.
3961    #[serde(rename = "orderRef", default)]
3962    pub order_ref: String,
3963    /// The settlement account for merchants with split settlements.
3964    #[serde(rename = "destinationAccount", default)]
3965    pub destination_account: String,
3966    /// Can include a code used to trigger simulated conditions for the purposes of testing and
3967/// certification. Valid for test merchant accounts only.
3968    #[serde(rename = "testCase", default)]
3969    pub test_case: String,
3970    /// The transaction currency code.
3971    #[serde(rename = "currencyCode")]
3972    pub currency_code: String,
3973    /// The requested amount.
3974    #[serde(rename = "amount")]
3975    pub amount: String,
3976    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
3977    #[serde(rename = "taxExempt")]
3978    pub tax_exempt: bool,
3979    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
3980    #[serde(rename = "surcharge")]
3981    pub surcharge: bool,
3982    /// A flag that applies a discount to negate the surcharge for debit transactions or other
3983/// surcharge ineligible payment methods.
3984    #[serde(rename = "cashDiscount")]
3985    pub cash_discount: bool,
3986    /// The name of the target payment terminal.
3987    #[serde(rename = "terminalName", default)]
3988    pub terminal_name: String,
3989    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
3990/// This is a diagnostic settings that can be used only for test transactions.
3991    #[serde(rename = "resetConnection")]
3992    pub reset_connection: bool,
3993    /// Automatically send the link via an email.
3994    #[serde(rename = "autoSend")]
3995    pub auto_send: bool,
3996    /// That the payment method should be added to the token vault alongside the
3997/// authorization.
3998    #[serde(rename = "enroll", default)]
3999    pub enroll: bool,
4000    /// That the link should be used to enroll a token only. Can only be used in cashier mode.
4001    #[serde(rename = "enrollOnly", default)]
4002    pub enroll_only: bool,
4003    /// That the QR Code binary should be returned.
4004    #[serde(rename = "qrcodeBinary", default)]
4005    pub qrcode_binary: bool,
4006    /// Determines the size of the qr code to be returned.
4007    #[serde(rename = "qrcodeSize", default)]
4008    pub qrcode_size: i32,
4009    /// Number of days until the payment link expires.
4010    #[serde(rename = "daysToExpiration", default)]
4011    pub days_to_expiration: i32,
4012    /// Flags the payment link as cashier facing.
4013    #[serde(rename = "cashier")]
4014    pub cashier: bool,
4015    /// Description explaining the transaction for display to the user.
4016    #[serde(rename = "description")]
4017    pub description: String,
4018    /// Subject of the payment email.
4019    #[serde(rename = "subject")]
4020    pub subject: String,
4021    /// Transaction details for display on the payment email.
4022    #[serde(rename = "transaction")]
4023    pub transaction: Option<TransactionDisplayTransaction>,
4024    /// Customer information.
4025    #[serde(rename = "customer")]
4026    pub customer: Customer,
4027    /// Optional callback url to which transaction responses for this link will be posted.
4028    #[serde(rename = "callbackUrl")]
4029    pub callback_url: String,
4030    /// An alias for a Terms and Conditions template configured in the BlockChyp dashboard.
4031    #[serde(rename = "tcAlias")]
4032    pub tc_alias: String,
4033    /// The name of the Terms and Conditions the user is accepting.
4034    #[serde(rename = "tcName")]
4035    pub tc_name: String,
4036    /// The content of the terms and conditions that will be presented to the user.
4037    #[serde(rename = "tcContent")]
4038    pub tc_content: String,
4039    /// That the transaction should be a cryptocurrency transaction. Value should be a crypto
4040/// currency code (ETH, BTC) or ANY to prompt the user to choose from supported
4041/// cryptocurrencies.
4042    #[serde(rename = "cryptocurrency")]
4043    pub cryptocurrency: Option<String>,
4044    /// An optional parameter that can be used to force a crypto transaction onto a level one or
4045/// level two network. Valid values are L1 and L2. Defaults to L1.
4046    #[serde(rename = "cryptoNetwork")]
4047    pub crypto_network: Option<String>,
4048    /// Can be used to specify a specific receive address for a crypto transaction. Disabled by
4049/// default. This should only be used by sophisticated users with access to properly
4050/// configured hot wallets.
4051    #[serde(rename = "cryptoReceiveAddress")]
4052    pub crypto_receive_address: Option<String>,
4053    /// Can optionally add a label to the payment request if the target cryptocurrency
4054/// supports labels. Defaults to the merchant's DBA Name.
4055    #[serde(rename = "paymentRequestLabel")]
4056    pub payment_request_label: Option<String>,
4057    /// Can optionally add a message to the payment request if the target cryptocurrency
4058/// supports labels. Defaults to empty.
4059    #[serde(rename = "paymentRequestMessage")]
4060    pub payment_request_message: Option<String>,
4061
4062}
4063
4064/// Creates a payment link.
4065#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4066pub struct PaymentLinkResponse {
4067    /// Whether or not the request succeeded.
4068    #[serde(rename = "success")]
4069    pub success: bool,
4070    /// The error, if an error occurred.
4071    #[serde(rename = "error")]
4072    pub error: String,
4073    /// A narrative description of the transaction result.
4074    #[serde(rename = "responseDescription")]
4075    pub response_description: String,
4076    /// The payment link code.
4077    #[serde(rename = "linkCode")]
4078    pub link_code: String,
4079    /// The url for the payment link.
4080    #[serde(rename = "url")]
4081    pub url: String,
4082    /// The url for a QR Code associated with this link.
4083    #[serde(rename = "qrcodeUrl")]
4084    pub qrcode_url: String,
4085    /// The hex encoded binary for the QR Code, if requested. Encoded in PNG format.
4086    #[serde(rename = "qrcodeBinary")]
4087    pub qrcode_binary: String,
4088    /// The customer id created or used for the payment.
4089    #[serde(rename = "customerId")]
4090    pub customer_id: String,
4091
4092}
4093
4094/// Cancels a pending payment link. Payment links that have already been used cannot be
4095/// canceled and the request will be rejected.
4096#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4097pub struct CancelPaymentLinkRequest {
4098    /// The request timeout in seconds.
4099    #[serde(rename = "timeout")]
4100    pub timeout: i32,
4101    /// Whether or not to route transaction to the test gateway.
4102    #[serde(rename = "test")]
4103    pub test: bool,
4104    /// A user-assigned reference that can be used to recall or reverse transactions.
4105    #[serde(rename = "transactionRef", default)]
4106    pub transaction_ref: String,
4107    /// That the transaction reference was autogenerated and should be ignored for the
4108/// purposes of duplicate detection.
4109    #[serde(rename = "autogeneratedRef")]
4110    pub autogenerated_ref: bool,
4111    /// Defers the response to the transaction and returns immediately. Callers should
4112/// retrive the transaction result using the Transaction Status API.
4113    #[serde(rename = "async")]
4114    pub async_yo: bool,
4115    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
4116/// transaction result using the Transaction Status API.
4117    #[serde(rename = "queue")]
4118    pub queue: bool,
4119    /// Whether or not the request should block until all cards have been removed from the card
4120/// reader.
4121    #[serde(rename = "waitForRemovedCard", default)]
4122    pub wait_for_removed_card: bool,
4123    /// Override any in-progress transactions.
4124    #[serde(rename = "force", default)]
4125    pub force: bool,
4126    /// An identifier from an external point of sale system.
4127    #[serde(rename = "orderRef", default)]
4128    pub order_ref: String,
4129    /// The settlement account for merchants with split settlements.
4130    #[serde(rename = "destinationAccount", default)]
4131    pub destination_account: String,
4132    /// Can include a code used to trigger simulated conditions for the purposes of testing and
4133/// certification. Valid for test merchant accounts only.
4134    #[serde(rename = "testCase", default)]
4135    pub test_case: String,
4136    /// The payment link code to cancel.
4137    #[serde(rename = "linkCode")]
4138    pub link_code: String,
4139
4140}
4141
4142/// Success or failure of a payment link cancellation.
4143#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4144pub struct CancelPaymentLinkResponse {
4145    /// Whether or not the request succeeded.
4146    #[serde(rename = "success")]
4147    pub success: bool,
4148    /// The error, if an error occurred.
4149    #[serde(rename = "error")]
4150    pub error: String,
4151    /// A narrative description of the transaction result.
4152    #[serde(rename = "responseDescription")]
4153    pub response_description: String,
4154
4155}
4156
4157/// Resends a pending payment link. Payment links that have already been used or cancelled
4158/// cannot be resent and the request will be rejected.
4159#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4160pub struct ResendPaymentLinkRequest {
4161    /// The request timeout in seconds.
4162    #[serde(rename = "timeout")]
4163    pub timeout: i32,
4164    /// Whether or not to route transaction to the test gateway.
4165    #[serde(rename = "test")]
4166    pub test: bool,
4167    /// A user-assigned reference that can be used to recall or reverse transactions.
4168    #[serde(rename = "transactionRef", default)]
4169    pub transaction_ref: String,
4170    /// That the transaction reference was autogenerated and should be ignored for the
4171/// purposes of duplicate detection.
4172    #[serde(rename = "autogeneratedRef")]
4173    pub autogenerated_ref: bool,
4174    /// Defers the response to the transaction and returns immediately. Callers should
4175/// retrive the transaction result using the Transaction Status API.
4176    #[serde(rename = "async")]
4177    pub async_yo: bool,
4178    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
4179/// transaction result using the Transaction Status API.
4180    #[serde(rename = "queue")]
4181    pub queue: bool,
4182    /// Whether or not the request should block until all cards have been removed from the card
4183/// reader.
4184    #[serde(rename = "waitForRemovedCard", default)]
4185    pub wait_for_removed_card: bool,
4186    /// Override any in-progress transactions.
4187    #[serde(rename = "force", default)]
4188    pub force: bool,
4189    /// An identifier from an external point of sale system.
4190    #[serde(rename = "orderRef", default)]
4191    pub order_ref: String,
4192    /// The settlement account for merchants with split settlements.
4193    #[serde(rename = "destinationAccount", default)]
4194    pub destination_account: String,
4195    /// Can include a code used to trigger simulated conditions for the purposes of testing and
4196/// certification. Valid for test merchant accounts only.
4197    #[serde(rename = "testCase", default)]
4198    pub test_case: String,
4199    /// The payment link code to cancel.
4200    #[serde(rename = "linkCode")]
4201    pub link_code: String,
4202
4203}
4204
4205/// Success or failure of a payment link resend operation.
4206#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4207pub struct ResendPaymentLinkResponse {
4208    /// Whether or not the request succeeded.
4209    #[serde(rename = "success")]
4210    pub success: bool,
4211    /// The error, if an error occurred.
4212    #[serde(rename = "error")]
4213    pub error: String,
4214    /// A narrative description of the transaction result.
4215    #[serde(rename = "responseDescription")]
4216    pub response_description: String,
4217
4218}
4219
4220/// Computes the cash discount for a cash discount if enabled.
4221#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4222pub struct CashDiscountRequest {
4223    /// The request timeout in seconds.
4224    #[serde(rename = "timeout")]
4225    pub timeout: i32,
4226    /// Whether or not to route transaction to the test gateway.
4227    #[serde(rename = "test")]
4228    pub test: bool,
4229    /// A user-assigned reference that can be used to recall or reverse transactions.
4230    #[serde(rename = "transactionRef", default)]
4231    pub transaction_ref: String,
4232    /// That the transaction reference was autogenerated and should be ignored for the
4233/// purposes of duplicate detection.
4234    #[serde(rename = "autogeneratedRef")]
4235    pub autogenerated_ref: bool,
4236    /// Defers the response to the transaction and returns immediately. Callers should
4237/// retrive the transaction result using the Transaction Status API.
4238    #[serde(rename = "async")]
4239    pub async_yo: bool,
4240    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
4241/// transaction result using the Transaction Status API.
4242    #[serde(rename = "queue")]
4243    pub queue: bool,
4244    /// Whether or not the request should block until all cards have been removed from the card
4245/// reader.
4246    #[serde(rename = "waitForRemovedCard", default)]
4247    pub wait_for_removed_card: bool,
4248    /// Override any in-progress transactions.
4249    #[serde(rename = "force", default)]
4250    pub force: bool,
4251    /// An identifier from an external point of sale system.
4252    #[serde(rename = "orderRef", default)]
4253    pub order_ref: String,
4254    /// The settlement account for merchants with split settlements.
4255    #[serde(rename = "destinationAccount", default)]
4256    pub destination_account: String,
4257    /// Can include a code used to trigger simulated conditions for the purposes of testing and
4258/// certification. Valid for test merchant accounts only.
4259    #[serde(rename = "testCase", default)]
4260    pub test_case: String,
4261    /// The transaction currency code.
4262    #[serde(rename = "currencyCode")]
4263    pub currency_code: String,
4264    /// The requested amount.
4265    #[serde(rename = "amount")]
4266    pub amount: String,
4267    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
4268    #[serde(rename = "taxExempt")]
4269    pub tax_exempt: bool,
4270    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
4271    #[serde(rename = "surcharge")]
4272    pub surcharge: bool,
4273    /// A flag that applies a discount to negate the surcharge for debit transactions or other
4274/// surcharge ineligible payment methods.
4275    #[serde(rename = "cashDiscount")]
4276    pub cash_discount: bool,
4277    /// How partial pennies should be rounded for calculated values like surcharges.
4278/// Rounding up is the default behavior.
4279    #[serde(rename = "roundingMode")]
4280    pub rounding_mode: Option<RoundingMode>,
4281
4282}
4283
4284/// Models the results of a cash discount calculation.
4285#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4286pub struct CashDiscountResponse {
4287    /// Whether or not the request succeeded.
4288    #[serde(rename = "success")]
4289    pub success: bool,
4290    /// The error, if an error occurred.
4291    #[serde(rename = "error")]
4292    pub error: String,
4293    /// A narrative description of the transaction result.
4294    #[serde(rename = "responseDescription")]
4295    pub response_description: String,
4296    /// The transaction currency code.
4297    #[serde(rename = "currencyCode")]
4298    pub currency_code: String,
4299    /// The new calculated total amount.
4300    #[serde(rename = "amount")]
4301    pub amount: String,
4302    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
4303    #[serde(rename = "taxExempt")]
4304    pub tax_exempt: bool,
4305    /// The normal surcharge for a transaction. Will only be returned if an offsetting cash
4306/// discount is also returned.
4307    #[serde(rename = "surcharge")]
4308    pub surcharge: String,
4309    /// The cash discount. Will not be returned in surcharge only mode.
4310    #[serde(rename = "cashDiscount")]
4311    pub cash_discount: String,
4312
4313}
4314
4315/// Models a batch history request.
4316#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4317pub struct TransactionHistoryRequest {
4318    /// The request timeout in seconds.
4319    #[serde(rename = "timeout")]
4320    pub timeout: i32,
4321    /// Whether or not to route transaction to the test gateway.
4322    #[serde(rename = "test")]
4323    pub test: bool,
4324    /// A user-assigned reference that can be used to recall or reverse transactions.
4325    #[serde(rename = "transactionRef", default)]
4326    pub transaction_ref: String,
4327    /// That the transaction reference was autogenerated and should be ignored for the
4328/// purposes of duplicate detection.
4329    #[serde(rename = "autogeneratedRef")]
4330    pub autogenerated_ref: bool,
4331    /// Defers the response to the transaction and returns immediately. Callers should
4332/// retrive the transaction result using the Transaction Status API.
4333    #[serde(rename = "async")]
4334    pub async_yo: bool,
4335    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
4336/// transaction result using the Transaction Status API.
4337    #[serde(rename = "queue")]
4338    pub queue: bool,
4339    /// Whether or not the request should block until all cards have been removed from the card
4340/// reader.
4341    #[serde(rename = "waitForRemovedCard", default)]
4342    pub wait_for_removed_card: bool,
4343    /// Override any in-progress transactions.
4344    #[serde(rename = "force", default)]
4345    pub force: bool,
4346    /// An identifier from an external point of sale system.
4347    #[serde(rename = "orderRef", default)]
4348    pub order_ref: String,
4349    /// The settlement account for merchants with split settlements.
4350    #[serde(rename = "destinationAccount", default)]
4351    pub destination_account: String,
4352    /// Can include a code used to trigger simulated conditions for the purposes of testing and
4353/// certification. Valid for test merchant accounts only.
4354    #[serde(rename = "testCase", default)]
4355    pub test_case: String,
4356    /// Optional search query. Will match amount, last 4 and customer name. batchId and
4357/// terminalName are not supported with this option.
4358    #[serde(rename = "query")]
4359    pub query: String,
4360    /// Optional batch id.
4361    #[serde(rename = "batchId")]
4362    pub batch_id: String,
4363    /// Optional terminal name.
4364    #[serde(rename = "terminalName")]
4365    pub terminal_name: String,
4366    /// Optional start date filter for batch history.
4367    #[serde(rename = "startDate")]
4368    pub start_date: DateTime<Utc>,
4369    /// Optional end date filter for batch history.
4370    #[serde(rename = "endDate")]
4371    pub end_date: DateTime<Utc>,
4372    /// Max results to be returned by this request.
4373    #[serde(rename = "maxResults")]
4374    pub max_results: i32,
4375    /// Starting index for results to be returned.
4376    #[serde(rename = "startIndex")]
4377    pub start_index: i32,
4378
4379}
4380
4381/// Models response to a batch history request.
4382#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4383pub struct TransactionHistoryResponse {
4384    /// Whether or not the request succeeded.
4385    #[serde(rename = "success")]
4386    pub success: bool,
4387    /// The error, if an error occurred.
4388    #[serde(rename = "error")]
4389    pub error: String,
4390    /// A narrative description of the transaction result.
4391    #[serde(rename = "responseDescription")]
4392    pub response_description: String,
4393    /// That the response came from the test gateway.
4394    #[serde(rename = "test")]
4395    pub test: bool,
4396    /// Batch identifier if filtered by batch.
4397    #[serde(rename = "batchId")]
4398    pub batch_id: String,
4399    /// Terminal name if filtered by terminal.
4400    #[serde(rename = "terminalName")]
4401    pub terminal_name: String,
4402    /// Start date if filtered by start date.
4403    #[serde(rename = "startDate")]
4404    pub start_date: DateTime<Utc>,
4405    /// End date if filtered by end date.
4406    #[serde(rename = "endDate")]
4407    pub end_date: DateTime<Utc>,
4408    /// Max results from the original request echoed back. Defaults to the system max of 250.
4409    #[serde(rename = "maxResults")]
4410    pub max_results: i32,
4411    /// Starting index from the original request echoed back.
4412    #[serde(rename = "startIndex")]
4413    pub start_index: i32,
4414    /// Total number of results accessible through paging.
4415    #[serde(rename = "totalResultCount")]
4416    pub total_result_count: i32,
4417    /// Matching transaction history.
4418    #[serde(rename = "transactions")]
4419    pub transactions: Option<Vec<AuthorizationResponse>>,
4420
4421}
4422
4423/// Models a batch history request.
4424#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4425pub struct BatchHistoryRequest {
4426    /// The request timeout in seconds.
4427    #[serde(rename = "timeout")]
4428    pub timeout: i32,
4429    /// Whether or not to route transaction to the test gateway.
4430    #[serde(rename = "test")]
4431    pub test: bool,
4432    /// A user-assigned reference that can be used to recall or reverse transactions.
4433    #[serde(rename = "transactionRef", default)]
4434    pub transaction_ref: String,
4435    /// That the transaction reference was autogenerated and should be ignored for the
4436/// purposes of duplicate detection.
4437    #[serde(rename = "autogeneratedRef")]
4438    pub autogenerated_ref: bool,
4439    /// Defers the response to the transaction and returns immediately. Callers should
4440/// retrive the transaction result using the Transaction Status API.
4441    #[serde(rename = "async")]
4442    pub async_yo: bool,
4443    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
4444/// transaction result using the Transaction Status API.
4445    #[serde(rename = "queue")]
4446    pub queue: bool,
4447    /// Whether or not the request should block until all cards have been removed from the card
4448/// reader.
4449    #[serde(rename = "waitForRemovedCard", default)]
4450    pub wait_for_removed_card: bool,
4451    /// Override any in-progress transactions.
4452    #[serde(rename = "force", default)]
4453    pub force: bool,
4454    /// An identifier from an external point of sale system.
4455    #[serde(rename = "orderRef", default)]
4456    pub order_ref: String,
4457    /// The settlement account for merchants with split settlements.
4458    #[serde(rename = "destinationAccount", default)]
4459    pub destination_account: String,
4460    /// Can include a code used to trigger simulated conditions for the purposes of testing and
4461/// certification. Valid for test merchant accounts only.
4462    #[serde(rename = "testCase", default)]
4463    pub test_case: String,
4464    /// Optional start date filter for batch history.
4465    #[serde(rename = "startDate")]
4466    pub start_date: DateTime<Utc>,
4467    /// Optional end date filter for batch history.
4468    #[serde(rename = "endDate")]
4469    pub end_date: DateTime<Utc>,
4470    /// Max results to be returned by this request. Defaults to the system max of 250.
4471    #[serde(rename = "maxResults")]
4472    pub max_results: i32,
4473    /// Starting index for results to be returned.
4474    #[serde(rename = "startIndex")]
4475    pub start_index: i32,
4476
4477}
4478
4479/// Models response to a batch history request.
4480#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4481pub struct BatchHistoryResponse {
4482    /// Whether or not the request succeeded.
4483    #[serde(rename = "success")]
4484    pub success: bool,
4485    /// The error, if an error occurred.
4486    #[serde(rename = "error")]
4487    pub error: String,
4488    /// A narrative description of the transaction result.
4489    #[serde(rename = "responseDescription")]
4490    pub response_description: String,
4491    /// That the response came from the test gateway.
4492    #[serde(rename = "test")]
4493    pub test: bool,
4494    /// Start date if filtered by start date.
4495    #[serde(rename = "startDate")]
4496    pub start_date: DateTime<Utc>,
4497    /// End date if filtered by end date.
4498    #[serde(rename = "endDate")]
4499    pub end_date: DateTime<Utc>,
4500    /// Merchant's batch history in descending order.
4501    #[serde(rename = "batches")]
4502    pub batches: Option<Vec<BatchSummary>>,
4503    /// Max results from the original request echoed back.
4504    #[serde(rename = "maxResults")]
4505    pub max_results: i32,
4506    /// Starting index from the original request echoed back.
4507    #[serde(rename = "startIndex")]
4508    pub start_index: i32,
4509    /// Total number of results accessible through paging.
4510    #[serde(rename = "totalResultCount")]
4511    pub total_result_count: i32,
4512
4513}
4514
4515/// Models high level information about a single batch.
4516#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4517pub struct BatchSummary {
4518    /// Batch identifier.
4519    #[serde(rename = "batchId")]
4520    pub batch_id: String,
4521    /// Entry method for the batch, if any.
4522    #[serde(rename = "entryMethod")]
4523    pub entry_method: String,
4524    /// Merchant deposit account into which proceeds should be deposited.
4525    #[serde(rename = "destinationAccountId")]
4526    pub destination_account_id: String,
4527    /// The new captured amount.
4528    #[serde(rename = "capturedAmount")]
4529    pub captured_amount: String,
4530    /// The amount of preauths opened during the batch that have not been captured.
4531    #[serde(rename = "openPreauths")]
4532    pub open_preauths: String,
4533    /// The currency the batch was settled in.
4534    #[serde(rename = "currencyCode")]
4535    pub currency_code: String,
4536    /// Flag indicating whether or not the batch is open.
4537    #[serde(rename = "open")]
4538    pub open: bool,
4539    /// Date and time of the first transaction for this batch.
4540    #[serde(rename = "openDate")]
4541    pub open_date: DateTime<Utc>,
4542    /// Date and time the batch was closed.
4543    #[serde(rename = "closeDate")]
4544    pub close_date: DateTime<Utc>,
4545
4546}
4547
4548/// Models a request for details about a single batch.
4549#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4550pub struct BatchDetailsRequest {
4551    /// The request timeout in seconds.
4552    #[serde(rename = "timeout")]
4553    pub timeout: i32,
4554    /// Whether or not to route transaction to the test gateway.
4555    #[serde(rename = "test")]
4556    pub test: bool,
4557    /// A user-assigned reference that can be used to recall or reverse transactions.
4558    #[serde(rename = "transactionRef", default)]
4559    pub transaction_ref: String,
4560    /// That the transaction reference was autogenerated and should be ignored for the
4561/// purposes of duplicate detection.
4562    #[serde(rename = "autogeneratedRef")]
4563    pub autogenerated_ref: bool,
4564    /// Defers the response to the transaction and returns immediately. Callers should
4565/// retrive the transaction result using the Transaction Status API.
4566    #[serde(rename = "async")]
4567    pub async_yo: bool,
4568    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
4569/// transaction result using the Transaction Status API.
4570    #[serde(rename = "queue")]
4571    pub queue: bool,
4572    /// Whether or not the request should block until all cards have been removed from the card
4573/// reader.
4574    #[serde(rename = "waitForRemovedCard", default)]
4575    pub wait_for_removed_card: bool,
4576    /// Override any in-progress transactions.
4577    #[serde(rename = "force", default)]
4578    pub force: bool,
4579    /// An identifier from an external point of sale system.
4580    #[serde(rename = "orderRef", default)]
4581    pub order_ref: String,
4582    /// The settlement account for merchants with split settlements.
4583    #[serde(rename = "destinationAccount", default)]
4584    pub destination_account: String,
4585    /// Can include a code used to trigger simulated conditions for the purposes of testing and
4586/// certification. Valid for test merchant accounts only.
4587    #[serde(rename = "testCase", default)]
4588    pub test_case: String,
4589    /// Id for the batch to be retrieved.
4590    #[serde(rename = "batchId")]
4591    pub batch_id: String,
4592
4593}
4594
4595/// Models a response for details about a single batch.
4596#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4597pub struct BatchDetailsResponse {
4598    /// Whether or not the request succeeded.
4599    #[serde(rename = "success")]
4600    pub success: bool,
4601    /// The error, if an error occurred.
4602    #[serde(rename = "error")]
4603    pub error: String,
4604    /// A narrative description of the transaction result.
4605    #[serde(rename = "responseDescription")]
4606    pub response_description: String,
4607    /// That the response came from the test gateway.
4608    #[serde(rename = "test")]
4609    pub test: bool,
4610    /// Batch identifier.
4611    #[serde(rename = "batchId")]
4612    pub batch_id: String,
4613    /// Entry method for the batch, if any.
4614    #[serde(rename = "entryMethod")]
4615    pub entry_method: String,
4616    /// Merchant deposit account into which proceeds should be deposited.
4617    #[serde(rename = "destinationAccountId")]
4618    pub destination_account_id: String,
4619    /// The new captured amount.
4620    #[serde(rename = "capturedAmount")]
4621    pub captured_amount: String,
4622    /// Preauths from this batch still open.
4623    #[serde(rename = "openPreauths")]
4624    pub open_preauths: String,
4625    /// The total volume from this batch.
4626    #[serde(rename = "totalVolume")]
4627    pub total_volume: String,
4628    /// The total number of transactions in this batch.
4629    #[serde(rename = "transactionCount")]
4630    pub transaction_count: i32,
4631    /// The total volume of gift cards sold.
4632    #[serde(rename = "giftCardsSold")]
4633    pub gift_cards_sold: String,
4634    /// The total volume of gift cards transactions.
4635    #[serde(rename = "giftCardVolume")]
4636    pub gift_card_volume: String,
4637    /// The expected volume for this batch, usually captured volume less gift card volume.
4638    #[serde(rename = "expectedDeposit")]
4639    pub expected_deposit: String,
4640    /// Flag indicating whether or not the batch is open.
4641    #[serde(rename = "open")]
4642    pub open: bool,
4643    /// Date and time of the first transaction for this batch.
4644    #[serde(rename = "openDate")]
4645    pub open_date: DateTime<Utc>,
4646    /// Date and time the batch was closed.
4647    #[serde(rename = "closeDate")]
4648    pub close_date: DateTime<Utc>,
4649    /// Merchant's batch history in descending order.
4650    #[serde(rename = "volumeByTerminal")]
4651    pub volume_by_terminal: Option<Vec<TerminalVolume>>,
4652    /// The net volume for this batch, usually expected volume less daily fees volume.
4653    #[serde(rename = "netDeposit")]
4654    pub net_deposit: String,
4655    /// The daily fees for this batch
4656    #[serde(rename = "dailyFees")]
4657    pub daily_fees: String,
4658
4659}
4660
4661/// Models transaction volume for a single terminal.
4662#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4663pub struct TerminalVolume {
4664    /// The terminal name assigned during activation.
4665    #[serde(rename = "terminalName")]
4666    pub terminal_name: String,
4667    /// The manufacturer's serial number.
4668    #[serde(rename = "serialNumber")]
4669    pub serial_number: String,
4670    /// The terminal type.
4671    #[serde(rename = "terminalType")]
4672    pub terminal_type: String,
4673    /// The captured amount.
4674    #[serde(rename = "capturedAmount")]
4675    pub captured_amount: String,
4676    /// The number of transactions run on this terminal.
4677    #[serde(rename = "transactionCount")]
4678    pub transaction_count: i32,
4679
4680}
4681
4682/// Models basic information needed to create a test merchant.
4683#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4684pub struct AddTestMerchantRequest {
4685    /// Whether or not to route transaction to the test gateway.
4686    #[serde(rename = "test")]
4687    pub test: bool,
4688    /// The DBA name for the test merchant.
4689    #[serde(rename = "dbaName")]
4690    pub dba_name: String,
4691    /// The corporate name for the test merchant.
4692    #[serde(rename = "companyName")]
4693    pub company_name: String,
4694    /// The request timeout in seconds.
4695    #[serde(rename = "timeout")]
4696    pub timeout: i32,
4697
4698}
4699
4700/// Models basic information needed to create a gateway merchant.
4701#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4702pub struct AddGatewayMerchantRequest {
4703    /// Whether or not to route transaction to the test gateway.
4704    #[serde(rename = "test")]
4705    pub test: bool,
4706    /// The merchant profile to be boarded.
4707    #[serde(rename = "profile")]
4708    pub profile: MerchantProfile,
4709    /// The request timeout in seconds.
4710    #[serde(rename = "timeout")]
4711    pub timeout: i32,
4712
4713}
4714
4715/// Models a request for information about the merchant profile.
4716#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4717pub struct MerchantProfileRequest {
4718    /// The request timeout in seconds.
4719    #[serde(rename = "timeout")]
4720    pub timeout: i32,
4721    /// Whether or not to route transaction to the test gateway.
4722    #[serde(rename = "test")]
4723    pub test: bool,
4724    /// A user-assigned reference that can be used to recall or reverse transactions.
4725    #[serde(rename = "transactionRef", default)]
4726    pub transaction_ref: String,
4727    /// That the transaction reference was autogenerated and should be ignored for the
4728/// purposes of duplicate detection.
4729    #[serde(rename = "autogeneratedRef")]
4730    pub autogenerated_ref: bool,
4731    /// Defers the response to the transaction and returns immediately. Callers should
4732/// retrive the transaction result using the Transaction Status API.
4733    #[serde(rename = "async")]
4734    pub async_yo: bool,
4735    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
4736/// transaction result using the Transaction Status API.
4737    #[serde(rename = "queue")]
4738    pub queue: bool,
4739    /// Whether or not the request should block until all cards have been removed from the card
4740/// reader.
4741    #[serde(rename = "waitForRemovedCard", default)]
4742    pub wait_for_removed_card: bool,
4743    /// Override any in-progress transactions.
4744    #[serde(rename = "force", default)]
4745    pub force: bool,
4746    /// An identifier from an external point of sale system.
4747    #[serde(rename = "orderRef", default)]
4748    pub order_ref: String,
4749    /// The settlement account for merchants with split settlements.
4750    #[serde(rename = "destinationAccount", default)]
4751    pub destination_account: String,
4752    /// Can include a code used to trigger simulated conditions for the purposes of testing and
4753/// certification. Valid for test merchant accounts only.
4754    #[serde(rename = "testCase", default)]
4755    pub test_case: String,
4756    /// The merchant id. Optional for merchant scoped requests.
4757    #[serde(rename = "merchantId")]
4758    pub merchant_id: String,
4759
4760}
4761
4762/// Models a request related to a platform configuration.
4763#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4764pub struct MerchantPlatformRequest {
4765    /// The request timeout in seconds.
4766    #[serde(rename = "timeout")]
4767    pub timeout: i32,
4768    /// Whether or not to route transaction to the test gateway.
4769    #[serde(rename = "test")]
4770    pub test: bool,
4771    /// A user-assigned reference that can be used to recall or reverse transactions.
4772    #[serde(rename = "transactionRef", default)]
4773    pub transaction_ref: String,
4774    /// That the transaction reference was autogenerated and should be ignored for the
4775/// purposes of duplicate detection.
4776    #[serde(rename = "autogeneratedRef")]
4777    pub autogenerated_ref: bool,
4778    /// Defers the response to the transaction and returns immediately. Callers should
4779/// retrive the transaction result using the Transaction Status API.
4780    #[serde(rename = "async")]
4781    pub async_yo: bool,
4782    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
4783/// transaction result using the Transaction Status API.
4784    #[serde(rename = "queue")]
4785    pub queue: bool,
4786    /// Whether or not the request should block until all cards have been removed from the card
4787/// reader.
4788    #[serde(rename = "waitForRemovedCard", default)]
4789    pub wait_for_removed_card: bool,
4790    /// Override any in-progress transactions.
4791    #[serde(rename = "force", default)]
4792    pub force: bool,
4793    /// An identifier from an external point of sale system.
4794    #[serde(rename = "orderRef", default)]
4795    pub order_ref: String,
4796    /// The settlement account for merchants with split settlements.
4797    #[serde(rename = "destinationAccount", default)]
4798    pub destination_account: String,
4799    /// Can include a code used to trigger simulated conditions for the purposes of testing and
4800/// certification. Valid for test merchant accounts only.
4801    #[serde(rename = "testCase", default)]
4802    pub test_case: String,
4803    /// The platform configuration id.
4804    #[serde(rename = "platformId")]
4805    pub platform_id: String,
4806
4807}
4808
4809/// Models a request for adding a new user to a merchant account.
4810#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4811pub struct InviteMerchantUserRequest {
4812    /// The request timeout in seconds.
4813    #[serde(rename = "timeout")]
4814    pub timeout: i32,
4815    /// Whether or not to route transaction to the test gateway.
4816    #[serde(rename = "test")]
4817    pub test: bool,
4818    /// A user-assigned reference that can be used to recall or reverse transactions.
4819    #[serde(rename = "transactionRef", default)]
4820    pub transaction_ref: String,
4821    /// That the transaction reference was autogenerated and should be ignored for the
4822/// purposes of duplicate detection.
4823    #[serde(rename = "autogeneratedRef")]
4824    pub autogenerated_ref: bool,
4825    /// Defers the response to the transaction and returns immediately. Callers should
4826/// retrive the transaction result using the Transaction Status API.
4827    #[serde(rename = "async")]
4828    pub async_yo: bool,
4829    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
4830/// transaction result using the Transaction Status API.
4831    #[serde(rename = "queue")]
4832    pub queue: bool,
4833    /// Whether or not the request should block until all cards have been removed from the card
4834/// reader.
4835    #[serde(rename = "waitForRemovedCard", default)]
4836    pub wait_for_removed_card: bool,
4837    /// Override any in-progress transactions.
4838    #[serde(rename = "force", default)]
4839    pub force: bool,
4840    /// An identifier from an external point of sale system.
4841    #[serde(rename = "orderRef", default)]
4842    pub order_ref: String,
4843    /// The settlement account for merchants with split settlements.
4844    #[serde(rename = "destinationAccount", default)]
4845    pub destination_account: String,
4846    /// Can include a code used to trigger simulated conditions for the purposes of testing and
4847/// certification. Valid for test merchant accounts only.
4848    #[serde(rename = "testCase", default)]
4849    pub test_case: String,
4850    /// The merchant id. Optional for merchant scoped requests.
4851    #[serde(rename = "merchantId")]
4852    pub merchant_id: String,
4853    /// The email address of the user.
4854    #[serde(rename = "email")]
4855    pub email: String,
4856    /// The first name of the new user.
4857    #[serde(rename = "firstName")]
4858    pub first_name: String,
4859    /// The last name of the new user.
4860    #[serde(rename = "lastName")]
4861    pub last_name: String,
4862    /// An optional array of role codes that will be assigned to the user. If omitted defaults to
4863/// the default merchant role.
4864    #[serde(rename = "roles")]
4865    pub roles: Option<Vec<String>>,
4866
4867}
4868
4869/// Models a physical address.
4870#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4871pub struct Address {
4872    /// The first line of the street address.
4873    #[serde(rename = "address1")]
4874    pub address_1: String,
4875    /// The second line of the street address.
4876    #[serde(rename = "address2")]
4877    pub address_2: String,
4878    /// The city associated with the street address.
4879    #[serde(rename = "city")]
4880    pub city: String,
4881    /// The state or province associated with the street address.
4882    #[serde(rename = "stateOrProvince")]
4883    pub state_or_province: String,
4884    /// The postal code associated with the street address.
4885    #[serde(rename = "postalCode")]
4886    pub postal_code: String,
4887    /// The ISO country code associated with the street address.
4888    #[serde(rename = "countryCode")]
4889    pub country_code: String,
4890    /// The latitude component of the address's GPS coordinates.
4891    #[serde(rename = "latitude")]
4892    pub latitude: f64,
4893    /// The longitude component of the address's GPS coordinates.
4894    #[serde(rename = "longitude")]
4895    pub longitude: f64,
4896
4897}
4898
4899/// Models a merchant profile.
4900#[derive(Debug, Default, Clone, Serialize, Deserialize)]
4901pub struct MerchantProfile {
4902    /// The request timeout in seconds.
4903    #[serde(rename = "timeout")]
4904    pub timeout: i32,
4905    /// That the response came from the test gateway.
4906    #[serde(rename = "test")]
4907    pub test: bool,
4908    /// The merchant id.
4909    #[serde(rename = "merchantId")]
4910    pub merchant_id: String,
4911    /// The primary bank mid.
4912    #[serde(rename = "bankMid")]
4913    pub bank_mid: String,
4914    /// The merchant's company name.
4915    #[serde(rename = "companyName")]
4916    pub company_name: String,
4917    /// The dba name of the merchant.
4918    #[serde(rename = "dbaName")]
4919    pub dba_name: String,
4920    /// The name the merchant prefers on payment link invoices.
4921    #[serde(rename = "invoiceName")]
4922    pub invoice_name: String,
4923    /// The contact name for the merchant.
4924    #[serde(rename = "contactName")]
4925    pub contact_name: String,
4926    /// The contact number for the merchant.
4927    #[serde(rename = "contactNumber")]
4928    pub contact_number: String,
4929    /// The location name.
4930    #[serde(rename = "locationName")]
4931    pub location_name: String,
4932    /// The store number.
4933    #[serde(rename = "storeNumber")]
4934    pub store_number: String,
4935    /// The partner assigne reference for this merchant.
4936    #[serde(rename = "partnerRef")]
4937    pub partner_ref: String,
4938    /// The merchant's local time zone.
4939    #[serde(rename = "timeZone")]
4940    pub time_zone: String,
4941    /// The batch close time in the merchant's time zone.
4942    #[serde(rename = "batchCloseTime")]
4943    pub batch_close_time: String,
4944    /// The terminal firmware update time.
4945    #[serde(rename = "terminalUpdateTime")]
4946    pub terminal_update_time: String,
4947    /// Flag indicating whether or not the batch automatically closes.
4948    #[serde(rename = "autoBatchClose")]
4949    pub auto_batch_close: bool,
4950    /// Flag indicating whether or not batch closure emails should be automatically sent.
4951    #[serde(rename = "disableBatchEmails")]
4952    pub disable_batch_emails: bool,
4953    /// Flag indicating whether or not pin entry is enabled.
4954    #[serde(rename = "pinEnabled")]
4955    pub pin_enabled: bool,
4956    /// Flag indicating whether or not cash back is enabled.
4957    #[serde(rename = "cashBackEnabled")]
4958    pub cash_back_enabled: bool,
4959    /// Flag indicating whether or not store and forward is enabled.
4960    #[serde(rename = "storeAndForwardEnabled")]
4961    pub store_and_forward_enabled: bool,
4962    /// Flag indicating whether or not partial authorizations are supported for this
4963/// merchant.
4964    #[serde(rename = "partialAuthEnabled")]
4965    pub partial_auth_enabled: bool,
4966    /// Flag indicating whether or not this merchant support split settlement.
4967    #[serde(rename = "splitBankAccountsEnabled")]
4968    pub split_bank_accounts_enabled: bool,
4969    /// Floor limit for store and forward transactions.
4970    #[serde(rename = "storeAndForwardFloorLimit")]
4971    pub store_and_forward_floor_limit: String,
4972    /// The blockchyp public key for this merchant.
4973    #[serde(rename = "publicKey")]
4974    pub public_key: String,
4975    /// The underwriting/processing status for the the merchant.
4976    #[serde(rename = "status")]
4977    pub status: String,
4978    /// Enables cash discount or surcharging.
4979    #[serde(rename = "cashDiscountEnabled")]
4980    pub cash_discount_enabled: bool,
4981    /// The post transaction survey timeout in seconds.
4982    #[serde(rename = "surveyTimeout")]
4983    pub survey_timeout: i32,
4984    /// Time a transaction result is displayed on a terminal before the terminal is
4985/// automatically cleared in seconds.
4986    #[serde(rename = "cooldownTimeout")]
4987    pub cooldown_timeout: i32,
4988    /// That tips are enabled for a merchant account.
4989    #[serde(rename = "tipEnabled")]
4990    pub tip_enabled: bool,
4991    /// That tips should be automatically prompted for after charge and preauth
4992/// transactions.
4993    #[serde(rename = "promptForTip")]
4994    pub prompt_for_tip: bool,
4995    /// Three default values for tips. Can be provided as a percentage if a percent sign is
4996/// provided. Otherwise the values are assumed to be basis points.
4997    #[serde(rename = "tipDefaults")]
4998    pub tip_defaults: Option<Vec<String>>,
4999    /// Four default values for cashback prompts.
5000    #[serde(rename = "cashbackPresets")]
5001    pub cashback_presets: Option<Vec<String>>,
5002    /// That EBT cards are enabled.
5003    #[serde(rename = "ebtEnabled")]
5004    pub ebt_enabled: bool,
5005    /// That refunds without transaction references are permitted.
5006    #[serde(rename = "freeRangeRefundsEnabled")]
5007    pub free_range_refunds_enabled: bool,
5008    /// That pin bypass is enabled.
5009    #[serde(rename = "pinBypassEnabled")]
5010    pub pin_bypass_enabled: bool,
5011    /// That gift cards are disabled.
5012    #[serde(rename = "giftCardsDisabled")]
5013    pub gift_cards_disabled: bool,
5014    /// Disables terms and conditions pages in the merchant UI.
5015    #[serde(rename = "tcDisabled")]
5016    pub tc_disabled: bool,
5017    /// That digital signature capture is enabled.
5018    #[serde(rename = "digitalSignaturesEnabled")]
5019    pub digital_signatures_enabled: bool,
5020    /// That transactions should auto-reverse when signatures are refused.
5021    #[serde(rename = "digitalSignatureReversal")]
5022    pub digital_signature_reversal: bool,
5023    /// The address to be used for billing correspondence.
5024    #[serde(rename = "billingAddress")]
5025    pub billing_address: Address,
5026    /// The address to be used for shipping.
5027    #[serde(rename = "shippingAddress")]
5028    pub shipping_address: Address,
5029    /// That Visa cards are supported.
5030    #[serde(rename = "visa")]
5031    pub visa: bool,
5032    /// That MasterCard is supported.
5033    #[serde(rename = "masterCard")]
5034    pub master_card: bool,
5035    /// That American Express is supported.
5036    #[serde(rename = "amex")]
5037    pub amex: bool,
5038    /// That Discover cards are supported.
5039    #[serde(rename = "discover")]
5040    pub discover: bool,
5041    /// That JCB (Japan Card Bureau) cards are supported.
5042    #[serde(rename = "jcb")]
5043    pub jcb: bool,
5044    /// That China Union Pay cards are supported.
5045    #[serde(rename = "unionPay")]
5046    pub union_pay: bool,
5047    /// That contactless EMV cards are supported.
5048    #[serde(rename = "contactlessEmv")]
5049    pub contactless_emv: bool,
5050    /// That manual card entry is enabled.
5051    #[serde(rename = "manualEntryEnabled")]
5052    pub manual_entry_enabled: bool,
5053    /// Requires a zip code to be entered for manually entered transactions.
5054    #[serde(rename = "manualEntryPromptZip")]
5055    pub manual_entry_prompt_zip: bool,
5056    /// Requires a street number to be entered for manually entered transactions.
5057    #[serde(rename = "manualEntryPromptStreetNumber")]
5058    pub manual_entry_prompt_street_number: bool,
5059    /// That this merchant is boarded on BlockChyp in gateway only mode.
5060    #[serde(rename = "gatewayOnly")]
5061    pub gateway_only: bool,
5062    /// Bank accounts for split bank account merchants.
5063    #[serde(rename = "bankAccounts")]
5064    pub bank_accounts: Option<Vec<BankAccount>>,
5065    /// That a merchant is allowed to send a surcharge amount directly to the gateway.
5066    #[serde(rename = "passthroughSurchargeEnabled")]
5067    pub passthrough_surcharge_enabled: bool,
5068    /// That CVV verification is enabled for manually entered transactions.
5069    #[serde(rename = "cvvVerificationEnabled")]
5070    pub cvv_verification_enabled: bool,
5071    /// That CVV mismatch (N) responses should be declined.
5072    #[serde(rename = "cvvVerificationNEnabled")]
5073    pub cvv_verification_nenabled: bool,
5074    /// That CVV not processed (P) responses should be declined.
5075    #[serde(rename = "cvvVerificationPEnabled")]
5076    pub cvv_verification_penabled: bool,
5077    /// That CVV should be on card but is not indicated (S) responses should be declined.
5078    #[serde(rename = "cvvVerificationSEnabled")]
5079    pub cvv_verification_senabled: bool,
5080    /// That issuer not certified or has not provided encryption key (U) responses should be
5081/// declined.
5082    #[serde(rename = "cvvVerificationUEnabled")]
5083    pub cvv_verification_uenabled: bool,
5084    /// That the merchant follows the partner's CVV settings.
5085    #[serde(rename = "followPartnerCvvSettings")]
5086    pub follow_partner_cvv_settings: bool,
5087    /// The AVS (Address Verification Service) rule to apply. Allowed values are
5088/// 'allow_all', 'require_full_match', 'require_zip_match',
5089/// 'require_address_match'. If avsRule is empty, then merchant follows partner
5090/// setting.
5091    #[serde(rename = "avsRule")]
5092    pub avs_rule: String,
5093    /// That the merchant follows the partner's AVS settings.
5094    #[serde(rename = "followPartnerAvsSettings")]
5095    pub follow_partner_avs_settings: bool,
5096    /// Flag indicating whether or not account updater is enrolled. Note that only merchant's
5097/// whose partner is enrolled will be processed by the account updater.
5098    #[serde(rename = "accountUpdaterEnrolled")]
5099    pub account_updater_enrolled: bool,
5100    /// Whether the merchant should bypass an auth with TSYS on Enrollment.
5101    #[serde(rename = "bypassEnrollAuthEnabled")]
5102    pub bypass_enroll_auth_enabled: bool,
5103
5104}
5105
5106/// Models a response for a single merchant profile.
5107#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5108pub struct MerchantProfileResponse {
5109    /// Whether or not the request succeeded.
5110    #[serde(rename = "success")]
5111    pub success: bool,
5112    /// The error, if an error occurred.
5113    #[serde(rename = "error")]
5114    pub error: String,
5115    /// A narrative description of the transaction result.
5116    #[serde(rename = "responseDescription")]
5117    pub response_description: String,
5118    /// That the response came from the test gateway.
5119    #[serde(rename = "test")]
5120    pub test: bool,
5121    /// The merchant id.
5122    #[serde(rename = "merchantId")]
5123    pub merchant_id: String,
5124    /// The primary bank mid.
5125    #[serde(rename = "bankMid")]
5126    pub bank_mid: String,
5127    /// The merchant's company name.
5128    #[serde(rename = "companyName")]
5129    pub company_name: String,
5130    /// The dba name of the merchant.
5131    #[serde(rename = "dbaName")]
5132    pub dba_name: String,
5133    /// The name the merchant prefers on payment link invoices.
5134    #[serde(rename = "invoiceName")]
5135    pub invoice_name: String,
5136    /// The contact name for the merchant.
5137    #[serde(rename = "contactName")]
5138    pub contact_name: String,
5139    /// The contact number for the merchant.
5140    #[serde(rename = "contactNumber")]
5141    pub contact_number: String,
5142    /// The location name.
5143    #[serde(rename = "locationName")]
5144    pub location_name: String,
5145    /// The store number.
5146    #[serde(rename = "storeNumber")]
5147    pub store_number: String,
5148    /// The partner assigne reference for this merchant.
5149    #[serde(rename = "partnerRef")]
5150    pub partner_ref: String,
5151    /// The merchant's local time zone.
5152    #[serde(rename = "timeZone")]
5153    pub time_zone: String,
5154    /// The batch close time in the merchant's time zone.
5155    #[serde(rename = "batchCloseTime")]
5156    pub batch_close_time: String,
5157    /// The terminal firmware update time.
5158    #[serde(rename = "terminalUpdateTime")]
5159    pub terminal_update_time: String,
5160    /// Flag indicating whether or not the batch automatically closes.
5161    #[serde(rename = "autoBatchClose")]
5162    pub auto_batch_close: bool,
5163    /// Flag indicating whether or not batch closure emails should be automatically sent.
5164    #[serde(rename = "disableBatchEmails")]
5165    pub disable_batch_emails: bool,
5166    /// Flag indicating whether or not pin entry is enabled.
5167    #[serde(rename = "pinEnabled")]
5168    pub pin_enabled: bool,
5169    /// Flag indicating whether or not cash back is enabled.
5170    #[serde(rename = "cashBackEnabled")]
5171    pub cash_back_enabled: bool,
5172    /// Flag indicating whether or not store and forward is enabled.
5173    #[serde(rename = "storeAndForwardEnabled")]
5174    pub store_and_forward_enabled: bool,
5175    /// Flag indicating whether or not partial authorizations are supported for this
5176/// merchant.
5177    #[serde(rename = "partialAuthEnabled")]
5178    pub partial_auth_enabled: bool,
5179    /// Flag indicating whether or not this merchant support split settlement.
5180    #[serde(rename = "splitBankAccountsEnabled")]
5181    pub split_bank_accounts_enabled: bool,
5182    /// Floor limit for store and forward transactions.
5183    #[serde(rename = "storeAndForwardFloorLimit")]
5184    pub store_and_forward_floor_limit: String,
5185    /// The blockchyp public key for this merchant.
5186    #[serde(rename = "publicKey")]
5187    pub public_key: String,
5188    /// The underwriting/processing status for the the merchant.
5189    #[serde(rename = "status")]
5190    pub status: String,
5191    /// Enables cash discount or surcharging.
5192    #[serde(rename = "cashDiscountEnabled")]
5193    pub cash_discount_enabled: bool,
5194    /// The post transaction survey timeout in seconds.
5195    #[serde(rename = "surveyTimeout")]
5196    pub survey_timeout: i32,
5197    /// Time a transaction result is displayed on a terminal before the terminal is
5198/// automatically cleared in seconds.
5199    #[serde(rename = "cooldownTimeout")]
5200    pub cooldown_timeout: i32,
5201    /// That tips are enabled for a merchant account.
5202    #[serde(rename = "tipEnabled")]
5203    pub tip_enabled: bool,
5204    /// That tips should be automatically prompted for after charge and preauth
5205/// transactions.
5206    #[serde(rename = "promptForTip")]
5207    pub prompt_for_tip: bool,
5208    /// Three default values for tips. Can be provided as a percentage if a percent sign is
5209/// provided. Otherwise the values are assumed to be basis points.
5210    #[serde(rename = "tipDefaults")]
5211    pub tip_defaults: Option<Vec<String>>,
5212    /// Four default values for cashback prompts.
5213    #[serde(rename = "cashbackPresets")]
5214    pub cashback_presets: Option<Vec<String>>,
5215    /// That EBT cards are enabled.
5216    #[serde(rename = "ebtEnabled")]
5217    pub ebt_enabled: bool,
5218    /// That refunds without transaction references are permitted.
5219    #[serde(rename = "freeRangeRefundsEnabled")]
5220    pub free_range_refunds_enabled: bool,
5221    /// That pin bypass is enabled.
5222    #[serde(rename = "pinBypassEnabled")]
5223    pub pin_bypass_enabled: bool,
5224    /// That gift cards are disabled.
5225    #[serde(rename = "giftCardsDisabled")]
5226    pub gift_cards_disabled: bool,
5227    /// Disables terms and conditions pages in the merchant UI.
5228    #[serde(rename = "tcDisabled")]
5229    pub tc_disabled: bool,
5230    /// That digital signature capture is enabled.
5231    #[serde(rename = "digitalSignaturesEnabled")]
5232    pub digital_signatures_enabled: bool,
5233    /// That transactions should auto-reverse when signatures are refused.
5234    #[serde(rename = "digitalSignatureReversal")]
5235    pub digital_signature_reversal: bool,
5236    /// The address to be used for billing correspondence.
5237    #[serde(rename = "billingAddress")]
5238    pub billing_address: Address,
5239    /// The address to be used for shipping.
5240    #[serde(rename = "shippingAddress")]
5241    pub shipping_address: Address,
5242    /// That Visa cards are supported.
5243    #[serde(rename = "visa")]
5244    pub visa: bool,
5245    /// That MasterCard is supported.
5246    #[serde(rename = "masterCard")]
5247    pub master_card: bool,
5248    /// That American Express is supported.
5249    #[serde(rename = "amex")]
5250    pub amex: bool,
5251    /// That Discover cards are supported.
5252    #[serde(rename = "discover")]
5253    pub discover: bool,
5254    /// That JCB (Japan Card Bureau) cards are supported.
5255    #[serde(rename = "jcb")]
5256    pub jcb: bool,
5257    /// That China Union Pay cards are supported.
5258    #[serde(rename = "unionPay")]
5259    pub union_pay: bool,
5260    /// That contactless EMV cards are supported.
5261    #[serde(rename = "contactlessEmv")]
5262    pub contactless_emv: bool,
5263    /// That manual card entry is enabled.
5264    #[serde(rename = "manualEntryEnabled")]
5265    pub manual_entry_enabled: bool,
5266    /// Requires a zip code to be entered for manually entered transactions.
5267    #[serde(rename = "manualEntryPromptZip")]
5268    pub manual_entry_prompt_zip: bool,
5269    /// Requires a street number to be entered for manually entered transactions.
5270    #[serde(rename = "manualEntryPromptStreetNumber")]
5271    pub manual_entry_prompt_street_number: bool,
5272    /// That this merchant is boarded on BlockChyp in gateway only mode.
5273    #[serde(rename = "gatewayOnly")]
5274    pub gateway_only: bool,
5275    /// Bank accounts for split bank account merchants.
5276    #[serde(rename = "bankAccounts")]
5277    pub bank_accounts: Option<Vec<BankAccount>>,
5278    /// That a merchant is allowed to send a surcharge amount directly to the gateway.
5279    #[serde(rename = "passthroughSurchargeEnabled")]
5280    pub passthrough_surcharge_enabled: bool,
5281    /// That CVV verification is enabled for manually entered transactions.
5282    #[serde(rename = "cvvVerificationEnabled")]
5283    pub cvv_verification_enabled: bool,
5284    /// That CVV mismatch (N) responses should be declined.
5285    #[serde(rename = "cvvVerificationNEnabled")]
5286    pub cvv_verification_nenabled: bool,
5287    /// That CVV not processed (P) responses should be declined.
5288    #[serde(rename = "cvvVerificationPEnabled")]
5289    pub cvv_verification_penabled: bool,
5290    /// That CVV should be on card but is not indicated (S) responses should be declined.
5291    #[serde(rename = "cvvVerificationSEnabled")]
5292    pub cvv_verification_senabled: bool,
5293    /// That issuer not certified or has not provided encryption key (U) responses should be
5294/// declined.
5295    #[serde(rename = "cvvVerificationUEnabled")]
5296    pub cvv_verification_uenabled: bool,
5297    /// That the merchant follows the partner's CVV settings.
5298    #[serde(rename = "followPartnerCvvSettings")]
5299    pub follow_partner_cvv_settings: bool,
5300    /// The AVS (Address Verification Service) rule to apply. Allowed values are
5301/// 'allow_all', 'require_full_match', 'require_zip_match',
5302/// 'require_address_match'. If avsRule is empty, then merchant follows partner
5303/// setting.
5304    #[serde(rename = "avsRule")]
5305    pub avs_rule: String,
5306    /// That the merchant follows the partner's AVS settings.
5307    #[serde(rename = "followPartnerAvsSettings")]
5308    pub follow_partner_avs_settings: bool,
5309    /// Flag indicating whether or not account updater is enrolled. Note that only merchant's
5310/// whose partner is enrolled will be processed by the account updater.
5311    #[serde(rename = "accountUpdaterEnrolled")]
5312    pub account_updater_enrolled: bool,
5313    /// Whether the merchant should bypass an auth with TSYS on Enrollment.
5314    #[serde(rename = "bypassEnrollAuthEnabled")]
5315    pub bypass_enroll_auth_enabled: bool,
5316
5317}
5318
5319/// Models meta data about a merchant bank account.
5320#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5321pub struct BankAccount {
5322    /// The account identifier to be used with authorization requests.
5323    #[serde(rename = "id")]
5324    pub id: String,
5325    /// The name of the account.
5326    #[serde(rename = "name")]
5327    pub name: String,
5328    /// The purpose of the account.
5329    #[serde(rename = "purpose")]
5330    pub purpose: String,
5331    /// The masked account number.
5332    #[serde(rename = "maskedAccountNumber")]
5333    pub masked_account_number: String,
5334
5335}
5336
5337/// Returns a list of queued transactions on a terminal.
5338#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5339pub struct ListQueuedTransactionsRequest {
5340    /// The request timeout in seconds.
5341    #[serde(rename = "timeout")]
5342    pub timeout: i32,
5343    /// Whether or not to route transaction to the test gateway.
5344    #[serde(rename = "test")]
5345    pub test: bool,
5346    /// A user-assigned reference that can be used to recall or reverse transactions.
5347    #[serde(rename = "transactionRef", default)]
5348    pub transaction_ref: String,
5349    /// That the transaction reference was autogenerated and should be ignored for the
5350/// purposes of duplicate detection.
5351    #[serde(rename = "autogeneratedRef")]
5352    pub autogenerated_ref: bool,
5353    /// Defers the response to the transaction and returns immediately. Callers should
5354/// retrive the transaction result using the Transaction Status API.
5355    #[serde(rename = "async")]
5356    pub async_yo: bool,
5357    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
5358/// transaction result using the Transaction Status API.
5359    #[serde(rename = "queue")]
5360    pub queue: bool,
5361    /// Whether or not the request should block until all cards have been removed from the card
5362/// reader.
5363    #[serde(rename = "waitForRemovedCard", default)]
5364    pub wait_for_removed_card: bool,
5365    /// Override any in-progress transactions.
5366    #[serde(rename = "force", default)]
5367    pub force: bool,
5368    /// An identifier from an external point of sale system.
5369    #[serde(rename = "orderRef", default)]
5370    pub order_ref: String,
5371    /// The settlement account for merchants with split settlements.
5372    #[serde(rename = "destinationAccount", default)]
5373    pub destination_account: String,
5374    /// Can include a code used to trigger simulated conditions for the purposes of testing and
5375/// certification. Valid for test merchant accounts only.
5376    #[serde(rename = "testCase", default)]
5377    pub test_case: String,
5378    /// The name of the target payment terminal.
5379    #[serde(rename = "terminalName", default)]
5380    pub terminal_name: String,
5381    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
5382/// This is a diagnostic settings that can be used only for test transactions.
5383    #[serde(rename = "resetConnection")]
5384    pub reset_connection: bool,
5385
5386}
5387
5388/// A list of queued transactions on a terminal.
5389#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5390pub struct ListQueuedTransactionsResponse {
5391    /// Whether or not the request succeeded.
5392    #[serde(rename = "success")]
5393    pub success: bool,
5394    /// The error, if an error occurred.
5395    #[serde(rename = "error")]
5396    pub error: String,
5397    /// A narrative description of the transaction result.
5398    #[serde(rename = "responseDescription")]
5399    pub response_description: String,
5400    /// A list of queued transactions on the terminal.
5401    #[serde(rename = "transactionRefs")]
5402    pub transaction_refs: Option<Vec<String>>,
5403
5404}
5405
5406/// Deletes one or all transactions from a terminal queue.
5407#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5408pub struct DeleteQueuedTransactionRequest {
5409    /// The request timeout in seconds.
5410    #[serde(rename = "timeout")]
5411    pub timeout: i32,
5412    /// Whether or not to route transaction to the test gateway.
5413    #[serde(rename = "test")]
5414    pub test: bool,
5415    /// That the transaction reference was autogenerated and should be ignored for the
5416/// purposes of duplicate detection.
5417    #[serde(rename = "autogeneratedRef")]
5418    pub autogenerated_ref: bool,
5419    /// Defers the response to the transaction and returns immediately. Callers should
5420/// retrive the transaction result using the Transaction Status API.
5421    #[serde(rename = "async")]
5422    pub async_yo: bool,
5423    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
5424/// transaction result using the Transaction Status API.
5425    #[serde(rename = "queue")]
5426    pub queue: bool,
5427    /// Whether or not the request should block until all cards have been removed from the card
5428/// reader.
5429    #[serde(rename = "waitForRemovedCard", default)]
5430    pub wait_for_removed_card: bool,
5431    /// Override any in-progress transactions.
5432    #[serde(rename = "force", default)]
5433    pub force: bool,
5434    /// An identifier from an external point of sale system.
5435    #[serde(rename = "orderRef", default)]
5436    pub order_ref: String,
5437    /// The settlement account for merchants with split settlements.
5438    #[serde(rename = "destinationAccount", default)]
5439    pub destination_account: String,
5440    /// Can include a code used to trigger simulated conditions for the purposes of testing and
5441/// certification. Valid for test merchant accounts only.
5442    #[serde(rename = "testCase", default)]
5443    pub test_case: String,
5444    /// The name of the target payment terminal.
5445    #[serde(rename = "terminalName", default)]
5446    pub terminal_name: String,
5447    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
5448/// This is a diagnostic settings that can be used only for test transactions.
5449    #[serde(rename = "resetConnection")]
5450    pub reset_connection: bool,
5451    /// A transaction reference string of the transaction to delete. Passing `*` will clear
5452/// all queued transactions.
5453    #[serde(rename = "transactionRef")]
5454    pub transaction_ref: String,
5455
5456}
5457
5458/// The response to a delete queued transaction request.
5459#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5460pub struct DeleteQueuedTransactionResponse {
5461    /// Whether or not the request succeeded.
5462    #[serde(rename = "success")]
5463    pub success: bool,
5464    /// The error, if an error occurred.
5465    #[serde(rename = "error")]
5466    pub error: String,
5467    /// A narrative description of the transaction result.
5468    #[serde(rename = "responseDescription")]
5469    pub response_description: String,
5470
5471}
5472
5473/// Deletes a customer record.
5474#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5475pub struct DeleteCustomerRequest {
5476    /// The request timeout in seconds.
5477    #[serde(rename = "timeout")]
5478    pub timeout: i32,
5479    /// Whether or not to route transaction to the test gateway.
5480    #[serde(rename = "test")]
5481    pub test: bool,
5482    /// A user-assigned reference that can be used to recall or reverse transactions.
5483    #[serde(rename = "transactionRef", default)]
5484    pub transaction_ref: String,
5485    /// That the transaction reference was autogenerated and should be ignored for the
5486/// purposes of duplicate detection.
5487    #[serde(rename = "autogeneratedRef")]
5488    pub autogenerated_ref: bool,
5489    /// Defers the response to the transaction and returns immediately. Callers should
5490/// retrive the transaction result using the Transaction Status API.
5491    #[serde(rename = "async")]
5492    pub async_yo: bool,
5493    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
5494/// transaction result using the Transaction Status API.
5495    #[serde(rename = "queue")]
5496    pub queue: bool,
5497    /// Whether or not the request should block until all cards have been removed from the card
5498/// reader.
5499    #[serde(rename = "waitForRemovedCard", default)]
5500    pub wait_for_removed_card: bool,
5501    /// Override any in-progress transactions.
5502    #[serde(rename = "force", default)]
5503    pub force: bool,
5504    /// An identifier from an external point of sale system.
5505    #[serde(rename = "orderRef", default)]
5506    pub order_ref: String,
5507    /// The settlement account for merchants with split settlements.
5508    #[serde(rename = "destinationAccount", default)]
5509    pub destination_account: String,
5510    /// Can include a code used to trigger simulated conditions for the purposes of testing and
5511/// certification. Valid for test merchant accounts only.
5512    #[serde(rename = "testCase", default)]
5513    pub test_case: String,
5514    /// The ID of the customer to delete.
5515    #[serde(rename = "customerId")]
5516    pub customer_id: String,
5517
5518}
5519
5520/// The response to a delete customer request.
5521#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5522pub struct DeleteCustomerResponse {
5523    /// Whether or not the request succeeded.
5524    #[serde(rename = "success")]
5525    pub success: bool,
5526    /// The error, if an error occurred.
5527    #[serde(rename = "error")]
5528    pub error: String,
5529    /// A narrative description of the transaction result.
5530    #[serde(rename = "responseDescription")]
5531    pub response_description: String,
5532
5533}
5534
5535/// Deletes a payment token.
5536#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5537pub struct DeleteTokenRequest {
5538    /// The request timeout in seconds.
5539    #[serde(rename = "timeout")]
5540    pub timeout: i32,
5541    /// Whether or not to route transaction to the test gateway.
5542    #[serde(rename = "test")]
5543    pub test: bool,
5544    /// A user-assigned reference that can be used to recall or reverse transactions.
5545    #[serde(rename = "transactionRef", default)]
5546    pub transaction_ref: String,
5547    /// That the transaction reference was autogenerated and should be ignored for the
5548/// purposes of duplicate detection.
5549    #[serde(rename = "autogeneratedRef")]
5550    pub autogenerated_ref: bool,
5551    /// Defers the response to the transaction and returns immediately. Callers should
5552/// retrive the transaction result using the Transaction Status API.
5553    #[serde(rename = "async")]
5554    pub async_yo: bool,
5555    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
5556/// transaction result using the Transaction Status API.
5557    #[serde(rename = "queue")]
5558    pub queue: bool,
5559    /// Whether or not the request should block until all cards have been removed from the card
5560/// reader.
5561    #[serde(rename = "waitForRemovedCard", default)]
5562    pub wait_for_removed_card: bool,
5563    /// Override any in-progress transactions.
5564    #[serde(rename = "force", default)]
5565    pub force: bool,
5566    /// An identifier from an external point of sale system.
5567    #[serde(rename = "orderRef", default)]
5568    pub order_ref: String,
5569    /// The settlement account for merchants with split settlements.
5570    #[serde(rename = "destinationAccount", default)]
5571    pub destination_account: String,
5572    /// Can include a code used to trigger simulated conditions for the purposes of testing and
5573/// certification. Valid for test merchant accounts only.
5574    #[serde(rename = "testCase", default)]
5575    pub test_case: String,
5576    /// The token to delete.
5577    #[serde(rename = "token")]
5578    pub token: String,
5579
5580}
5581
5582/// The response to a delete token request.
5583#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5584pub struct DeleteTokenResponse {
5585    /// Whether or not the request succeeded.
5586    #[serde(rename = "success")]
5587    pub success: bool,
5588    /// The error, if an error occurred.
5589    #[serde(rename = "error")]
5590    pub error: String,
5591    /// A narrative description of the transaction result.
5592    #[serde(rename = "responseDescription")]
5593    pub response_description: String,
5594
5595}
5596
5597/// Links a payment token with a customer record.
5598#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5599pub struct LinkTokenRequest {
5600    /// The request timeout in seconds.
5601    #[serde(rename = "timeout")]
5602    pub timeout: i32,
5603    /// Whether or not to route transaction to the test gateway.
5604    #[serde(rename = "test")]
5605    pub test: bool,
5606    /// A user-assigned reference that can be used to recall or reverse transactions.
5607    #[serde(rename = "transactionRef", default)]
5608    pub transaction_ref: String,
5609    /// That the transaction reference was autogenerated and should be ignored for the
5610/// purposes of duplicate detection.
5611    #[serde(rename = "autogeneratedRef")]
5612    pub autogenerated_ref: bool,
5613    /// Defers the response to the transaction and returns immediately. Callers should
5614/// retrive the transaction result using the Transaction Status API.
5615    #[serde(rename = "async")]
5616    pub async_yo: bool,
5617    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
5618/// transaction result using the Transaction Status API.
5619    #[serde(rename = "queue")]
5620    pub queue: bool,
5621    /// Whether or not the request should block until all cards have been removed from the card
5622/// reader.
5623    #[serde(rename = "waitForRemovedCard", default)]
5624    pub wait_for_removed_card: bool,
5625    /// Override any in-progress transactions.
5626    #[serde(rename = "force", default)]
5627    pub force: bool,
5628    /// An identifier from an external point of sale system.
5629    #[serde(rename = "orderRef", default)]
5630    pub order_ref: String,
5631    /// The settlement account for merchants with split settlements.
5632    #[serde(rename = "destinationAccount", default)]
5633    pub destination_account: String,
5634    /// Can include a code used to trigger simulated conditions for the purposes of testing and
5635/// certification. Valid for test merchant accounts only.
5636    #[serde(rename = "testCase", default)]
5637    pub test_case: String,
5638    /// The token to delete.
5639    #[serde(rename = "token")]
5640    pub token: String,
5641    /// BlockChyp assigned customer id.
5642    #[serde(rename = "customerId")]
5643    pub customer_id: String,
5644
5645}
5646
5647/// Removes a link between a payment token with a customer record, if one exists.
5648#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5649pub struct UnlinkTokenRequest {
5650    /// The request timeout in seconds.
5651    #[serde(rename = "timeout")]
5652    pub timeout: i32,
5653    /// Whether or not to route transaction to the test gateway.
5654    #[serde(rename = "test")]
5655    pub test: bool,
5656    /// A user-assigned reference that can be used to recall or reverse transactions.
5657    #[serde(rename = "transactionRef", default)]
5658    pub transaction_ref: String,
5659    /// That the transaction reference was autogenerated and should be ignored for the
5660/// purposes of duplicate detection.
5661    #[serde(rename = "autogeneratedRef")]
5662    pub autogenerated_ref: bool,
5663    /// Defers the response to the transaction and returns immediately. Callers should
5664/// retrive the transaction result using the Transaction Status API.
5665    #[serde(rename = "async")]
5666    pub async_yo: bool,
5667    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
5668/// transaction result using the Transaction Status API.
5669    #[serde(rename = "queue")]
5670    pub queue: bool,
5671    /// Whether or not the request should block until all cards have been removed from the card
5672/// reader.
5673    #[serde(rename = "waitForRemovedCard", default)]
5674    pub wait_for_removed_card: bool,
5675    /// Override any in-progress transactions.
5676    #[serde(rename = "force", default)]
5677    pub force: bool,
5678    /// An identifier from an external point of sale system.
5679    #[serde(rename = "orderRef", default)]
5680    pub order_ref: String,
5681    /// The settlement account for merchants with split settlements.
5682    #[serde(rename = "destinationAccount", default)]
5683    pub destination_account: String,
5684    /// Can include a code used to trigger simulated conditions for the purposes of testing and
5685/// certification. Valid for test merchant accounts only.
5686    #[serde(rename = "testCase", default)]
5687    pub test_case: String,
5688    /// The token to delete.
5689    #[serde(rename = "token")]
5690    pub token: String,
5691    /// BlockChyp assigned customer id.
5692    #[serde(rename = "customerId")]
5693    pub customer_id: String,
5694
5695}
5696
5697/// Fields for HSA/FSA transactions.
5698#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5699pub struct HealthcareMetadata {
5700    /// A list of healthcare categories in the transaction.
5701    #[serde(rename = "types")]
5702    pub types: Option<Vec<HealthcareGroup>>,
5703    /// That the purchased items were verified against an Inventory Information Approval
5704/// System (IIAS).
5705    #[serde(rename = "iiasVerified")]
5706    pub iias_verified: bool,
5707    /// That the transaction is exempt from IIAS verification.
5708    #[serde(rename = "iiasExempt")]
5709    pub iias_exempt: bool,
5710
5711}
5712
5713/// A group of fields for a specific type of healthcare.
5714#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5715pub struct HealthcareGroup {
5716    /// The type of healthcare cost.
5717    #[serde(rename = "type")]
5718    pub type_yo: HealthcareType,
5719    /// The amount of this type.
5720    #[serde(rename = "amount")]
5721    pub amount: String,
5722    /// The provider ID used for Mastercard and Discover IIAS requests.
5723    #[serde(rename = "providerId")]
5724    pub provider_id: String,
5725    /// The service type code used for Mastercard and Discover IIAS requests.
5726    #[serde(rename = "serviceTypeCode")]
5727    pub service_type_code: String,
5728    /// Thr payer ID/carrier ID used for Mastercard and Discover IIAS requests.
5729    #[serde(rename = "payerOrCarrierId")]
5730    pub payer_or_carrier_id: String,
5731    /// The approval or reject reason code used for Mastercard and Discover IIAS requests.
5732    #[serde(rename = "approvalRejectReasonCode")]
5733    pub approval_reject_reason_code: String,
5734
5735}
5736
5737/// Models a request for merchant information.
5738#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5739pub struct GetMerchantsRequest {
5740    /// The request timeout in seconds.
5741    #[serde(rename = "timeout")]
5742    pub timeout: i32,
5743    /// Whether or not to return test or live merchants.
5744    #[serde(rename = "test")]
5745    pub test: bool,
5746    /// Max to be returned in a single page. Defaults to the system max of 250.
5747    #[serde(rename = "maxResults")]
5748    pub max_results: i32,
5749    /// Starting index for paged results. Defaults to zero.
5750    #[serde(rename = "startIndex")]
5751    pub start_index: i32,
5752
5753}
5754
5755/// The results for a merchant list request.
5756#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5757pub struct GetMerchantsResponse {
5758    /// Whether or not the request succeeded.
5759    #[serde(rename = "success")]
5760    pub success: bool,
5761    /// The error, if an error occurred.
5762    #[serde(rename = "error")]
5763    pub error: String,
5764    /// A narrative description of the transaction result.
5765    #[serde(rename = "responseDescription")]
5766    pub response_description: String,
5767    /// Whether or not these results are for test or live merchants.
5768    #[serde(rename = "test")]
5769    pub test: bool,
5770    /// Max to be returned in a single page. Defaults to the system max of 250.
5771    #[serde(rename = "maxResults")]
5772    pub max_results: i32,
5773    /// Starting index for paged results. Defaults to zero.
5774    #[serde(rename = "startIndex")]
5775    pub start_index: i32,
5776    /// Total number of results accessible through paging.
5777    #[serde(rename = "resultCount")]
5778    pub result_count: i32,
5779    /// Merchants in the current page of results.
5780    #[serde(rename = "merchants")]
5781    pub merchants: Option<Vec<MerchantProfileResponse>>,
5782
5783}
5784
5785/// The results for a merchant users list.
5786#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5787pub struct MerchantUsersResponse {
5788    /// Whether or not the request succeeded.
5789    #[serde(rename = "success")]
5790    pub success: bool,
5791    /// The error, if an error occurred.
5792    #[serde(rename = "error")]
5793    pub error: String,
5794    /// A narrative description of the transaction result.
5795    #[serde(rename = "responseDescription")]
5796    pub response_description: String,
5797    /// Whether or not these results are for test or live merchants.
5798    #[serde(rename = "test")]
5799    pub test: bool,
5800    /// Users and pending invites associated with the merchant.
5801    #[serde(rename = "results")]
5802    pub results: Option<Vec<MerchantUser>>,
5803
5804}
5805
5806/// Details about a merchant user.
5807#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5808pub struct MerchantUser {
5809    /// Whether or not these results are for test or live merchants.
5810    #[serde(rename = "test")]
5811    pub test: bool,
5812    /// The user's primary key.
5813    #[serde(rename = "id")]
5814    pub id: String,
5815    /// The user's first name.
5816    #[serde(rename = "firstName")]
5817    pub first_name: String,
5818    /// The user's last name.
5819    #[serde(rename = "lastName")]
5820    pub last_name: String,
5821    /// The user's email address.
5822    #[serde(rename = "email")]
5823    pub email: String,
5824    /// The user account status.
5825    #[serde(rename = "status")]
5826    pub status: String,
5827    /// The type of user account.
5828    #[serde(rename = "type")]
5829    pub type_yo: String,
5830    /// The role codes assigned to this user.
5831    #[serde(rename = "roles")]
5832    pub roles: Option<Vec<String>>,
5833    /// Whether or not this user account is locked.
5834    #[serde(rename = "locked")]
5835    pub locked: bool,
5836
5837}
5838
5839/// The results for a merchant platforms inquiry.
5840#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5841pub struct MerchantPlatformsResponse {
5842    /// Whether or not the request succeeded.
5843    #[serde(rename = "success")]
5844    pub success: bool,
5845    /// The error, if an error occurred.
5846    #[serde(rename = "error")]
5847    pub error: String,
5848    /// A narrative description of the transaction result.
5849    #[serde(rename = "responseDescription")]
5850    pub response_description: String,
5851    /// Whether or not these results are for test or live merchants.
5852    #[serde(rename = "test")]
5853    pub test: bool,
5854    /// Enumerates merchant platform settings.
5855    #[serde(rename = "results")]
5856    pub results: Option<Vec<MerchantPlatform>>,
5857
5858}
5859
5860/// Used to up platform configuration for gateway merchants.
5861#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5862pub struct UpdateMerchantPlatformRequest {
5863    /// The request timeout in seconds.
5864    #[serde(rename = "timeout")]
5865    pub timeout: i32,
5866    /// Whether or not to route transaction to the test gateway.
5867    #[serde(rename = "test")]
5868    pub test: bool,
5869    /// The merchant platform configuration.
5870    #[serde(rename = "platform")]
5871    pub platform: MerchantPlatform,
5872
5873}
5874
5875/// Echoes back the state of the current platform configuration after a change.
5876#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5877pub struct UpdateMerchantPlatformResponse {
5878    /// Whether or not the request succeeded.
5879    #[serde(rename = "success")]
5880    pub success: bool,
5881    /// The error, if an error occurred.
5882    #[serde(rename = "error")]
5883    pub error: String,
5884    /// A narrative description of the transaction result.
5885    #[serde(rename = "responseDescription")]
5886    pub response_description: String,
5887    /// The current platform configuration.
5888    #[serde(rename = "platform")]
5889    pub platform: MerchantPlatform,
5890
5891}
5892
5893/// Details about a merchant board platform configuration.
5894#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5895pub struct MerchantPlatform {
5896    /// The request timeout in seconds.
5897    #[serde(rename = "timeout")]
5898    pub timeout: i32,
5899    /// Whether or not to route transaction to the test gateway.
5900    #[serde(rename = "test")]
5901    pub test: bool,
5902    /// Primary identifier for a given platform configuration.
5903    #[serde(rename = "id")]
5904    pub id: String,
5905    /// That a platform configuration is disabled.
5906    #[serde(rename = "disabled")]
5907    pub disabled: bool,
5908    /// BlockChyp's code for the boarding platform.
5909    #[serde(rename = "platformCode")]
5910    pub platform_code: String,
5911    /// The platform's priority in a multi platform setup.
5912    #[serde(rename = "priority")]
5913    pub priority: i32,
5914    /// An optional field specifying the merchant's card brand registration record.
5915    #[serde(rename = "registrationId")]
5916    pub registration_id: String,
5917    /// The merchant's primary identifier.
5918    #[serde(rename = "merchantId")]
5919    pub merchant_id: String,
5920    /// The merchant id assigned by the acquiring bank.
5921    #[serde(rename = "acquirerMid")]
5922    pub acquirer_mid: String,
5923    /// Free form notes description the purpose or intent behind the platform configuration.
5924    #[serde(rename = "notes")]
5925    pub notes: String,
5926    /// The optional entry method code if a platform should only be used for specific entry
5927/// methods. Leave blank for 'all'.
5928    #[serde(rename = "entryMethod")]
5929    pub entry_method: String,
5930    /// The date the platform configuration was first created.
5931    #[serde(rename = "dateCreated")]
5932    pub date_created: String,
5933    /// The date the platform configuration was last modified.
5934    #[serde(rename = "lastChange")]
5935    pub last_change: String,
5936    /// A map of configuration values specific to the boarding platform. These are not
5937/// published. Contact your BlockChyp rep for supported values.
5938    #[serde(rename = "configMap", default)]
5939    pub config_map: HashMap<String, String>,
5940
5941}
5942
5943/// Models a terminal profile request.
5944#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5945pub struct TerminalProfileRequest {
5946    /// The request timeout in seconds.
5947    #[serde(rename = "timeout")]
5948    pub timeout: i32,
5949    /// Whether or not to route transaction to the test gateway.
5950    #[serde(rename = "test")]
5951    pub test: bool,
5952
5953}
5954
5955/// Models a terminal profile response.
5956#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5957pub struct TerminalProfileResponse {
5958    /// Whether or not the request succeeded.
5959    #[serde(rename = "success")]
5960    pub success: bool,
5961    /// The error, if an error occurred.
5962    #[serde(rename = "error")]
5963    pub error: String,
5964    /// A narrative description of the transaction result.
5965    #[serde(rename = "responseDescription")]
5966    pub response_description: String,
5967    /// Enumerates all terminal profiles in the response.
5968    #[serde(rename = "results")]
5969    pub results: Option<Vec<TerminalProfile>>,
5970
5971}
5972
5973/// Models a terminal deactivation request.
5974#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5975pub struct TerminalDeactivationRequest {
5976    /// The request timeout in seconds.
5977    #[serde(rename = "timeout")]
5978    pub timeout: i32,
5979    /// Whether or not to route transaction to the test gateway.
5980    #[serde(rename = "test")]
5981    pub test: bool,
5982    /// The terminal name assigned to the terminal.
5983    #[serde(rename = "terminalName")]
5984    pub terminal_name: String,
5985    /// The id assigned by BlockChyp to the terminal.
5986    #[serde(rename = "terminalId")]
5987    pub terminal_id: String,
5988
5989}
5990
5991/// Models a terminal activation request.
5992#[derive(Debug, Default, Clone, Serialize, Deserialize)]
5993pub struct TerminalActivationRequest {
5994    /// The request timeout in seconds.
5995    #[serde(rename = "timeout")]
5996    pub timeout: i32,
5997    /// Whether or not to route transaction to the test gateway.
5998    #[serde(rename = "test")]
5999    pub test: bool,
6000    /// The optional merchant id.
6001    #[serde(rename = "merchantId")]
6002    pub merchant_id: String,
6003    /// The terminal activation code displayed on the terminal.
6004    #[serde(rename = "activationCode")]
6005    pub activation_code: String,
6006    /// The name to be assigned to the terminal. Must be unique for the merchant account.
6007    #[serde(rename = "terminalName")]
6008    pub terminal_name: String,
6009    /// That the terminal should be activated in cloud relay mode.
6010    #[serde(rename = "cloudRelay")]
6011    pub cloud_relay: bool,
6012
6013}
6014
6015/// Details about a merchant board platform configuration.
6016#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6017pub struct TerminalProfile {
6018    /// Primary identifier for a given terminal.
6019    #[serde(rename = "id")]
6020    pub id: String,
6021    /// The terminal's local IP address.
6022    #[serde(rename = "ipAddress")]
6023    pub ip_address: String,
6024    /// The name assigned to the terminal during activation.
6025    #[serde(rename = "terminalName")]
6026    pub terminal_name: String,
6027    /// The terminal type.
6028    #[serde(rename = "terminalType")]
6029    pub terminal_type: String,
6030    /// The terminal type display string.
6031    #[serde(rename = "terminalTypeDisplayString")]
6032    pub terminal_type_display_string: String,
6033    /// The current firmware version deployed on the terminal.
6034    #[serde(rename = "blockChypFirmwareVersion")]
6035    pub block_chyp_firmware_version: String,
6036    /// Whether or not the terminal is configured for cloud relay.
6037    #[serde(rename = "cloudBased")]
6038    pub cloud_based: bool,
6039    /// The terminal's elliptic curve public key.
6040    #[serde(rename = "publicKey")]
6041    pub public_key: String,
6042    /// The manufacturer's serial number.
6043    #[serde(rename = "serialNumber")]
6044    pub serial_number: String,
6045    /// Whether or not the terminal is currently online.
6046    #[serde(rename = "online")]
6047    pub online: bool,
6048    /// The date and time the terminal was first brought online.
6049    #[serde(rename = "since")]
6050    pub since: String,
6051    /// The total memory on the terminal.
6052    #[serde(rename = "totalMemory")]
6053    pub total_memory: i32,
6054    /// The storage on the terminal.
6055    #[serde(rename = "totalStorage")]
6056    pub total_storage: i32,
6057    /// The available (unused) memory on the terminal.
6058    #[serde(rename = "availableMemory")]
6059    pub available_memory: i32,
6060    /// The available (unused) storage on the terminal.
6061    #[serde(rename = "availableStorage")]
6062    pub available_storage: i32,
6063    /// The memory currently in use on the terminal.
6064    #[serde(rename = "usedMemory")]
6065    pub used_memory: i32,
6066    /// The storage currently in use on the terminal.
6067    #[serde(rename = "usedStorage")]
6068    pub used_storage: i32,
6069    /// The branding asset currently displayed on the terminal.
6070    #[serde(rename = "brandingPreview")]
6071    pub branding_preview: String,
6072    /// The id of the terminal group to which the terminal belongs, if any.
6073    #[serde(rename = "groupId")]
6074    pub group_id: String,
6075    /// The name of the terminal group to which the terminal belongs, if any.
6076    #[serde(rename = "groupName")]
6077    pub group_name: String,
6078
6079}
6080
6081/// Models a full terms and conditions template.
6082#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6083pub struct TermsAndConditionsTemplate {
6084    /// The request timeout in seconds.
6085    #[serde(rename = "timeout")]
6086    pub timeout: i32,
6087    /// Whether or not to route transaction to the test gateway.
6088    #[serde(rename = "test")]
6089    pub test: bool,
6090    /// Whether or not the request succeeded.
6091    #[serde(rename = "success")]
6092    pub success: bool,
6093    /// The error, if an error occurred.
6094    #[serde(rename = "error")]
6095    pub error: String,
6096    /// A narrative description of the transaction result.
6097    #[serde(rename = "responseDescription")]
6098    pub response_description: String,
6099    /// Primary identifier for a given template.
6100    #[serde(rename = "id")]
6101    pub id: String,
6102    /// An alias or code used to refer to a template.
6103    #[serde(rename = "alias")]
6104    pub alias: String,
6105    /// The name of the template. Displayed as the agreement title on the terminal.
6106    #[serde(rename = "name")]
6107    pub name: String,
6108    /// The full text of the agreement template.
6109    #[serde(rename = "content")]
6110    pub content: String,
6111
6112}
6113
6114/// Models a request to retrieve or manipulate terms and conditions data.
6115#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6116pub struct TermsAndConditionsTemplateRequest {
6117    /// The request timeout in seconds.
6118    #[serde(rename = "timeout")]
6119    pub timeout: i32,
6120    /// Whether or not to route transaction to the test gateway.
6121    #[serde(rename = "test")]
6122    pub test: bool,
6123    /// Id of a single template.
6124    #[serde(rename = "templateId")]
6125    pub template_id: String,
6126
6127}
6128
6129/// Models a set of templates responsive to a request.
6130#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6131pub struct TermsAndConditionsTemplateResponse {
6132    /// Whether or not the request succeeded.
6133    #[serde(rename = "success")]
6134    pub success: bool,
6135    /// The error, if an error occurred.
6136    #[serde(rename = "error")]
6137    pub error: String,
6138    /// A narrative description of the transaction result.
6139    #[serde(rename = "responseDescription")]
6140    pub response_description: String,
6141    /// Results responsive to a request.
6142    #[serde(rename = "results")]
6143    pub results: Option<Vec<TermsAndConditionsTemplate>>,
6144    /// An optional timeout override.
6145    #[serde(rename = "timeout")]
6146    pub timeout: i32,
6147
6148}
6149
6150/// Models a Terms and Conditions history request.
6151#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6152pub struct TermsAndConditionsLogRequest {
6153    /// The request timeout in seconds.
6154    #[serde(rename = "timeout")]
6155    pub timeout: i32,
6156    /// Whether or not to route transaction to the test gateway.
6157    #[serde(rename = "test")]
6158    pub test: bool,
6159    /// The identifier of the log entry to be returned for single result requests.
6160    #[serde(rename = "logEntryId")]
6161    pub log_entry_id: String,
6162    /// Optional transaction id if only log entries related to a transaction should be
6163/// returned.
6164    #[serde(rename = "transactionId")]
6165    pub transaction_id: String,
6166    /// Max to be returned in a single page. Defaults to the system max of 250.
6167    #[serde(rename = "maxResults")]
6168    pub max_results: i32,
6169    /// Starting index for paged results. Defaults to zero.
6170    #[serde(rename = "startIndex")]
6171    pub start_index: i32,
6172    /// An optional start date for filtering response data.
6173    #[serde(rename = "startDate")]
6174    pub start_date: String,
6175    /// An optional end date for filtering response data.
6176    #[serde(rename = "endDate")]
6177    pub end_date: String,
6178
6179}
6180
6181/// Models a Terms and Conditions history request.
6182#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6183pub struct TermsAndConditionsLogResponse {
6184    /// Whether or not the request succeeded.
6185    #[serde(rename = "success")]
6186    pub success: bool,
6187    /// The error, if an error occurred.
6188    #[serde(rename = "error")]
6189    pub error: String,
6190    /// A narrative description of the transaction result.
6191    #[serde(rename = "responseDescription")]
6192    pub response_description: String,
6193    /// Optional transaction id if only log entries related to a transaction should be
6194/// returned.
6195    #[serde(rename = "transactionId")]
6196    pub transaction_id: String,
6197    /// Max to be returned in a single page. Defaults to the system max of 250.
6198    #[serde(rename = "maxResults")]
6199    pub max_results: i32,
6200    /// Starting index for paged results. Defaults to zero.
6201    #[serde(rename = "startIndex")]
6202    pub start_index: i32,
6203    /// Total number of results accessible through paging.
6204    #[serde(rename = "resultCount")]
6205    pub result_count: i32,
6206    /// The full result set responsive to the original request, subject to pagination limits.
6207    #[serde(rename = "results")]
6208    pub results: Option<Vec<TermsAndConditionsLogEntry>>,
6209
6210}
6211
6212/// Models a Terms and Conditions log entry.
6213#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6214pub struct TermsAndConditionsLogEntry {
6215    /// Whether or not the request succeeded.
6216    #[serde(rename = "success")]
6217    pub success: bool,
6218    /// The error, if an error occurred.
6219    #[serde(rename = "error")]
6220    pub error: String,
6221    /// A narrative description of the transaction result.
6222    #[serde(rename = "responseDescription")]
6223    pub response_description: String,
6224    /// Internal id for a Terms and Conditions entry.
6225    #[serde(rename = "id")]
6226    pub id: String,
6227    /// Id of the terminal that captured this terms and conditions entry.
6228    #[serde(rename = "terminalId")]
6229    pub terminal_id: String,
6230    /// Name of the terminal that captured this terms and conditions entry.
6231    #[serde(rename = "terminalName")]
6232    pub terminal_name: String,
6233    /// A flag indicating whether or not the terminal was a test terminal.
6234    #[serde(rename = "test")]
6235    pub test: bool,
6236    /// Date and time the terms and conditions acceptance occurred.
6237    #[serde(rename = "timestamp")]
6238    pub timestamp: String,
6239    /// Optional transaction ref if the terms and conditions was associated with a
6240/// transaction.
6241    #[serde(rename = "transactionRef")]
6242    pub transaction_ref: String,
6243    /// Optional transaction id if only log entries related to a transaction should be
6244/// returned.
6245    #[serde(rename = "transactionId")]
6246    pub transaction_id: String,
6247    /// Alias of the terms and conditions template used for this entry, if any.
6248    #[serde(rename = "alias")]
6249    pub alias: String,
6250    /// Title of the document displayed on the terminal at the time of capture.
6251    #[serde(rename = "name")]
6252    pub name: String,
6253    /// Full text of the document agreed to at the time of signature capture.
6254    #[serde(rename = "content")]
6255    pub content: String,
6256    /// First 32 characters of the full text. Used to support user interfaces that show
6257/// summaries.
6258    #[serde(rename = "contentLeader")]
6259    pub content_leader: String,
6260    /// A flag that indicates whether or not a signature has been captured.
6261    #[serde(rename = "hasSignature")]
6262    pub has_signature: bool,
6263    /// The image format to be used for returning signatures.
6264    #[serde(rename = "sigFormat", default)]
6265    pub sig_format: SignatureFormat,
6266    /// The base 64 encoded signature image if the format requested.
6267    #[serde(rename = "signature")]
6268    pub signature: String,
6269
6270}
6271
6272/// Models a survey question.
6273#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6274pub struct SurveyQuestion {
6275    /// The request timeout in seconds.
6276    #[serde(rename = "timeout")]
6277    pub timeout: i32,
6278    /// Whether or not to route transaction to the test gateway.
6279    #[serde(rename = "test")]
6280    pub test: bool,
6281    /// Whether or not the request succeeded.
6282    #[serde(rename = "success")]
6283    pub success: bool,
6284    /// The error, if an error occurred.
6285    #[serde(rename = "error")]
6286    pub error: String,
6287    /// A narrative description of the transaction result.
6288    #[serde(rename = "responseDescription")]
6289    pub response_description: String,
6290    /// Internal id for a survey question.
6291    #[serde(rename = "id")]
6292    pub id: String,
6293    /// Ordinal number indicating the position of the survey question in the post transaction
6294/// sequence.
6295    #[serde(rename = "ordinal")]
6296    pub ordinal: i32,
6297    /// Determines whether or not the question will be presented post transaction.
6298    #[serde(rename = "enabled")]
6299    pub enabled: bool,
6300    /// The full text of the transaction.
6301    #[serde(rename = "questionText")]
6302    pub question_text: String,
6303    /// The type of question. Valid values are 'yes_no' and 'scaled'.
6304    #[serde(rename = "questionType")]
6305    pub question_type: String,
6306    /// The total number of transactions processed during the query period if results are
6307/// requested.
6308    #[serde(rename = "transactionCount", default)]
6309    pub transaction_count: i32,
6310    /// The total number of responses during the query period if results are requested.
6311    #[serde(rename = "responseCount", default)]
6312    pub response_count: i32,
6313    /// The response rate, expressed as a ratio, if results are requested.
6314    #[serde(rename = "responseRate", default)]
6315    pub response_rate: f64,
6316    /// The set of response data points.
6317    #[serde(rename = "responses")]
6318    pub responses: Option<Vec<SurveyDataPoint>>,
6319
6320}
6321
6322/// Models a request to retrieve or manipulate survey questions.
6323#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6324pub struct SurveyQuestionRequest {
6325    /// Whether or not to route transaction to the test gateway.
6326    #[serde(rename = "test")]
6327    pub test: bool,
6328    /// Id of a single question.
6329    #[serde(rename = "questionId")]
6330    pub question_id: String,
6331    /// An optional timeout override.
6332    #[serde(rename = "timeout")]
6333    pub timeout: i32,
6334
6335}
6336
6337/// Models a survey question response.
6338#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6339pub struct SurveyQuestionResponse {
6340    /// Whether or not the request succeeded.
6341    #[serde(rename = "success")]
6342    pub success: bool,
6343    /// The error, if an error occurred.
6344    #[serde(rename = "error")]
6345    pub error: String,
6346    /// A narrative description of the transaction result.
6347    #[serde(rename = "responseDescription")]
6348    pub response_description: String,
6349    /// The full result set responsive to the original request.
6350    #[serde(rename = "results")]
6351    pub results: Option<Vec<SurveyQuestion>>,
6352
6353}
6354
6355/// Models a request to retrieve or manipulate survey questions.
6356#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6357pub struct SurveyDataPoint {
6358    /// A unique identifier for a specific answer type.
6359    #[serde(rename = "answerKey")]
6360    pub answer_key: String,
6361    /// A narrative description of the answer.
6362    #[serde(rename = "answerDescription")]
6363    pub answer_description: String,
6364    /// The number of responses.
6365    #[serde(rename = "responseCount")]
6366    pub response_count: i32,
6367    /// Response rate as a percentage of total transactions.
6368    #[serde(rename = "responsePercentage")]
6369    pub response_percentage: f64,
6370    /// The average transaction amount for a given answer.
6371    #[serde(rename = "averageTransaction")]
6372    pub average_transaction: f64,
6373
6374}
6375
6376/// Models a request to retrieve survey results.
6377#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6378pub struct SurveyResultsRequest {
6379    /// The request timeout in seconds.
6380    #[serde(rename = "timeout")]
6381    pub timeout: i32,
6382    /// Whether or not to route transaction to the test gateway.
6383    #[serde(rename = "test")]
6384    pub test: bool,
6385    /// Id of a single question.
6386    #[serde(rename = "questionId")]
6387    pub question_id: String,
6388    /// An optional start date for filtering response data.
6389    #[serde(rename = "startDate")]
6390    pub start_date: String,
6391    /// An optional end date for filtering response data.
6392    #[serde(rename = "endDate")]
6393    pub end_date: String,
6394
6395}
6396
6397/// Models a request to retrieve survey results.
6398#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6399pub struct MediaMetadata {
6400    /// Whether or not the request succeeded.
6401    #[serde(rename = "success")]
6402    pub success: bool,
6403    /// The error, if an error occurred.
6404    #[serde(rename = "error")]
6405    pub error: String,
6406    /// A narrative description of the transaction result.
6407    #[serde(rename = "responseDescription")]
6408    pub response_description: String,
6409    /// Id used to identify the media asset.
6410    #[serde(rename = "id")]
6411    pub id: String,
6412    /// The original filename assigned to the media asset.
6413    #[serde(rename = "originalFile")]
6414    pub original_file: String,
6415    /// The descriptive name of the media asset.
6416    #[serde(rename = "name")]
6417    pub name: String,
6418    /// A description of the media asset and its purpose.
6419    #[serde(rename = "description")]
6420    pub description: String,
6421    /// An array of tags associated with a media asset.
6422    #[serde(rename = "tags")]
6423    pub tags: Option<Vec<String>>,
6424    /// The url for the full resolution versio of the media file.
6425    #[serde(rename = "fileUrl")]
6426    pub file_url: String,
6427    /// The url for to the thumbnail of an image.
6428    #[serde(rename = "thumbnailUrl")]
6429    pub thumbnail_url: String,
6430    /// An identifier used to flag video files.
6431    #[serde(rename = "video")]
6432    pub video: bool,
6433
6434}
6435
6436/// Models information needed to process a file upload.
6437#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6438pub struct UploadMetadata {
6439    /// The request timeout in seconds.
6440    #[serde(rename = "timeout")]
6441    pub timeout: i32,
6442    /// Whether or not to route transaction to the test gateway.
6443    #[serde(rename = "test")]
6444    pub test: bool,
6445    /// Optional id used to track status and progress of an upload while in progress.
6446    #[serde(rename = "uploadId")]
6447    pub upload_id: String,
6448    /// The size of the file to be uploaded in bytes.
6449    #[serde(rename = "fileSize")]
6450    pub file_size: i64,
6451    /// The name of file to be uploaded.
6452    #[serde(rename = "fileName")]
6453    pub file_name: String,
6454
6455}
6456
6457/// Models the current status of a file upload.
6458#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6459pub struct UploadStatus {
6460    /// Whether or not the request succeeded.
6461    #[serde(rename = "success")]
6462    pub success: bool,
6463    /// The error, if an error occurred.
6464    #[serde(rename = "error")]
6465    pub error: String,
6466    /// A narrative description of the transaction result.
6467    #[serde(rename = "responseDescription")]
6468    pub response_description: String,
6469    /// Id used to track status and progress of an upload while in progress.
6470    #[serde(rename = "id")]
6471    pub id: String,
6472    /// The media id assigned to the result.
6473    #[serde(rename = "mediaId")]
6474    pub media_id: String,
6475    /// The size of the file to be uploaded in bytes.
6476    #[serde(rename = "fileSize")]
6477    pub file_size: i64,
6478    /// The amount of the file already uploaded.
6479    #[serde(rename = "uploadedAmount")]
6480    pub uploaded_amount: i64,
6481    /// The current status of a file upload.
6482    #[serde(rename = "status")]
6483    pub status: String,
6484    /// Whether or not the upload and associated file processing is complete.
6485    #[serde(rename = "complete")]
6486    pub complete: bool,
6487    /// Whether or not the file is processing. This normally applied to video files undergoing
6488/// format transcoding.
6489    #[serde(rename = "processing")]
6490    pub processing: bool,
6491    /// Current upload progress rounded to the nearest integer.
6492    #[serde(rename = "percentage")]
6493    pub percentage: i32,
6494    /// The url of a thumbnail for the file, if available.
6495    #[serde(rename = "thumbnailLocation")]
6496    pub thumbnail_location: String,
6497
6498}
6499
6500/// Used to request the status of a file upload.
6501#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6502pub struct UploadStatusRequest {
6503    /// The request timeout in seconds.
6504    #[serde(rename = "timeout")]
6505    pub timeout: i32,
6506    /// Whether or not to route transaction to the test gateway.
6507    #[serde(rename = "test")]
6508    pub test: bool,
6509    /// Id used to track status and progress of an upload while in progress.
6510    #[serde(rename = "uploadId")]
6511    pub upload_id: String,
6512
6513}
6514
6515/// Models a request to retrieve or manipulate media assets.
6516#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6517pub struct MediaRequest {
6518    /// The request timeout in seconds.
6519    #[serde(rename = "timeout")]
6520    pub timeout: i32,
6521    /// Whether or not to route transaction to the test gateway.
6522    #[serde(rename = "test")]
6523    pub test: bool,
6524    /// Id used to track a media asset.
6525    #[serde(rename = "mediaId")]
6526    pub media_id: String,
6527
6528}
6529
6530/// Models a media library response.
6531#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6532pub struct MediaLibraryResponse {
6533    /// Whether or not the request succeeded.
6534    #[serde(rename = "success")]
6535    pub success: bool,
6536    /// The error, if an error occurred.
6537    #[serde(rename = "error")]
6538    pub error: String,
6539    /// A narrative description of the transaction result.
6540    #[serde(rename = "responseDescription")]
6541    pub response_description: String,
6542    /// Max to be returned in a single page. Defaults to the system max of 250.
6543    #[serde(rename = "maxResults")]
6544    pub max_results: i32,
6545    /// Starting index for paged results. Defaults to zero.
6546    #[serde(rename = "startIndex")]
6547    pub start_index: i32,
6548    /// Total number of results accessible through paging.
6549    #[serde(rename = "resultCount")]
6550    pub result_count: i32,
6551    /// Total number of pages.
6552    #[serde(rename = "pages")]
6553    pub pages: i32,
6554    /// Page currently selected through paging.
6555    #[serde(rename = "currentPage")]
6556    pub current_page: i32,
6557    /// Enumerates all media assets available in the context.
6558    #[serde(rename = "results")]
6559    pub results: Option<Vec<MediaMetadata>>,
6560
6561}
6562
6563/// Models a slide within a slide show.
6564#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6565pub struct Slide {
6566    /// The id for the media asset to be used for this slide. Must be an image.
6567    #[serde(rename = "mediaId")]
6568    pub media_id: String,
6569    /// Position of the slide within the slide show.
6570    #[serde(rename = "ordinal")]
6571    pub ordinal: i32,
6572    /// The fully qualified thumbnail url for the slide.
6573    #[serde(rename = "thumbnailUrl")]
6574    pub thumbnail_url: String,
6575
6576}
6577
6578/// Models a media library response.
6579#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6580pub struct SlideShow {
6581    /// The request timeout in seconds.
6582    #[serde(rename = "timeout")]
6583    pub timeout: i32,
6584    /// Whether or not to route transaction to the test gateway.
6585    #[serde(rename = "test")]
6586    pub test: bool,
6587    /// Whether or not the request succeeded.
6588    #[serde(rename = "success")]
6589    pub success: bool,
6590    /// The error, if an error occurred.
6591    #[serde(rename = "error")]
6592    pub error: String,
6593    /// A narrative description of the transaction result.
6594    #[serde(rename = "responseDescription")]
6595    pub response_description: String,
6596    /// The primary id for the slide show.
6597    #[serde(rename = "id")]
6598    pub id: String,
6599    /// The name of the slide show.
6600    #[serde(rename = "name")]
6601    pub name: String,
6602    /// Time between slides in seconds.
6603    #[serde(rename = "delay")]
6604    pub delay: i32,
6605    /// Enumerates all slides in the display sequence.
6606    #[serde(rename = "slides")]
6607    pub slides: Option<Vec<Slide>>,
6608
6609}
6610
6611/// Models a slide show response.
6612#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6613pub struct SlideShowResponse {
6614    /// Whether or not the request succeeded.
6615    #[serde(rename = "success")]
6616    pub success: bool,
6617    /// The error, if an error occurred.
6618    #[serde(rename = "error")]
6619    pub error: String,
6620    /// A narrative description of the transaction result.
6621    #[serde(rename = "responseDescription")]
6622    pub response_description: String,
6623    /// Max to be returned in a single page. Defaults to the system max of 250.
6624    #[serde(rename = "maxResults")]
6625    pub max_results: i32,
6626    /// Starting index for paged results. Defaults to zero.
6627    #[serde(rename = "startIndex")]
6628    pub start_index: i32,
6629    /// Total number of results accessible through paging.
6630    #[serde(rename = "resultCount")]
6631    pub result_count: i32,
6632    /// Enumerates all slide shows responsive to the original query.
6633    #[serde(rename = "results")]
6634    pub results: Option<Vec<SlideShow>>,
6635
6636}
6637
6638/// Models a request to retrieve or manipulate terminal slide shows.
6639#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6640pub struct SlideShowRequest {
6641    /// The request timeout in seconds.
6642    #[serde(rename = "timeout")]
6643    pub timeout: i32,
6644    /// Whether or not to route transaction to the test gateway.
6645    #[serde(rename = "test")]
6646    pub test: bool,
6647    /// Id used to track a slide show.
6648    #[serde(rename = "slideShowId")]
6649    pub slide_show_id: String,
6650
6651}
6652
6653/// Models a request to retrieve or manipulate terminal slide shows.
6654#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6655pub struct BrandingAssetRequest {
6656    /// The request timeout in seconds.
6657    #[serde(rename = "timeout")]
6658    pub timeout: i32,
6659    /// Whether or not to route transaction to the test gateway.
6660    #[serde(rename = "test")]
6661    pub test: bool,
6662    /// Id used to track a branding asset.
6663    #[serde(rename = "assetId")]
6664    pub asset_id: String,
6665
6666}
6667
6668/// Models the priority and display settings for terminal media.
6669#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6670pub struct BrandingAsset {
6671    /// The request timeout in seconds.
6672    #[serde(rename = "timeout")]
6673    pub timeout: i32,
6674    /// Whether or not to route transaction to the test gateway.
6675    #[serde(rename = "test")]
6676    pub test: bool,
6677    /// Whether or not the request succeeded.
6678    #[serde(rename = "success")]
6679    pub success: bool,
6680    /// The error, if an error occurred.
6681    #[serde(rename = "error")]
6682    pub error: String,
6683    /// A narrative description of the transaction result.
6684    #[serde(rename = "responseDescription")]
6685    pub response_description: String,
6686    /// Id used to track a branding asset.
6687    #[serde(rename = "id")]
6688    pub id: String,
6689    /// The id owner of the tenant who owns the branding asset.
6690    #[serde(rename = "ownerId")]
6691    pub owner_id: String,
6692    /// The terminal id if this branding asset is specific to a single terminal.
6693    #[serde(rename = "terminalId")]
6694    pub terminal_id: String,
6695    /// The terminal group id if this branding asset is specific to a terminal group.
6696    #[serde(rename = "terminalGroupId")]
6697    pub terminal_group_id: String,
6698    /// The merchant id associated with this branding asset.
6699    #[serde(rename = "merchantId")]
6700    pub merchant_id: String,
6701    /// The organization id associated with this branding asset.
6702    #[serde(rename = "organizationId")]
6703    pub organization_id: String,
6704    /// The partner id associated with this branding asset.
6705    #[serde(rename = "partnerId")]
6706    pub partner_id: String,
6707    /// The slide show associated with this branding asset, if any. A branding asset can
6708/// reference a slide show or media asset, but not both.
6709    #[serde(rename = "slideShowId")]
6710    pub slide_show_id: String,
6711    /// The media id associated with this branding asset, if any. A branding asset can
6712/// reference a slide show or media asset, but not both.
6713    #[serde(rename = "mediaId")]
6714    pub media_id: String,
6715    /// Applies standard margins to images displayed on terminals. Usually the best option
6716/// for logos.
6717    #[serde(rename = "padded")]
6718    pub padded: bool,
6719    /// The start date if this asset should be displayed based on a schedule. Format:
6720/// MM/DD/YYYY.
6721    #[serde(rename = "startDate")]
6722    pub start_date: String,
6723    /// The end date if this asset should be displayed based on a schedule. Format: MM/DD/YYYY.
6724    #[serde(rename = "endDate")]
6725    pub end_date: String,
6726    /// An array of days of the week during which a branding asset should be enabled. Days of the
6727/// week are coded as integers starting with Sunday (0) and ending with Saturday (6).
6728    #[serde(rename = "daysOfWeek")]
6729    pub days_of_week: Option<Vec<i8>>,
6730    /// The start date if this asset should be displayed based on a schedule. Format:
6731/// MM/DD/YYYY.
6732    #[serde(rename = "startTime")]
6733    pub start_time: String,
6734    /// The end date if this asset should be displayed based on a schedule. Format: MM/DD/YYYY.
6735    #[serde(rename = "endTime")]
6736    pub end_time: String,
6737    /// The ordinal number marking the position of this asset within the branding stack.
6738    #[serde(rename = "ordinal")]
6739    pub ordinal: i32,
6740    /// Enables the asset for display.
6741    #[serde(rename = "enabled")]
6742    pub enabled: bool,
6743    /// If true, the asset will be displayed in the merchant portal, but not on merchant
6744/// terminal hardware. Developers will usually want this to always be false.
6745    #[serde(rename = "preview")]
6746    pub preview: bool,
6747    /// Id of the user who created this branding asset, if applicable.
6748    #[serde(rename = "userId")]
6749    pub user_id: String,
6750    /// Name of the user who created this branding asset, if applicable.
6751    #[serde(rename = "userName")]
6752    pub user_name: String,
6753    /// The fully qualified URL of the thumbnail image for this branding asset.
6754    #[serde(rename = "thumbnail")]
6755    pub thumbnail: String,
6756    /// The time and date this asset was last modified.
6757    #[serde(rename = "lastModified")]
6758    pub last_modified: String,
6759    /// A field for notes related to a branding asset.
6760    #[serde(rename = "notes")]
6761    pub notes: String,
6762    /// If true, the API credentials used to retrieve the branding asset record can be used to
6763/// update it.
6764    #[serde(rename = "editable")]
6765    pub editable: bool,
6766    /// The type of branding asset.
6767    #[serde(rename = "assetType")]
6768    pub asset_type: String,
6769    /// The type of user or tenant that owns this asset.
6770    #[serde(rename = "ownerType")]
6771    pub owner_type: String,
6772    /// A recommended caption for displaying the owner. Takes into account multiple
6773/// organization types.
6774    #[serde(rename = "ownerTypeCaption")]
6775    pub owner_type_caption: String,
6776    /// The name of the tenant or entity that owns the branding asset.
6777    #[serde(rename = "ownerName")]
6778    pub owner_name: String,
6779    /// The recommended image to be displayed when rendering a preview of this branding asset.
6780    #[serde(rename = "previewImage")]
6781    pub preview_image: String,
6782    /// A compact narrative string explaining the effective date and time rules for a branding
6783/// asset.
6784    #[serde(rename = "narrativeEffectiveDates")]
6785    pub narrative_effective_dates: String,
6786    /// A compact narrative string explaining the display period for a branding asset.
6787    #[serde(rename = "narrativeDisplayPeriod")]
6788    pub narrative_display_period: String,
6789
6790}
6791
6792/// Models a branding asset response.
6793#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6794pub struct BrandingAssetResponse {
6795    /// Whether or not the request succeeded.
6796    #[serde(rename = "success")]
6797    pub success: bool,
6798    /// The error, if an error occurred.
6799    #[serde(rename = "error")]
6800    pub error: String,
6801    /// A narrative description of the transaction result.
6802    #[serde(rename = "responseDescription")]
6803    pub response_description: String,
6804    /// The id owner of this branding stack.
6805    #[serde(rename = "ownerId")]
6806    pub owner_id: String,
6807    /// The type of user or tenant that owns this branding stack.
6808    #[serde(rename = "ownerType")]
6809    pub owner_type: String,
6810    /// The name of the entity or tenant that owns this branding stack.
6811    #[serde(rename = "ownerName")]
6812    pub owner_name: String,
6813    /// The owner level currently being displayed.
6814    #[serde(rename = "levelName")]
6815    pub level_name: String,
6816    /// A narrative description of the current simulate time.
6817    #[serde(rename = "narrativeTime")]
6818    pub narrative_time: String,
6819    /// The asset currently displayed on the terminal.
6820    #[serde(rename = "activeAsset")]
6821    pub active_asset: BrandingAsset,
6822    /// Enumerates all branding assets in a given credential scope.
6823    #[serde(rename = "results")]
6824    pub results: Option<Vec<BrandingAsset>>,
6825
6826}
6827
6828/// Models a request to retrieve pricing policy information. The default policy for the
6829/// merchant is returned if no idea is provided.
6830#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6831pub struct PricingPolicyRequest {
6832    /// The request timeout in seconds.
6833    #[serde(rename = "timeout")]
6834    pub timeout: i32,
6835    /// Whether or not to route transaction to the test gateway.
6836    #[serde(rename = "test")]
6837    pub test: bool,
6838    /// An optional id used to retrieve a specific pricing policy.
6839    #[serde(rename = "id")]
6840    pub id: String,
6841    /// An optional merchant id if this request is submitted via partner credentials.
6842    #[serde(rename = "merchantId")]
6843    pub merchant_id: String,
6844
6845}
6846
6847/// Models a single set of pricing values for a pricing policy.
6848#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6849pub struct PricePoint {
6850    /// The string representation of a per transaction minimum.
6851    #[serde(rename = "buyRate")]
6852    pub buy_rate: String,
6853    /// The string representation of the current fee per transaction.
6854    #[serde(rename = "current")]
6855    pub current: String,
6856    /// The string representation of a per transaction gouge limit.
6857    #[serde(rename = "limit")]
6858    pub limit: String,
6859
6860}
6861
6862/// Models a the response to a pricing policy request.
6863#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6864pub struct PricingPolicyResponse {
6865    /// Whether or not the request succeeded.
6866    #[serde(rename = "success")]
6867    pub success: bool,
6868    /// The error, if an error occurred.
6869    #[serde(rename = "error")]
6870    pub error: String,
6871    /// A narrative description of the transaction result.
6872    #[serde(rename = "responseDescription")]
6873    pub response_description: String,
6874    /// The id owner of the pricing policy.
6875    #[serde(rename = "id")]
6876    pub id: String,
6877    /// The id of the partner associated with this pricing policy.
6878    #[serde(rename = "partnerId")]
6879    pub partner_id: String,
6880    /// The id of the merchant associated with this pricing policy.
6881    #[serde(rename = "merchantId")]
6882    pub merchant_id: String,
6883    /// Whether or not a pricing policy is enabled.
6884    #[serde(rename = "enabled")]
6885    pub enabled: bool,
6886    /// The date and time when the pricing policy was created.
6887    #[serde(rename = "timestamp")]
6888    pub timestamp: String,
6889    /// The description of the pricing policy.
6890    #[serde(rename = "description")]
6891    pub description: String,
6892    /// Type of pricing policy (flat vs interchange).
6893    #[serde(rename = "policyType")]
6894    pub policy_type: String,
6895    /// The percentage split of the of buy rate markup with BlockChyp.
6896    #[serde(rename = "partnerMarkupSplit")]
6897    pub partner_markup_split: String,
6898    /// The flat rate percentage for standard card present transactions.
6899    #[serde(rename = "standardFlatRate")]
6900    pub standard_flat_rate: PricePoint,
6901    /// The flat rate percentage for debit card transactions.
6902    #[serde(rename = "debitFlatRate")]
6903    pub debit_flat_rate: PricePoint,
6904    /// The flat rate percentage for ecommerce transactions.
6905    #[serde(rename = "ecommerceFlatRate")]
6906    pub ecommerce_flat_rate: PricePoint,
6907    /// The flat rate percentage for keyed/manual transactions.
6908    #[serde(rename = "keyedFlatRate")]
6909    pub keyed_flat_rate: PricePoint,
6910    /// The flat rate percentage for premium (high rewards) card transactions.
6911    #[serde(rename = "premiumFlatRate")]
6912    pub premium_flat_rate: PricePoint,
6913    /// The interchange markup percentage for standard card present transactions.
6914    #[serde(rename = "standardInterchangeMarkup")]
6915    pub standard_interchange_markup: PricePoint,
6916    /// The interchange markup percentage for debit card transactions.
6917    #[serde(rename = "debitInterchangeMarkup")]
6918    pub debit_interchange_markup: PricePoint,
6919    /// The interchange markup percentage for ecommerce transactions.
6920    #[serde(rename = "ecommerceInterchangeMarkup")]
6921    pub ecommerce_interchange_markup: PricePoint,
6922    /// The interchange markup percentage for keyed/manual transactions.
6923    #[serde(rename = "keyedInterchangeMarkup")]
6924    pub keyed_interchange_markup: PricePoint,
6925    /// The interchange markup percentage for premium (high rewards) card transactions.
6926    #[serde(rename = "premiumInterchangeMarkup")]
6927    pub premium_interchange_markup: PricePoint,
6928    /// The transaction fee for standard card present transactions.
6929    #[serde(rename = "standardTransactionFee")]
6930    pub standard_transaction_fee: PricePoint,
6931    /// The transaction fee for debit card transactions.
6932    #[serde(rename = "debitTransactionFee")]
6933    pub debit_transaction_fee: PricePoint,
6934    /// The transaction fee for ecommerce transactions.
6935    #[serde(rename = "ecommerceTransactionFee")]
6936    pub ecommerce_transaction_fee: PricePoint,
6937    /// The transaction fee for keyed/manual transactions.
6938    #[serde(rename = "keyedTransactionFee")]
6939    pub keyed_transaction_fee: PricePoint,
6940    /// The transaction fee for premium (high rewards) card transactions.
6941    #[serde(rename = "premiumTransactionFee")]
6942    pub premium_transaction_fee: PricePoint,
6943    /// The transaction fee for EBT card transactions.
6944    #[serde(rename = "ebtTransactionFee")]
6945    pub ebt_transaction_fee: PricePoint,
6946    /// A flat fee charged per month.
6947    #[serde(rename = "monthlyFee")]
6948    pub monthly_fee: PricePoint,
6949    /// A flat fee charged per year.
6950    #[serde(rename = "annualFee")]
6951    pub annual_fee: PricePoint,
6952    /// The fee per dispute or chargeback.
6953    #[serde(rename = "chargebackFee")]
6954    pub chargeback_fee: PricePoint,
6955    /// The fee per address verification operation.
6956    #[serde(rename = "avsFee")]
6957    pub avs_fee: PricePoint,
6958    /// The fee per batch.
6959    #[serde(rename = "batchFee")]
6960    pub batch_fee: PricePoint,
6961    /// The voice authorization fee.
6962    #[serde(rename = "voiceAuthFee")]
6963    pub voice_auth_fee: PricePoint,
6964    /// The one time account setup fee.
6965    #[serde(rename = "accountSetupFee")]
6966    pub account_setup_fee: PricePoint,
6967
6968}
6969
6970/// Models a request to retrieve a list of partner statements.
6971#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6972pub struct PartnerStatementListRequest {
6973    /// The request timeout in seconds.
6974    #[serde(rename = "timeout")]
6975    pub timeout: i32,
6976    /// Whether or not to route transaction to the test gateway.
6977    #[serde(rename = "test")]
6978    pub test: bool,
6979    /// Optional start date filter for batch history.
6980    #[serde(rename = "startDate")]
6981    pub start_date: Option<DateTime<Utc>>,
6982    /// Optional end date filter for batch history.
6983    #[serde(rename = "endDate")]
6984    pub end_date: Option<DateTime<Utc>>,
6985
6986}
6987
6988/// Models a basic information about partner statements for use in list or search results.
6989#[derive(Debug, Default, Clone, Serialize, Deserialize)]
6990pub struct PartnerStatementSummary {
6991    /// The id owner of the pricing policy.
6992    #[serde(rename = "id")]
6993    pub id: String,
6994    /// The date the statement was generated.
6995    #[serde(rename = "statementDate")]
6996    pub statement_date: DateTime<Utc>,
6997    /// Total volume in numeric format.
6998    #[serde(rename = "totalVolume")]
6999    pub total_volume: f64,
7000    /// The string formatted total volume on the statement.
7001    #[serde(rename = "totalVolumeFormatted")]
7002    pub total_volume_formatted: String,
7003    /// The total volume on the statement.
7004    #[serde(rename = "transactionCount")]
7005    pub transaction_count: i64,
7006    /// The commission earned on the portfolio during the statement period.
7007    #[serde(rename = "partnerCommission")]
7008    pub partner_commission: f64,
7009    /// The string formatted total volume on the statement.
7010    #[serde(rename = "partnerCommissionFormatted")]
7011    pub partner_commission_formatted: String,
7012    /// The status of the statement.
7013    #[serde(rename = "status")]
7014    pub status: String,
7015
7016}
7017
7018/// Models results to a partner statement list inquiry.
7019#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7020pub struct PartnerStatementListResponse {
7021    /// Whether or not the request succeeded.
7022    #[serde(rename = "success")]
7023    pub success: bool,
7024    /// The error, if an error occurred.
7025    #[serde(rename = "error")]
7026    pub error: String,
7027    /// A narrative description of the transaction result.
7028    #[serde(rename = "responseDescription")]
7029    pub response_description: String,
7030    /// The list of statements summaries.
7031    #[serde(rename = "statements")]
7032    pub statements: Option<Vec<PartnerStatementSummary>>,
7033
7034}
7035
7036/// Models a request to retrieve detailed partner statement information.
7037#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7038pub struct PartnerStatementDetailRequest {
7039    /// The request timeout in seconds.
7040    #[serde(rename = "timeout")]
7041    pub timeout: i32,
7042    /// Whether or not to route transaction to the test gateway.
7043    #[serde(rename = "test")]
7044    pub test: bool,
7045    /// Optional start date filter for batch history.
7046    #[serde(rename = "id")]
7047    pub id: String,
7048
7049}
7050
7051/// Models a response to retrieve detailed partner statement information.
7052#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7053pub struct PartnerStatementDetailResponse {
7054    /// Whether or not the request succeeded.
7055    #[serde(rename = "success")]
7056    pub success: bool,
7057    /// The error, if an error occurred.
7058    #[serde(rename = "error")]
7059    pub error: String,
7060    /// A narrative description of the transaction result.
7061    #[serde(rename = "responseDescription")]
7062    pub response_description: String,
7063    /// Optional start date filter for batch history.
7064    #[serde(rename = "id")]
7065    pub id: String,
7066    /// The id of the partner associated with the statement.
7067    #[serde(rename = "partnerId")]
7068    pub partner_id: String,
7069    /// The name of the partner associated with the statement.
7070    #[serde(rename = "partnerName")]
7071    pub partner_name: String,
7072    /// The date the statement was generated.
7073    #[serde(rename = "statementDate")]
7074    pub statement_date: DateTime<Utc>,
7075    /// Total volume in numeric format.
7076    #[serde(rename = "totalVolume")]
7077    pub total_volume: f64,
7078    /// The string formatted total volume on the statement.
7079    #[serde(rename = "totalVolumeFormatted")]
7080    pub total_volume_formatted: String,
7081    /// The total volume on the statement.
7082    #[serde(rename = "transactionCount")]
7083    pub transaction_count: i64,
7084    /// The commission earned on the portfolio during the statement period.
7085    #[serde(rename = "partnerCommission")]
7086    pub partner_commission: f64,
7087    /// The string formatted partner commission on the statement.
7088    #[serde(rename = "partnerCommissionFormatted")]
7089    pub partner_commission_formatted: String,
7090    /// The partner commission earned on the portfolio during the statement period as a ratio
7091/// against volume.
7092    #[serde(rename = "partnerCommissionsOnVolume")]
7093    pub partner_commissions_on_volume: f64,
7094    /// The string formatted version of partner commissions as a percentage of volume.
7095    #[serde(rename = "partnerCommissionsOnVolumeFormatted")]
7096    pub partner_commissions_on_volume_formatted: String,
7097    /// The status of the statement.
7098    #[serde(rename = "status")]
7099    pub status: String,
7100    /// The line item detail associated with the statement.
7101    #[serde(rename = "lineItems")]
7102    pub line_items: Option<Vec<PartnerStatementLineItem>>,
7103    /// The list of adjustments made against the statement, if any.
7104    #[serde(rename = "adjustments")]
7105    pub adjustments: Option<Vec<PartnerStatementAdjustment>>,
7106    /// The list of partner disbursements made against the partner statement.
7107    #[serde(rename = "disbursements")]
7108    pub disbursements: Option<Vec<PartnerStatementDisbursement>>,
7109
7110}
7111
7112/// Models line item level data for a partner statement.
7113#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7114pub struct PartnerStatementLineItem {
7115    /// The line item id.
7116    #[serde(rename = "id")]
7117    pub id: String,
7118    /// The invoice id for the underlying merchant statement.
7119    #[serde(rename = "invoiceId")]
7120    pub invoice_id: String,
7121    /// The total fees charged to the merchant.
7122    #[serde(rename = "totalFees")]
7123    pub total_fees: f64,
7124    /// The total fees charge formatted as a currency string.
7125    #[serde(rename = "totalFeesFormatted")]
7126    pub total_fees_formatted: String,
7127    /// The total fees charged to the merchant as ratio of volume.
7128    #[serde(rename = "totalFeesOnVolume")]
7129    pub total_fees_on_volume: f64,
7130    /// The total fees charged to the merchant as percentage of volume.
7131    #[serde(rename = "totalFeesOnVolumeFormatted")]
7132    pub total_fees_on_volume_formatted: String,
7133    /// The id of the merchant.
7134    #[serde(rename = "merchantId")]
7135    pub merchant_id: String,
7136    /// The corporate name of the merchant.
7137    #[serde(rename = "merchantName")]
7138    pub merchant_name: String,
7139    /// The dba name of the merchant.
7140    #[serde(rename = "dbaName")]
7141    pub dba_name: String,
7142    /// The date the statement was generated.
7143    #[serde(rename = "statementDate")]
7144    pub statement_date: DateTime<Utc>,
7145    /// Volume in numeric format.
7146    #[serde(rename = "volume")]
7147    pub volume: f64,
7148    /// The string formatted total volume on the statement.
7149    #[serde(rename = "volumeFormatted")]
7150    pub volume_formatted: String,
7151    /// The total volume on the statement.
7152    #[serde(rename = "transactionCount")]
7153    pub transaction_count: i64,
7154    /// The total interchange fees incurred this period.
7155    #[serde(rename = "interchange")]
7156    pub interchange: f64,
7157    /// The currency formatted form of interchange.
7158    #[serde(rename = "interchangeFormatted")]
7159    pub interchange_formatted: String,
7160    /// The total interchange as a ratio on volume incurred this period.
7161    #[serde(rename = "interchangeOnVolume")]
7162    pub interchange_on_volume: f64,
7163    /// The total interchange as a percentage of volume.
7164    #[serde(rename = "interchangeOnVolumeFormatted")]
7165    pub interchange_on_volume_formatted: String,
7166    /// The total card brand assessments fees incurred this period.
7167    #[serde(rename = "assessments")]
7168    pub assessments: f64,
7169    /// The currency formatted form of card brand assessments.
7170    #[serde(rename = "assessmentsFormatted")]
7171    pub assessments_formatted: String,
7172    /// The total card brand assessments as a ratio on volume incurred this period.
7173    #[serde(rename = "assessmentsOnVolume")]
7174    pub assessments_on_volume: f64,
7175    /// The total card brand assessments as a percentage of volume.
7176    #[serde(rename = "assessmentsOnVolumeFormatted")]
7177    pub assessments_on_volume_formatted: String,
7178    /// The commission earned on the portfolio during the statement period.
7179    #[serde(rename = "partnerCommission")]
7180    pub partner_commission: f64,
7181    /// The string formatted total volume on the statement.
7182    #[serde(rename = "partnerCommissionFormatted")]
7183    pub partner_commission_formatted: String,
7184    /// The total fees charge to the partner due to buy rates.
7185    #[serde(rename = "buyRate")]
7186    pub buy_rate: f64,
7187    /// The currency formatted form of partner buy rate.
7188    #[serde(rename = "buyRateFormatted")]
7189    pub buy_rate_formatted: String,
7190    /// Refers to card brand fees shared between BlockChyp and the partner.
7191    #[serde(rename = "hardCosts")]
7192    pub hard_costs: f64,
7193    /// The currency formatted form of hard costs.
7194    #[serde(rename = "hardCostsFormatted")]
7195    pub hard_costs_formatted: String,
7196
7197}
7198
7199/// Models details about disbursements related to partner statements.
7200#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7201pub struct PartnerStatementDisbursement {
7202    /// The disbursement id.
7203    #[serde(rename = "id")]
7204    pub id: String,
7205    /// Date and time the disbursement was processed.
7206    #[serde(rename = "timestamp")]
7207    pub timestamp: DateTime<Utc>,
7208    /// The type of disbursement transaction.
7209    #[serde(rename = "transactionType")]
7210    pub transaction_type: String,
7211    /// The payment method used to fund the disbursement.
7212    #[serde(rename = "paymentType")]
7213    pub payment_type: String,
7214    /// The masked account number into which funds were deposited.
7215    #[serde(rename = "maskedPan")]
7216    pub masked_pan: String,
7217    /// That payment is still pending.
7218    #[serde(rename = "pending")]
7219    pub pending: bool,
7220    /// That payment is approved.
7221    #[serde(rename = "approved")]
7222    pub approved: bool,
7223    /// A response description from the disbursement payment platform, in any.
7224    #[serde(rename = "responseDescription")]
7225    pub response_description: String,
7226    /// The amount disbursed in floating point format.
7227    #[serde(rename = "amount")]
7228    pub amount: f64,
7229    /// The currency formatted form of amount.
7230    #[serde(rename = "amountFormatted")]
7231    pub amount_formatted: String,
7232
7233}
7234
7235/// Models partner statement adjustments.
7236#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7237pub struct PartnerStatementAdjustment {
7238    /// The adjustment id.
7239    #[serde(rename = "id")]
7240    pub id: String,
7241    /// The date and time the disbursement was posted to the account.
7242    #[serde(rename = "timestamp")]
7243    pub timestamp: DateTime<Utc>,
7244    /// A description of the adjustment.
7245    #[serde(rename = "description")]
7246    pub description: String,
7247    /// The amount in floating point format.
7248    #[serde(rename = "amount")]
7249    pub amount: f64,
7250    /// The currency formatted form of amount.
7251    #[serde(rename = "amountFormatted")]
7252    pub amount_formatted: String,
7253
7254}
7255
7256/// Models a request to retrieve a list of partner statements.
7257#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7258pub struct MerchantInvoiceListRequest {
7259    /// The request timeout in seconds.
7260    #[serde(rename = "timeout")]
7261    pub timeout: i32,
7262    /// Whether or not to route transaction to the test gateway.
7263    #[serde(rename = "test")]
7264    pub test: bool,
7265    /// Optional merchant id for partner scoped requests.
7266    #[serde(rename = "merchantId")]
7267    pub merchant_id: Option<String>,
7268    /// Optional type to filter normal invoices vs statements.
7269    #[serde(rename = "invoiceType")]
7270    pub invoice_type: Option<String>,
7271    /// Optional start date filter for batch history.
7272    #[serde(rename = "startDate")]
7273    pub start_date: Option<DateTime<Utc>>,
7274    /// Optional end date filter for batch history.
7275    #[serde(rename = "endDate")]
7276    pub end_date: Option<DateTime<Utc>>,
7277
7278}
7279
7280/// Models a response to an invoice list request.
7281#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7282pub struct MerchantInvoiceListResponse {
7283    /// Whether or not the request succeeded.
7284    #[serde(rename = "success")]
7285    pub success: bool,
7286    /// The error, if an error occurred.
7287    #[serde(rename = "error")]
7288    pub error: String,
7289    /// A narrative description of the transaction result.
7290    #[serde(rename = "responseDescription")]
7291    pub response_description: String,
7292    /// The list of invoices returned by the request.
7293    #[serde(rename = "invoices")]
7294    pub invoices: Option<Vec<MerchantInvoiceSummary>>,
7295
7296}
7297
7298/// Models basic information about a merchant invoice for use in list or search results.
7299#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7300pub struct MerchantInvoiceSummary {
7301    /// The id owner of the invoice.
7302    #[serde(rename = "id")]
7303    pub id: String,
7304    /// The date the statement was generated.
7305    #[serde(rename = "dateCreated")]
7306    pub date_created: DateTime<Utc>,
7307    /// The grand total.
7308    #[serde(rename = "grandTotal")]
7309    pub grand_total: f64,
7310    /// The string formatted grand total.
7311    #[serde(rename = "grandTotalFormatted")]
7312    pub grand_total_formatted: String,
7313    /// The status of the statement.
7314    #[serde(rename = "status")]
7315    pub status: String,
7316    /// Identifies the invoice type.
7317    #[serde(rename = "invoiceType")]
7318    pub invoice_type: String,
7319    /// Whether or not the invoice had been paid.
7320    #[serde(rename = "paid")]
7321    pub paid: bool,
7322
7323}
7324
7325/// Models a request to retrieve detailed merchant invoice information.
7326#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7327pub struct MerchantInvoiceDetailRequest {
7328    /// The request timeout in seconds.
7329    #[serde(rename = "timeout")]
7330    pub timeout: i32,
7331    /// Whether or not to route transaction to the test gateway.
7332    #[serde(rename = "test")]
7333    pub test: bool,
7334    /// The invoice id.
7335    #[serde(rename = "id")]
7336    pub id: String,
7337
7338}
7339
7340/// Models detailed merchant invoice or statement information.
7341#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7342pub struct MerchantInvoiceDetailResponse {
7343    /// Whether or not the request succeeded.
7344    #[serde(rename = "success")]
7345    pub success: bool,
7346    /// The error, if an error occurred.
7347    #[serde(rename = "error")]
7348    pub error: String,
7349    /// A narrative description of the transaction result.
7350    #[serde(rename = "responseDescription")]
7351    pub response_description: String,
7352    /// Optional start date filter for batch history.
7353    #[serde(rename = "id")]
7354    pub id: String,
7355    /// The id of the merchant associated with the statement.
7356    #[serde(rename = "merchantId")]
7357    pub merchant_id: String,
7358    /// The corporate name of the merchant associated with the statement.
7359    #[serde(rename = "corporateName")]
7360    pub corporate_name: String,
7361    /// The dba name of the merchant associated with the statement.
7362    #[serde(rename = "dbaName")]
7363    pub dba_name: String,
7364    /// The date the statement was generated.
7365    #[serde(rename = "dateCreated")]
7366    pub date_created: DateTime<Utc>,
7367    /// The current status of the invoice.
7368    #[serde(rename = "status")]
7369    pub status: String,
7370    /// The type of invoice (statement or invoice).
7371    #[serde(rename = "invoiceType")]
7372    pub invoice_type: String,
7373    /// The type of pricing used for the invoice (typically flat rate or or interchange plus).
7374    #[serde(rename = "pricingType")]
7375    pub pricing_type: String,
7376    /// Whether or not the invoice has been paid.
7377    #[serde(rename = "paid")]
7378    pub paid: bool,
7379    /// The grand total.
7380    #[serde(rename = "grandTotal")]
7381    pub grand_total: f64,
7382    /// The string formatted grand total.
7383    #[serde(rename = "grandTotalFormatted")]
7384    pub grand_total_formatted: String,
7385    /// The subtotal before shipping and tax.
7386    #[serde(rename = "subtotal")]
7387    pub subtotal: f64,
7388    /// The string formatted subtotal before shipping and tax.
7389    #[serde(rename = "subotalFormatted")]
7390    pub subotal_formatted: String,
7391    /// The total sales tax.
7392    #[serde(rename = "taxTotal")]
7393    pub tax_total: f64,
7394    /// The string formatted total sales tax.
7395    #[serde(rename = "taxTotalFormatted")]
7396    pub tax_total_formatted: String,
7397    /// The total cost of shipping.
7398    #[serde(rename = "shippingCost")]
7399    pub shipping_cost: f64,
7400    /// The string formatted total cost of shipping.
7401    #[serde(rename = "shippingCostFormatted")]
7402    pub shipping_cost_formatted: String,
7403    /// The total unpaid balance on the invoice.
7404    #[serde(rename = "balanceDue")]
7405    pub balance_due: f64,
7406    /// The string formatted unpaid balance on the invoice.
7407    #[serde(rename = "balanceDueFormatted")]
7408    pub balance_due_formatted: String,
7409    /// The shipping or physical address associated with the invoice.
7410    #[serde(rename = "shippingAddress")]
7411    pub shipping_address: Option<Address>,
7412    /// The billing or mailing address associated with the invoice.
7413    #[serde(rename = "billingAddress")]
7414    pub billing_address: Option<Address>,
7415    /// The list of line item details associated with the invoice.
7416    #[serde(rename = "lineItems")]
7417    pub line_items: Option<Vec<InvoiceLineItem>>,
7418    /// The list of payments collected against the invoice.
7419    #[serde(rename = "payments")]
7420    pub payments: Option<Vec<InvoicePayment>>,
7421    /// The list of merchant settlements disbursed during the statement period.
7422    #[serde(rename = "deposits")]
7423    pub deposits: Option<Vec<StatementDeposit>>,
7424
7425}
7426
7427/// Models a single invoice or merchant statement line item.
7428#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7429pub struct InvoiceLineItem {
7430    /// The line item id.
7431    #[serde(rename = "id")]
7432    pub id: String,
7433    /// The type of line item.
7434    #[serde(rename = "lineType")]
7435    pub line_type: String,
7436    /// The product id for standard invoices.
7437    #[serde(rename = "productId")]
7438    pub product_id: String,
7439    /// The quantity associated with the line item.
7440    #[serde(rename = "quantity")]
7441    pub quantity: i64,
7442    /// The description associated with the line item.
7443    #[serde(rename = "description")]
7444    pub description: String,
7445    /// An alternate explanation.
7446    #[serde(rename = "explanation")]
7447    pub explanation: String,
7448    /// The transaction count associated with any transaction based fees.
7449    #[serde(rename = "transactionCount")]
7450    pub transaction_count: i64,
7451    /// The transaction volume associated with any fees.
7452    #[serde(rename = "volume")]
7453    pub volume: f64,
7454    /// The string formatted volume.
7455    #[serde(rename = "volumeFormatted")]
7456    pub volume_formatted: String,
7457    /// The per transaction fee.
7458    #[serde(rename = "perTransactionFee")]
7459    pub per_transaction_fee: f64,
7460    /// The string formatted per transaction fee.
7461    #[serde(rename = "perTransactionFeeFormatted")]
7462    pub per_transaction_fee_formatted: String,
7463    /// The percentage (as floating point ratio) fee assessed on volume.
7464    #[serde(rename = "transactionPercentage")]
7465    pub transaction_percentage: f64,
7466    /// The string formatted transaction fee percentage.
7467    #[serde(rename = "transactionPercentageFormatted")]
7468    pub transaction_percentage_formatted: String,
7469    /// The quantity price associated.
7470    #[serde(rename = "price")]
7471    pub price: f64,
7472    /// The string formatted price associated with a conventional line item.
7473    #[serde(rename = "priceFormatted")]
7474    pub price_formatted: String,
7475    /// The extended price .
7476    #[serde(rename = "priceExtended")]
7477    pub price_extended: f64,
7478    /// The string formatted extended price.
7479    #[serde(rename = "priceExtendedFormatted")]
7480    pub price_extended_formatted: String,
7481    /// The list of nested line items, if any.
7482    #[serde(rename = "lineItems")]
7483    pub line_items: Option<Vec<InvoiceLineItem>>,
7484
7485}
7486
7487/// Models information about payments against an invoice.
7488#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7489pub struct InvoicePayment {
7490    /// The line item id.
7491    #[serde(rename = "id")]
7492    pub id: String,
7493    /// Timestamp the payment was authorized.
7494    #[serde(rename = "timestamp")]
7495    pub timestamp: DateTime<Utc>,
7496    /// The type of disbursement transaction.
7497    #[serde(rename = "transactionType")]
7498    pub transaction_type: String,
7499    /// The payment method used to fund the disbursement.
7500    #[serde(rename = "paymentType")]
7501    pub payment_type: String,
7502    /// The auth code associated with credit card payment methods.
7503    #[serde(rename = "authCode")]
7504    pub auth_code: String,
7505    /// The masked account number into which funds were deposited.
7506    #[serde(rename = "maskedPan")]
7507    pub masked_pan: String,
7508    /// That payment is still pending.
7509    #[serde(rename = "pending")]
7510    pub pending: bool,
7511    /// That payment is approved.
7512    #[serde(rename = "approved")]
7513    pub approved: bool,
7514    /// A response description from the disbursement payment platform, in any.
7515    #[serde(rename = "responseDescription")]
7516    pub response_description: String,
7517    /// The amount disbursed in floating point format.
7518    #[serde(rename = "amount")]
7519    pub amount: f64,
7520    /// The currency formatted form of amount.
7521    #[serde(rename = "amountFormatted")]
7522    pub amount_formatted: String,
7523
7524}
7525
7526/// Models information about merchant deposits during a statement period.
7527#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7528pub struct StatementDeposit {
7529    /// The line item id.
7530    #[serde(rename = "id")]
7531    pub id: String,
7532    /// The number of transactions in the batch for which funds were deposited.
7533    #[serde(rename = "transactionCount")]
7534    pub transaction_count: i64,
7535    /// The batch id associated with the deposit.
7536    #[serde(rename = "batchId")]
7537    pub batch_id: String,
7538    /// The prepaid fees associated with the batch.
7539    #[serde(rename = "feesPaid")]
7540    pub fees_paid: f64,
7541    /// The currency formatted form of prepaid fees.
7542    #[serde(rename = "feesPaidFormatted")]
7543    pub fees_paid_formatted: String,
7544    /// The net deposit released to the merchant.
7545    #[serde(rename = "netDeposit")]
7546    pub net_deposit: f64,
7547    /// The currency formatted net deposit released to the merchant.
7548    #[serde(rename = "netDepositFormatted")]
7549    pub net_deposit_formatted: String,
7550    /// The total sales in the batch.
7551    #[serde(rename = "totalSales")]
7552    pub total_sales: f64,
7553    /// The currency formatted total sales in the batch.
7554    #[serde(rename = "totalSalesFormatted")]
7555    pub total_sales_formatted: String,
7556    /// The total refunds in the batch.
7557    #[serde(rename = "totalRefunds")]
7558    pub total_refunds: f64,
7559    /// The currency formatted total refunds in the batch.
7560    #[serde(rename = "totalRefundsFormatted")]
7561    pub total_refunds_formatted: String,
7562
7563}
7564
7565/// Models a request to retrieve detailed merchant invoice information.
7566#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7567pub struct PartnerCommissionBreakdownRequest {
7568    /// The request timeout in seconds.
7569    #[serde(rename = "timeout")]
7570    pub timeout: i32,
7571    /// Whether or not to route transaction to the test gateway.
7572    #[serde(rename = "test")]
7573    pub test: bool,
7574    /// The invoice or statement id.
7575    #[serde(rename = "statementId")]
7576    pub statement_id: String,
7577
7578}
7579
7580/// Models detailed information about how partner commissions were calculated for a
7581/// statement.
7582#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7583pub struct PartnerCommissionBreakdownResponse {
7584    /// Whether or not the request succeeded.
7585    #[serde(rename = "success")]
7586    pub success: bool,
7587    /// The error, if an error occurred.
7588    #[serde(rename = "error")]
7589    pub error: String,
7590    /// A narrative description of the transaction result.
7591    #[serde(rename = "responseDescription")]
7592    pub response_description: String,
7593    /// The invoice (statement id) for which the commissions were calculated.
7594    #[serde(rename = "invoiceId")]
7595    pub invoice_id: String,
7596    /// The partner name.
7597    #[serde(rename = "partnerName")]
7598    pub partner_name: String,
7599    /// The partner statement id.
7600    #[serde(rename = "partnerStatementId")]
7601    pub partner_statement_id: String,
7602    /// The partner statement date.
7603    #[serde(rename = "partnerStatementDate")]
7604    pub partner_statement_date: DateTime<Utc>,
7605    /// The merchant id.
7606    #[serde(rename = "merchantId")]
7607    pub merchant_id: String,
7608    /// The merchant's corporate name.
7609    #[serde(rename = "merchantCompanyName")]
7610    pub merchant_company_name: String,
7611    /// The merchant's dba name.
7612    #[serde(rename = "merchantDbaName")]
7613    pub merchant_dba_name: String,
7614    /// The grand total.
7615    #[serde(rename = "grandTotal")]
7616    pub grand_total: f64,
7617    /// The currency formatted grand total.
7618    #[serde(rename = "grandTotalFormatted")]
7619    pub grand_total_formatted: String,
7620    /// The total fees.
7621    #[serde(rename = "totalFees")]
7622    pub total_fees: f64,
7623    /// The currency formatted total fees.
7624    #[serde(rename = "totalFeesFormatted")]
7625    pub total_fees_formatted: String,
7626    /// The total due the partner for this merchant statement.
7627    #[serde(rename = "totalDue")]
7628    pub total_due: f64,
7629    /// The currency formatted total due the partner for this merchant statement.
7630    #[serde(rename = "totalDueFormatted")]
7631    pub total_due_formatted: String,
7632    /// The total volume during the statement period.
7633    #[serde(rename = "totalVolume")]
7634    pub total_volume: f64,
7635    /// The currency formatted total volume during the statement period.
7636    #[serde(rename = "totalVolumeFormatted")]
7637    pub total_volume_formatted: String,
7638    /// The total number of transactions processed during the statement period.
7639    #[serde(rename = "totalTransactions")]
7640    pub total_transactions: i64,
7641    /// The residual earned by the partner.
7642    #[serde(rename = "partnerResidual")]
7643    pub partner_residual: f64,
7644    /// The currency formatted residual earned by the partner.
7645    #[serde(rename = "partnerResidualFormatted")]
7646    pub partner_residual_formatted: String,
7647    /// The total interchange charged during the statement period.
7648    #[serde(rename = "interchange")]
7649    pub interchange: f64,
7650    /// The currency formatted total interchange charged during the statement period.
7651    #[serde(rename = "interchangeFormatted")]
7652    pub interchange_formatted: String,
7653    /// The total assessments charged during the statement period.
7654    #[serde(rename = "assessments")]
7655    pub assessments: f64,
7656    /// The currency formatted assessments charged during the statement period.
7657    #[serde(rename = "assessmentsFormatted")]
7658    pub assessments_formatted: String,
7659    /// The total of passthrough costs.
7660    #[serde(rename = "totalPassthrough")]
7661    pub total_passthrough: f64,
7662    /// The currency formatted total of passthrough costs.
7663    #[serde(rename = "totalPassthroughFormatted")]
7664    pub total_passthrough_formatted: String,
7665    /// The total of non passthrough costs.
7666    #[serde(rename = "totalNonPassthrough")]
7667    pub total_non_passthrough: f64,
7668    /// The currency formatted total of non passthrough costs.
7669    #[serde(rename = "totalNonPassthroughFormatted")]
7670    pub total_non_passthrough_formatted: String,
7671    /// The total of all card brand fees.
7672    #[serde(rename = "totalCardBrandFees")]
7673    pub total_card_brand_fees: f64,
7674    /// The currency formatted total of all card brand fees.
7675    #[serde(rename = "totalCardBrandFeesFormatted")]
7676    pub total_card_brand_fees_formatted: String,
7677    /// The total buy rate.
7678    #[serde(rename = "totalBuyRate")]
7679    pub total_buy_rate: f64,
7680    /// The currency formatted total buy rate.
7681    #[serde(rename = "totalBuyRateFormatted")]
7682    pub total_buy_rate_formatted: String,
7683    /// The total buy rate before passthrough costs.
7684    #[serde(rename = "buyRateBeforePassthrough")]
7685    pub buy_rate_before_passthrough: f64,
7686    /// The currency formatted total buy rate before passthrough costs.
7687    #[serde(rename = "buyRateBeforePassthroughFormatted")]
7688    pub buy_rate_before_passthrough_formatted: String,
7689    /// The net markup split between BlockChyp and the partner.
7690    #[serde(rename = "netMarkup")]
7691    pub net_markup: f64,
7692    /// The currency formatted net markup split between BlockChyp and the partner.
7693    #[serde(rename = "netMarkupFormatted")]
7694    pub net_markup_formatted: String,
7695    /// The partner's total share of non passthrough hard costs.
7696    #[serde(rename = "partnerNonPassthroughShare")]
7697    pub partner_non_passthrough_share: f64,
7698    /// The currency formatted partner's total share of non passthrough hard costs.
7699    #[serde(rename = "partnerNonPassthroughShareFormatted")]
7700    pub partner_non_passthrough_share_formatted: String,
7701    /// The total of chargeback fees assessed during the statement period.
7702    #[serde(rename = "chargebackFees")]
7703    pub chargeback_fees: f64,
7704    /// The currency formatted total of chargeback fees assessed during the statement
7705/// period.
7706    #[serde(rename = "chargebackFeesFormatted")]
7707    pub chargeback_fees_formatted: String,
7708    /// The total number of chargebacks during the period.
7709    #[serde(rename = "chargebackCount")]
7710    pub chargeback_count: i64,
7711    /// The partner's share of markup.
7712    #[serde(rename = "partnerPercentage")]
7713    pub partner_percentage: f64,
7714    /// The currency formatted partner's share of markup.
7715    #[serde(rename = "partnerPercentageFormatted")]
7716    pub partner_percentage_formatted: String,
7717    /// The list of line items documenting how the total buy rate was calculated.
7718    #[serde(rename = "buyRateLineItems")]
7719    pub buy_rate_line_items: Option<Vec<BuyRateLineItem>>,
7720    /// The list of detail lines describing how revenue was calculated and collected by the
7721/// sponsor bank.
7722    #[serde(rename = "revenueDetails")]
7723    pub revenue_details: Option<Vec<AggregateBillingLineItem>>,
7724    /// The nested list of costs levied by the card brands, grouped by card brand and type.
7725    #[serde(rename = "cardBrandCostDetails")]
7726    pub card_brand_cost_details: Option<Vec<AggregateBillingLineItem>>,
7727
7728}
7729
7730/// Models a request to generate merchant api credentials.
7731#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7732pub struct MerchantCredentialGenerationRequest {
7733    /// The request timeout in seconds.
7734    #[serde(rename = "timeout")]
7735    pub timeout: i32,
7736    /// Whether or not to route transaction to the test gateway.
7737    #[serde(rename = "test")]
7738    pub test: bool,
7739    /// The merchant id.
7740    #[serde(rename = "merchantId")]
7741    pub merchant_id: String,
7742    /// Protects the credentials from deletion.
7743    #[serde(rename = "deleteProtected")]
7744    pub delete_protected: bool,
7745    /// An optional array of role codes that will be assigned to the credentials.
7746    #[serde(rename = "roles")]
7747    pub roles: Option<Vec<String>>,
7748    /// Free form description of the purpose or intent behind the credentials.
7749    #[serde(rename = "notes")]
7750    pub notes: String,
7751    /// Type of credentials to generate, either API or TOKENIZING. Defaults to API.
7752    #[serde(rename = "credentialType")]
7753    pub credential_type: String,
7754
7755}
7756
7757/// Merchant api credential data.
7758#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7759pub struct MerchantCredentialGenerationResponse {
7760    /// Whether or not the request succeeded.
7761    #[serde(rename = "success")]
7762    pub success: bool,
7763    /// The error, if an error occurred.
7764    #[serde(rename = "error")]
7765    pub error: String,
7766    /// A narrative description of the transaction result.
7767    #[serde(rename = "responseDescription")]
7768    pub response_description: String,
7769    /// The merchant api key.
7770    #[serde(rename = "apiKey")]
7771    pub api_key: String,
7772    /// The merchant bearer token.
7773    #[serde(rename = "bearerToken")]
7774    pub bearer_token: String,
7775    /// The merchant signing key.
7776    #[serde(rename = "signingKey")]
7777    pub signing_key: String,
7778    /// The tokenizing key.
7779    #[serde(rename = "tokenizingKey")]
7780    pub tokenizing_key: String,
7781
7782}
7783
7784/// Models a single buy rate calculation line item.
7785#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7786pub struct BuyRateLineItem {
7787    /// Provides a basic description of the line item.
7788    #[serde(rename = "description")]
7789    pub description: String,
7790    /// The volume related to this line item.
7791    #[serde(rename = "volume")]
7792    pub volume: f64,
7793    /// The currency formatted volume related to this line item.
7794    #[serde(rename = "volumeFormatted")]
7795    pub volume_formatted: String,
7796    /// The rate on volume charged for this line item.
7797    #[serde(rename = "volumeRate")]
7798    pub volume_rate: f64,
7799    /// The string formatted rate on volume charged for this line item.
7800    #[serde(rename = "volumeRateFormatted")]
7801    pub volume_rate_formatted: String,
7802    /// The count associated with this line item.
7803    #[serde(rename = "count")]
7804    pub count: i64,
7805    /// The rate per item charged for this line item.
7806    #[serde(rename = "countRate")]
7807    pub count_rate: f64,
7808    /// The string formatted rate per item charged for this line item.
7809    #[serde(rename = "countRateFormatted")]
7810    pub count_rate_formatted: String,
7811    /// Provides a narrative description of the rate.
7812    #[serde(rename = "rateSummary")]
7813    pub rate_summary: String,
7814    /// The total amount for the line item.
7815    #[serde(rename = "total")]
7816    pub total: f64,
7817    /// The string formatted total for the line item.
7818    #[serde(rename = "totalFormatted")]
7819    pub total_formatted: String,
7820
7821}
7822
7823/// Models low level aggregated and nested data line items.
7824#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7825pub struct AggregateBillingLineItem {
7826    /// The line item identifier.
7827    #[serde(rename = "id")]
7828    pub id: String,
7829    /// Provides a basic description of the line item.
7830    #[serde(rename = "description")]
7831    pub description: String,
7832    /// That a line item has nested information.
7833    #[serde(rename = "expandable")]
7834    pub expandable: bool,
7835    /// The total is a negative number.
7836    #[serde(rename = "negative")]
7837    pub negative: bool,
7838    /// The total for the line item.
7839    #[serde(rename = "total")]
7840    pub total: f64,
7841    /// The currency formatted total for the line item.
7842    #[serde(rename = "totalFormatted")]
7843    pub total_formatted: String,
7844    /// The range of count based fees charged for the given line item.
7845    #[serde(rename = "perTranFeeRange")]
7846    pub per_tran_fee_range: Option<AggregateBillingLineItemStats>,
7847    /// The range of percentage based fees charged for the given line item.
7848    #[serde(rename = "transactionPercentageRange")]
7849    pub transaction_percentage_range: Option<AggregateBillingLineItemStats>,
7850    /// Encapsulated drill down or detail lines.
7851    #[serde(rename = "detailLines")]
7852    pub detail_lines: Option<Vec<AggregateBillingLineItem>>,
7853
7854}
7855
7856/// Models statistics for low level aggregation line items.
7857#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7858pub struct AggregateBillingLineItemStats {
7859    /// The min value in the set.
7860    #[serde(rename = "min")]
7861    pub min: String,
7862    /// The avg value in the set.
7863    #[serde(rename = "avg")]
7864    pub avg: String,
7865    /// The max value in the set.
7866    #[serde(rename = "max")]
7867    pub max: String,
7868
7869}
7870
7871/// Models an individual with 25% or more ownership interest in a company.
7872#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7873pub struct Owner {
7874    /// The first name of the owner.
7875    #[serde(rename = "firstName")]
7876    pub first_name: String,
7877    /// The last name of the owner.
7878    #[serde(rename = "lastName")]
7879    pub last_name: String,
7880    /// The job title of the owner.
7881    #[serde(rename = "jobTitle")]
7882    pub job_title: String,
7883    /// The tax identification number (SSN) of the owner.
7884    #[serde(rename = "taxIdNumber")]
7885    pub tax_id_number: String,
7886    /// The phone number of the owner.
7887    #[serde(rename = "phoneNumber")]
7888    pub phone_number: String,
7889    /// The date of birth of the owner in mm/dd/yyyy format.
7890    #[serde(rename = "dob")]
7891    pub dob: String,
7892    /// The percentage of ownership.
7893    #[serde(rename = "ownership")]
7894    pub ownership: String,
7895    /// The address of the owner.
7896    #[serde(rename = "address")]
7897    pub address: Address,
7898    /// The email address of the owner.
7899    #[serde(rename = "email")]
7900    pub email: String,
7901    /// A single line representation of the owner's address.
7902    #[serde(rename = "singleLineAddress")]
7903    pub single_line_address: String,
7904    /// The type of entity this owner represents.
7905    #[serde(rename = "entityType")]
7906    pub entity_type: String,
7907    /// The driver's license number of the owner.
7908    #[serde(rename = "dlNumber")]
7909    pub dl_number: String,
7910    /// The state that issued the owner's driver's license.
7911    #[serde(rename = "dlStateOrProvince")]
7912    pub dl_state_or_province: String,
7913    /// The expiration date of the owner's driver's license.
7914    #[serde(rename = "dlExpiration")]
7915    pub dl_expiration: String,
7916
7917}
7918
7919/// Models a bank account associated with an application.
7920#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7921pub struct ApplicationAccount {
7922    /// The name of the bank account.
7923    #[serde(rename = "name")]
7924    pub name: String,
7925    /// The name of the bank.
7926    #[serde(rename = "bank")]
7927    pub bank: String,
7928    /// The name of the account holder.
7929    #[serde(rename = "accountHolderName")]
7930    pub account_holder_name: String,
7931    /// The routing number of the bank.
7932    #[serde(rename = "routingNumber")]
7933    pub routing_number: String,
7934    /// The account number.
7935    #[serde(rename = "accountNumber")]
7936    pub account_number: String,
7937
7938}
7939
7940/// Models a merchant application form to add a merchant account.
7941#[derive(Debug, Default, Clone, Serialize, Deserialize)]
7942pub struct MerchantApplication {
7943    /// The invite code for the merchant.
7944    #[serde(rename = "inviteCode")]
7945    pub invite_code: String,
7946    /// The business name your customers know you by (DBA Name).
7947    #[serde(rename = "dbaName")]
7948    pub dba_name: String,
7949    /// The name of the legal entity you file your taxes under.
7950    #[serde(rename = "corporateName")]
7951    pub corporate_name: String,
7952    /// The business website.
7953    #[serde(rename = "webSite")]
7954    pub web_site: String,
7955    /// The business tax identification number (EIN).
7956    #[serde(rename = "taxIdNumber")]
7957    pub tax_id_number: String,
7958    /// The type of business entity.
7959    #[serde(rename = "entityType")]
7960    pub entity_type: String,
7961    /// The state where the business is incorporated.
7962    #[serde(rename = "stateOfIncorporation")]
7963    pub state_of_incorporation: String,
7964    /// The primary type of business (e.g., Retail, Service, etc.).
7965    #[serde(rename = "merchantType")]
7966    pub merchant_type: String,
7967    /// A short description of the products and services sold.
7968    #[serde(rename = "businessDescription")]
7969    pub business_description: String,
7970    /// The number of years the business has been operating.
7971    #[serde(rename = "yearsInBusiness")]
7972    pub years_in_business: String,
7973    /// The business telephone number.
7974    #[serde(rename = "businessPhoneNumber")]
7975    pub business_phone_number: String,
7976    /// The physical address of the business.
7977    #[serde(rename = "physicalAddress")]
7978    pub physical_address: Address,
7979    /// The mailing address of the business.
7980    #[serde(rename = "mailingAddress")]
7981    pub mailing_address: Address,
7982    /// The first name of the primary contact.
7983    #[serde(rename = "contactFirstName")]
7984    pub contact_first_name: String,
7985    /// The last name of the primary contact.
7986    #[serde(rename = "contactLastName")]
7987    pub contact_last_name: String,
7988    /// The phone number of the primary contact.
7989    #[serde(rename = "contactPhoneNumber")]
7990    pub contact_phone_number: String,
7991    /// The email address of the primary contact.
7992    #[serde(rename = "contactEmail")]
7993    pub contact_email: String,
7994    /// The job title of the primary contact.
7995    #[serde(rename = "contactTitle")]
7996    pub contact_title: String,
7997    /// The tax identification number (SSN) of the primary contact.
7998    #[serde(rename = "contactTaxIdNumber")]
7999    pub contact_tax_id_number: String,
8000    /// The date of birth of the primary contact.
8001    #[serde(rename = "contactDOB")]
8002    pub contact_dob: String,
8003    /// The driver's license number of the primary contact.
8004    #[serde(rename = "contactDlNumber")]
8005    pub contact_dl_number: String,
8006    /// The state that issued the primary contact's driver's license.
8007    #[serde(rename = "contactDlStateOrProvince")]
8008    pub contact_dl_state_or_province: String,
8009    /// The expiration date of the primary contact's driver's license.
8010    #[serde(rename = "contactDlExpiration")]
8011    pub contact_dl_expiration: String,
8012    /// The home address of the primary contact.
8013    #[serde(rename = "contactHomeAddress")]
8014    pub contact_home_address: Address,
8015    /// The role of the primary contact in the business.
8016    #[serde(rename = "contactRole")]
8017    pub contact_role: String,
8018    /// List of individuals with 25% or more ownership in the company.
8019    #[serde(rename = "owners")]
8020    pub owners: Option<Vec<Owner>>,
8021    /// The bank account information for the business.
8022    #[serde(rename = "manualAccount")]
8023    pub manual_account: ApplicationAccount,
8024    /// The average transaction amount.
8025    #[serde(rename = "averageTransaction")]
8026    pub average_transaction: String,
8027    /// The highest expected transaction amount.
8028    #[serde(rename = "highTransaction")]
8029    pub high_transaction: String,
8030    /// The average monthly transaction volume.
8031    #[serde(rename = "averageMonth")]
8032    pub average_month: String,
8033    /// The highest expected monthly transaction volume.
8034    #[serde(rename = "highMonth")]
8035    pub high_month: String,
8036    /// The refund policy of the business.
8037    #[serde(rename = "refundPolicy")]
8038    pub refund_policy: String,
8039    /// The number of days after purchase that refunds can be issued.
8040    #[serde(rename = "refundDays")]
8041    pub refund_days: String,
8042    /// The time zone of the business.
8043    #[serde(rename = "timeZone")]
8044    pub time_zone: String,
8045    /// The time when the daily batch should close.
8046    #[serde(rename = "batchCloseTime")]
8047    pub batch_close_time: String,
8048    /// Indicates if the business has multiple locations.
8049    #[serde(rename = "multipleLocations")]
8050    pub multiple_locations: String,
8051    /// The name of this specific business location.
8052    #[serde(rename = "locationName")]
8053    pub location_name: String,
8054    /// The store number for this location.
8055    #[serde(rename = "storeNumber")]
8056    pub store_number: String,
8057    /// Indicates if the business wants to accept EBT cards.
8058    #[serde(rename = "ebtRequested")]
8059    pub ebt_requested: String,
8060    /// The FNS number issued by the USDA for EBT processing.
8061    #[serde(rename = "fnsNumber")]
8062    pub fns_number: String,
8063    /// Indicates if the business plans to accept payments through a website.
8064    #[serde(rename = "ecommerce")]
8065    pub ecommerce: String,
8066    /// Indicates if suppliers ship products directly to customers.
8067    #[serde(rename = "dropShipping")]
8068    pub drop_shipping: bool,
8069    /// The percentage of transactions that will be chip or swipe.
8070    #[serde(rename = "cardPresentPercentage")]
8071    pub card_present_percentage: String,
8072    /// The percentage of transactions that will be phone orders.
8073    #[serde(rename = "phoneOrderPercentage")]
8074    pub phone_order_percentage: String,
8075    /// The percentage of transactions that will be e-commerce.
8076    #[serde(rename = "ecomPercentage")]
8077    pub ecom_percentage: String,
8078    /// The number of days before shipment that customers are charged.
8079    #[serde(rename = "billBeforeShipmentDays")]
8080    pub bill_before_shipment_days: String,
8081    /// Indicates if the business plans to process recurring payments.
8082    #[serde(rename = "subscriptionsSupported")]
8083    pub subscriptions_supported: String,
8084    /// The frequency of recurring payments (if applicable).
8085    #[serde(rename = "subscriptionFrequency")]
8086    pub subscription_frequency: String,
8087    /// The full legal name of the person signing the application.
8088    #[serde(rename = "signerName")]
8089    pub signer_name: String,
8090
8091}
8092
8093/// Models a merchant application submission request to add a new merchant account.
8094#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8095pub struct SubmitApplicationRequest {
8096    /// The request timeout in seconds.
8097    #[serde(rename = "timeout")]
8098    pub timeout: i32,
8099    /// Whether or not to route transaction to the test gateway.
8100    #[serde(rename = "test")]
8101    pub test: bool,
8102    /// The invite code for the merchant.
8103    #[serde(rename = "inviteCode")]
8104    pub invite_code: String,
8105    /// The business name your customers know you by (DBA Name).
8106    #[serde(rename = "dbaName")]
8107    pub dba_name: String,
8108    /// The name of the legal entity you file your taxes under.
8109    #[serde(rename = "corporateName")]
8110    pub corporate_name: String,
8111    /// The business website.
8112    #[serde(rename = "webSite")]
8113    pub web_site: String,
8114    /// The business tax identification number (EIN).
8115    #[serde(rename = "taxIdNumber")]
8116    pub tax_id_number: String,
8117    /// The type of business entity.
8118    #[serde(rename = "entityType")]
8119    pub entity_type: String,
8120    /// The state where the business is incorporated.
8121    #[serde(rename = "stateOfIncorporation")]
8122    pub state_of_incorporation: String,
8123    /// The primary type of business (e.g., Retail, Service, etc.).
8124    #[serde(rename = "merchantType")]
8125    pub merchant_type: String,
8126    /// A short description of the products and services sold.
8127    #[serde(rename = "businessDescription")]
8128    pub business_description: String,
8129    /// The number of years the business has been operating.
8130    #[serde(rename = "yearsInBusiness")]
8131    pub years_in_business: String,
8132    /// The business telephone number.
8133    #[serde(rename = "businessPhoneNumber")]
8134    pub business_phone_number: String,
8135    /// The physical address of the business.
8136    #[serde(rename = "physicalAddress")]
8137    pub physical_address: Address,
8138    /// The mailing address of the business.
8139    #[serde(rename = "mailingAddress")]
8140    pub mailing_address: Address,
8141    /// The first name of the primary contact.
8142    #[serde(rename = "contactFirstName")]
8143    pub contact_first_name: String,
8144    /// The last name of the primary contact.
8145    #[serde(rename = "contactLastName")]
8146    pub contact_last_name: String,
8147    /// The phone number of the primary contact.
8148    #[serde(rename = "contactPhoneNumber")]
8149    pub contact_phone_number: String,
8150    /// The email address of the primary contact.
8151    #[serde(rename = "contactEmail")]
8152    pub contact_email: String,
8153    /// The job title of the primary contact.
8154    #[serde(rename = "contactTitle")]
8155    pub contact_title: String,
8156    /// The tax identification number (SSN) of the primary contact.
8157    #[serde(rename = "contactTaxIdNumber")]
8158    pub contact_tax_id_number: String,
8159    /// The date of birth of the primary contact.
8160    #[serde(rename = "contactDOB")]
8161    pub contact_dob: String,
8162    /// The driver's license number of the primary contact.
8163    #[serde(rename = "contactDlNumber")]
8164    pub contact_dl_number: String,
8165    /// The state that issued the primary contact's driver's license.
8166    #[serde(rename = "contactDlStateOrProvince")]
8167    pub contact_dl_state_or_province: String,
8168    /// The expiration date of the primary contact's driver's license.
8169    #[serde(rename = "contactDlExpiration")]
8170    pub contact_dl_expiration: String,
8171    /// The home address of the primary contact.
8172    #[serde(rename = "contactHomeAddress")]
8173    pub contact_home_address: Address,
8174    /// The role of the primary contact in the business.
8175    #[serde(rename = "contactRole")]
8176    pub contact_role: String,
8177    /// List of individuals with 25% or more ownership in the company.
8178    #[serde(rename = "owners")]
8179    pub owners: Option<Vec<Owner>>,
8180    /// The bank account information for the business.
8181    #[serde(rename = "manualAccount")]
8182    pub manual_account: ApplicationAccount,
8183    /// The average transaction amount.
8184    #[serde(rename = "averageTransaction")]
8185    pub average_transaction: String,
8186    /// The highest expected transaction amount.
8187    #[serde(rename = "highTransaction")]
8188    pub high_transaction: String,
8189    /// The average monthly transaction volume.
8190    #[serde(rename = "averageMonth")]
8191    pub average_month: String,
8192    /// The highest expected monthly transaction volume.
8193    #[serde(rename = "highMonth")]
8194    pub high_month: String,
8195    /// The refund policy of the business.
8196    #[serde(rename = "refundPolicy")]
8197    pub refund_policy: String,
8198    /// The number of days after purchase that refunds can be issued.
8199    #[serde(rename = "refundDays")]
8200    pub refund_days: String,
8201    /// The time zone of the business.
8202    #[serde(rename = "timeZone")]
8203    pub time_zone: String,
8204    /// The time when the daily batch should close.
8205    #[serde(rename = "batchCloseTime")]
8206    pub batch_close_time: String,
8207    /// Indicates if the business has multiple locations.
8208    #[serde(rename = "multipleLocations")]
8209    pub multiple_locations: String,
8210    /// The name of this specific business location.
8211    #[serde(rename = "locationName")]
8212    pub location_name: String,
8213    /// The store number for this location.
8214    #[serde(rename = "storeNumber")]
8215    pub store_number: String,
8216    /// Indicates if the business wants to accept EBT cards.
8217    #[serde(rename = "ebtRequested")]
8218    pub ebt_requested: String,
8219    /// The FNS number issued by the USDA for EBT processing.
8220    #[serde(rename = "fnsNumber")]
8221    pub fns_number: String,
8222    /// Indicates if the business plans to accept payments through a website.
8223    #[serde(rename = "ecommerce")]
8224    pub ecommerce: String,
8225    /// Indicates if suppliers ship products directly to customers.
8226    #[serde(rename = "dropShipping")]
8227    pub drop_shipping: bool,
8228    /// The percentage of transactions that will be chip or swipe.
8229    #[serde(rename = "cardPresentPercentage")]
8230    pub card_present_percentage: String,
8231    /// The percentage of transactions that will be phone orders.
8232    #[serde(rename = "phoneOrderPercentage")]
8233    pub phone_order_percentage: String,
8234    /// The percentage of transactions that will be e-commerce.
8235    #[serde(rename = "ecomPercentage")]
8236    pub ecom_percentage: String,
8237    /// The number of days before shipment that customers are charged.
8238    #[serde(rename = "billBeforeShipmentDays")]
8239    pub bill_before_shipment_days: String,
8240    /// Indicates if the business plans to process recurring payments.
8241    #[serde(rename = "subscriptionsSupported")]
8242    pub subscriptions_supported: String,
8243    /// The frequency of recurring payments (if applicable).
8244    #[serde(rename = "subscriptionFrequency")]
8245    pub subscription_frequency: String,
8246    /// The full legal name of the person signing the application.
8247    #[serde(rename = "signerName")]
8248    pub signer_name: String,
8249
8250}
8251
8252/// Models settings related to state checks for a merchant.
8253#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8254pub struct StateCheckSettings {
8255    /// If state checks are enabled for the merchant.
8256    #[serde(rename = "enabled")]
8257    pub enabled: bool,
8258    /// The list of states that are exempt from surcharges.
8259    #[serde(rename = "surchargeExemptStates")]
8260    pub surcharge_exempt_states: Option<Vec<String>>,
8261
8262}
8263
8264/// Models merchant settings and configuration.
8265#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8266pub struct PricingMerchantSettings {
8267    /// The merchant account identifier.
8268    #[serde(rename = "account")]
8269    pub account: String,
8270    /// The gateway identifier.
8271    #[serde(rename = "gateway")]
8272    pub gateway: String,
8273    /// Whether surcharging is enabled for the merchant.
8274    #[serde(rename = "surchargingEnabled")]
8275    pub surcharging_enabled: bool,
8276    /// The custom surcharge percentage, if applicable.
8277    #[serde(rename = "customSurchargePercent")]
8278    pub custom_surcharge_percent: Option<f64>,
8279    /// If reduced rate pricing is enabled.
8280    #[serde(rename = "reducedRate")]
8281    pub reduced_rate: Option<bool>,
8282    /// If inverse pricing is enabled.
8283    #[serde(rename = "inversePricingEnabled")]
8284    pub inverse_pricing_enabled: Option<bool>,
8285    /// The credit discount rate, if applicable.
8286    #[serde(rename = "creditDiscountRate")]
8287    pub credit_discount_rate: Option<f64>,
8288    /// The acquiring solution identifier.
8289    #[serde(rename = "acquiringSolution")]
8290    pub acquiring_solution: String,
8291    /// Whether the merchant accepts debit cards.
8292    #[serde(rename = "acceptDebit")]
8293    pub accept_debit: Option<bool>,
8294    /// State check settings for the merchant.
8295    #[serde(rename = "stateCheckSettings")]
8296    pub state_check_settings: Option<StateCheckSettings>,
8297
8298}
8299
8300/// Models the attributes for a pricing request.
8301#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8302pub struct PricingRequestAttributes {
8303    /// The card number for the pricing request.
8304    #[serde(rename = "cardNumber")]
8305    pub card_number: Option<String>,
8306    /// The payment token.
8307    #[serde(rename = "token")]
8308    pub token: String,
8309    /// The merchant identifier.
8310    #[serde(rename = "merchantIdentifier")]
8311    pub merchant_identifier: Option<String>,
8312    /// The transaction amount.
8313    #[serde(rename = "amount")]
8314    pub amount: f64,
8315    /// The country code.
8316    #[serde(rename = "country")]
8317    pub country: Option<String>,
8318    /// The postal code.
8319    #[serde(rename = "postalCode")]
8320    pub postal_code: Option<String>,
8321    /// The state or province.
8322    #[serde(rename = "state")]
8323    pub state: Option<String>,
8324    /// Merchant settings for the pricing request.
8325    #[serde(rename = "merchantSettings")]
8326    pub merchant_settings: Option<PricingMerchantSettings>,
8327
8328}
8329
8330/// Models the data wrapper for a pricing request.
8331#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8332pub struct PricingRequestData {
8333    /// The type of the request.
8334    #[serde(rename = "type")]
8335    pub type_yo: String,
8336    /// The pricing request attributes.
8337    #[serde(rename = "attributes")]
8338    pub attributes: PricingRequestAttributes,
8339
8340}
8341
8342/// Models a pricing request.
8343#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8344pub struct PricingRequest {
8345    /// The request timeout in seconds.
8346    #[serde(rename = "timeout")]
8347    pub timeout: i32,
8348    /// Whether or not to route transaction to the test gateway.
8349    #[serde(rename = "test")]
8350    pub test: bool,
8351    /// The pricing request data.
8352    #[serde(rename = "data")]
8353    pub data: PricingRequestData,
8354
8355}
8356
8357/// Models pricing response data for new handler for pricing api responses.
8358#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8359pub struct PricingResponseAttributes {
8360    /// The surcharge percentage.
8361    #[serde(rename = "surchargePercent")]
8362    pub surcharge_percent: f64,
8363    /// The surcharge amount.
8364    #[serde(rename = "surchargeAmount")]
8365    pub surcharge_amount: f64,
8366    /// If the transaction is exempt from surcharges.
8367    #[serde(rename = "surchargeExempt")]
8368    pub surcharge_exempt: bool,
8369    /// The type of card.
8370    #[serde(rename = "cardType")]
8371    pub card_type: String,
8372    /// The card token.
8373    #[serde(rename = "cardToken")]
8374    pub card_token: Option<String>,
8375    /// The card brand.
8376    #[serde(rename = "brand")]
8377    pub brand: String,
8378    /// The bank identification number.
8379    #[serde(rename = "bin")]
8380    pub bin: String,
8381    /// The commercial card indicator.
8382    #[serde(rename = "commercialIndicator")]
8383    pub commercial_indicator: String,
8384    /// The disclosure statement.
8385    #[serde(rename = "disclosure")]
8386    pub disclosure: Option<String>,
8387    /// The debit card category.
8388    #[serde(rename = "debitCategory")]
8389    pub debit_category: String,
8390    /// The country where the card was issued.
8391    #[serde(rename = "countryIssued")]
8392    pub country_issued: String,
8393    /// The unique identifier for the pricing response.
8394    #[serde(rename = "uuid")]
8395    pub uuid: String,
8396
8397}
8398
8399/// Models the data wrapper for a pricing response.
8400#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8401pub struct PricingResponseData {
8402    /// The type of the response.
8403    #[serde(rename = "type")]
8404    pub type_yo: String,
8405    /// The pricing response attributes.
8406    #[serde(rename = "attributes")]
8407    pub attributes: PricingResponseAttributes,
8408
8409}
8410
8411/// Models an error response.
8412#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8413pub struct ErrorType {
8414    /// The HTTP status code.
8415    #[serde(rename = "status")]
8416    pub status: i32,
8417    /// The error title.
8418    #[serde(rename = "title")]
8419    pub title: String,
8420    /// The detailed error message.
8421    #[serde(rename = "detail")]
8422    pub detail: String,
8423
8424}
8425
8426/// Models a pricing response.
8427#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8428pub struct PricingResponse {
8429    /// Whether or not the request succeeded.
8430    #[serde(rename = "success")]
8431    pub success: bool,
8432    /// The error, if an error occurred.
8433    #[serde(rename = "error")]
8434    pub error: String,
8435    /// A narrative description of the transaction result.
8436    #[serde(rename = "responseDescription")]
8437    pub response_description: String,
8438    /// The pricing response data.
8439    #[serde(rename = "data")]
8440    pub data: PricingResponseData,
8441
8442}
8443
8444
8445
8446/// A request for customer signature data.
8447#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8448pub struct TerminalCaptureSignatureRequest {
8449    #[serde(flatten)]
8450    pub api_credentials: APICredentials,
8451    #[serde(rename = "request")]
8452    pub request: CaptureSignatureRequest,
8453}
8454
8455/// Information needed to test connectivity with a terminal.
8456#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8457pub struct TerminalPingRequest {
8458    #[serde(flatten)]
8459    pub api_credentials: APICredentials,
8460    #[serde(rename = "request")]
8461    pub request: PingRequest,
8462}
8463
8464/// Information needed to retrieve location information for a terminal.
8465#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8466pub struct TerminalLocateRequest {
8467    #[serde(flatten)]
8468    pub api_credentials: APICredentials,
8469    #[serde(rename = "request")]
8470    pub request: LocateRequest,
8471}
8472
8473/// A message to be displayed on the terminal screen.
8474#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8475pub struct TerminalMessageRequest {
8476    #[serde(flatten)]
8477    pub api_credentials: APICredentials,
8478    #[serde(rename = "request")]
8479    pub request: MessageRequest,
8480}
8481
8482/// A simple yes no prompt request.
8483#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8484pub struct TerminalBooleanPromptRequest {
8485    #[serde(flatten)]
8486    pub api_credentials: APICredentials,
8487    #[serde(rename = "request")]
8488    pub request: BooleanPromptRequest,
8489}
8490
8491/// A text prompt request.
8492#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8493pub struct TerminalTextPromptRequest {
8494    #[serde(flatten)]
8495    pub api_credentials: APICredentials,
8496    #[serde(rename = "request")]
8497    pub request: TextPromptRequest,
8498}
8499
8500/// An authorization request for a charge, preauth, or reverse transaction.
8501#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8502pub struct TerminalAuthorizationRequest {
8503    #[serde(flatten)]
8504    pub api_credentials: APICredentials,
8505    #[serde(rename = "request")]
8506    pub request: AuthorizationRequest,
8507}
8508
8509/// Retrieves card metadata.
8510#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8511pub struct TerminalCardMetadataRequest {
8512    #[serde(flatten)]
8513    pub api_credentials: APICredentials,
8514    #[serde(rename = "request")]
8515    pub request: CardMetadataRequest,
8516}
8517
8518/// A request for the remaining balance on a payment type.
8519#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8520pub struct TerminalBalanceRequest {
8521    #[serde(flatten)]
8522    pub api_credentials: APICredentials,
8523    #[serde(rename = "request")]
8524    pub request: BalanceRequest,
8525}
8526
8527/// A refund request.
8528#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8529pub struct TerminalRefundRequest {
8530    #[serde(flatten)]
8531    pub api_credentials: APICredentials,
8532    #[serde(rename = "request")]
8533    pub request: RefundRequest,
8534}
8535
8536/// The information needed to enroll a new payment method in the token vault.
8537#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8538pub struct TerminalEnrollRequest {
8539    #[serde(flatten)]
8540    pub api_credentials: APICredentials,
8541    #[serde(rename = "request")]
8542    pub request: EnrollRequest,
8543}
8544
8545/// The information needed to enroll a new payment method in the token vault.
8546#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8547pub struct TerminalClearTerminalRequest {
8548    #[serde(flatten)]
8549    pub api_credentials: APICredentials,
8550    #[serde(rename = "request")]
8551    pub request: ClearTerminalRequest,
8552}
8553
8554/// The information needed to activate or recharge a gift card.
8555#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8556pub struct TerminalGiftActivateRequest {
8557    #[serde(flatten)]
8558    pub api_credentials: APICredentials,
8559    #[serde(rename = "request")]
8560    pub request: GiftActivateRequest,
8561}
8562
8563/// The fields needed for custom Terms and Conditions prompts.
8564#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8565pub struct TerminalTermsAndConditionsRequest {
8566    #[serde(flatten)]
8567    pub api_credentials: APICredentials,
8568    #[serde(rename = "request")]
8569    pub request: TermsAndConditionsRequest,
8570}
8571
8572/// A signature capture response for Terms and Conditions.
8573#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8574pub struct TerminalTermsAndConditionsResponse {
8575    #[serde(flatten)]
8576    pub api_credentials: APICredentials,
8577    #[serde(rename = "request")]
8578    pub request: TermsAndConditionsResponse,
8579}
8580
8581/// Used to start or update a transaction line item display on a terminal.
8582#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8583pub struct TerminalTransactionDisplayRequest {
8584    #[serde(flatten)]
8585    pub api_credentials: APICredentials,
8586    #[serde(rename = "request")]
8587    pub request: TransactionDisplayRequest,
8588}
8589
8590/// A request for the status of a terminal.
8591#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8592pub struct TerminalTerminalStatusRequest {
8593    #[serde(flatten)]
8594    pub api_credentials: APICredentials,
8595    #[serde(rename = "request")]
8596    pub request: TerminalStatusRequest,
8597}
8598
8599/// Returns a list of queued transactions on a terminal.
8600#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8601pub struct TerminalListQueuedTransactionsRequest {
8602    #[serde(flatten)]
8603    pub api_credentials: APICredentials,
8604    #[serde(rename = "request")]
8605    pub request: ListQueuedTransactionsRequest,
8606}
8607
8608/// Deletes one or all transactions from a terminal queue.
8609#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8610pub struct TerminalDeleteQueuedTransactionRequest {
8611    #[serde(flatten)]
8612    pub api_credentials: APICredentials,
8613    #[serde(rename = "request")]
8614    pub request: DeleteQueuedTransactionRequest,
8615}
8616
8617
8618
8619/// Fields which should be returned with standard requests.
8620#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8621pub struct AbstractAcknowledgement {
8622    /// Whether or not the request succeeded.
8623    #[serde(rename = "success")]
8624    pub success: bool,
8625    /// The error, if an error occurred.
8626    #[serde(rename = "error")]
8627    pub error: String,
8628    /// A narrative description of the transaction result.
8629    #[serde(rename = "responseDescription")]
8630    pub response_description: String,
8631
8632}
8633
8634/// A reference to a terminal name.
8635#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8636pub struct TerminalReference {
8637    /// The name of the target payment terminal.
8638    #[serde(rename = "terminalName")]
8639    pub terminal_name: String,
8640    /// Forces the terminal cloud connection to be reset while a transactions is in flight.
8641/// This is a diagnostic settings that can be used only for test transactions.
8642    #[serde(rename = "resetConnection")]
8643    pub reset_connection: bool,
8644
8645}
8646
8647/// Customer signature data.
8648#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8649pub struct SignatureResponse {
8650    /// The hex encoded signature data.
8651    #[serde(rename = "sigFile")]
8652    pub sig_file: String,
8653
8654}
8655
8656/// A request for customer signature data.
8657#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8658pub struct SignatureRequest {
8659    /// A location on the filesystem which a customer signature should be written to.
8660    #[serde(rename = "sigFile")]
8661    pub sig_file: String,
8662    /// The image format to be used for returning signatures.
8663    #[serde(rename = "sigFormat")]
8664    pub sig_format: SignatureFormat,
8665    /// The width that the signature image should be scaled to, preserving the aspect ratio. If
8666/// not provided, the signature is returned in the terminal's max resolution.
8667    #[serde(rename = "sigWidth")]
8668    pub sig_width: i32,
8669    /// Whether or not signature prompt should be skipped on the terminal. The terminal will
8670/// indicate whether or not a signature is required by the card in the receipt suggestions
8671/// response.
8672    #[serde(rename = "disableSignature")]
8673    pub disable_signature: bool,
8674
8675}
8676
8677/// Response fields for an approved transaction.
8678#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8679pub struct ApprovalResponse {
8680    /// That the transaction was approved.
8681    #[serde(rename = "approved")]
8682    pub approved: bool,
8683    /// The auth code from the payment network.
8684    #[serde(rename = "authCode")]
8685    pub auth_code: String,
8686    /// The code returned by the terminal or the card issuer to indicate the disposition of the
8687/// message.
8688    #[serde(rename = "authResponseCode")]
8689    pub auth_response_code: String,
8690
8691}
8692
8693/// Models a low level request with a timeout and test flag.
8694#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8695pub struct TimeoutRequest {
8696    /// The request timeout in seconds.
8697    #[serde(rename = "timeout")]
8698    pub timeout: i32,
8699    /// Whether or not to route transaction to the test gateway.
8700    #[serde(rename = "test")]
8701    pub test: bool,
8702
8703}
8704
8705/// Core request fields for a transaction.
8706#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8707pub struct CoreRequest {
8708    /// A user-assigned reference that can be used to recall or reverse transactions.
8709    #[serde(rename = "transactionRef")]
8710    pub transaction_ref: String,
8711    /// That the transaction reference was autogenerated and should be ignored for the
8712/// purposes of duplicate detection.
8713    #[serde(rename = "autogeneratedRef")]
8714    pub autogenerated_ref: bool,
8715    /// Defers the response to the transaction and returns immediately. Callers should
8716/// retrive the transaction result using the Transaction Status API.
8717    #[serde(rename = "async")]
8718    pub async_yo: bool,
8719    /// Adds the transaction to the queue and returns immediately. Callers should retrive the
8720/// transaction result using the Transaction Status API.
8721    #[serde(rename = "queue")]
8722    pub queue: bool,
8723    /// Whether or not the request should block until all cards have been removed from the card
8724/// reader.
8725    #[serde(rename = "waitForRemovedCard")]
8726    pub wait_for_removed_card: bool,
8727    /// Override any in-progress transactions.
8728    #[serde(rename = "force")]
8729    pub force: bool,
8730    /// An identifier from an external point of sale system.
8731    #[serde(rename = "orderRef")]
8732    pub order_ref: String,
8733    /// The settlement account for merchants with split settlements.
8734    #[serde(rename = "destinationAccount")]
8735    pub destination_account: String,
8736    /// Can include a code used to trigger simulated conditions for the purposes of testing and
8737/// certification. Valid for test merchant accounts only.
8738    #[serde(rename = "testCase")]
8739    pub test_case: String,
8740
8741}
8742
8743/// Response details about a payment method.
8744#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8745pub struct PaymentMethodResponse {
8746    /// The payment token, if the payment was enrolled in the vault.
8747    #[serde(rename = "token")]
8748    pub token: String,
8749    /// The entry method for the transaction (CHIP, MSR, KEYED, etc).
8750    #[serde(rename = "entryMethod")]
8751    pub entry_method: String,
8752    /// The card brand (VISA, MC, AMEX, DEBIT, etc).
8753    #[serde(rename = "paymentType")]
8754    pub payment_type: String,
8755    /// Provides network level detail on how a transaction was routed, especially for debit
8756/// transactions.
8757    #[serde(rename = "network")]
8758    pub network: String,
8759    /// Identifies the card association based on bin number. Used primarily used to indicate
8760/// the major logo on a card, even when debit transactions are routed on a different
8761/// network.
8762    #[serde(rename = "logo")]
8763    pub logo: String,
8764    /// The masked primary account number.
8765    #[serde(rename = "maskedPan")]
8766    pub masked_pan: String,
8767    /// The BlockChyp public key if the user presented a BlockChyp payment card.
8768    #[serde(rename = "publicKey")]
8769    pub public_key: String,
8770    /// That the transaction did something that would put the system in PCI scope.
8771    #[serde(rename = "ScopeAlert")]
8772    pub scope_alert: bool,
8773    /// The cardholder name.
8774    #[serde(rename = "cardHolder")]
8775    pub card_holder: String,
8776    /// The card expiration month in MM format.
8777    #[serde(rename = "expMonth")]
8778    pub exp_month: String,
8779    /// The card expiration year in YY format.
8780    #[serde(rename = "expYear")]
8781    pub exp_year: String,
8782    /// The card postal code.
8783    #[serde(rename = "postalCode")]
8784    pub postal_code: String,
8785    /// The card address.
8786    #[serde(rename = "address")]
8787    pub address: String,
8788    /// The card country.
8789    #[serde(rename = "country")]
8790    pub country: String,
8791    /// Address verification results if address information was submitted.
8792    #[serde(rename = "avsResponse")]
8793    pub avs_response: AVSResponse,
8794    /// The CVV verification result if CVV was submitted.
8795    #[serde(rename = "cvvResponse")]
8796    pub cvv_response: String,
8797    /// Suggested receipt fields.
8798    #[serde(rename = "receiptSuggestions")]
8799    pub receipt_suggestions: ReceiptSuggestions,
8800    /// Customer data, if any. Preserved for reverse compatibility.
8801    #[serde(rename = "customer")]
8802    pub customer: Option<Customer>,
8803    /// Customer data, if any.
8804    #[serde(rename = "customers")]
8805    pub customers: Customer,
8806
8807}
8808
8809/// Response details for a cryptocurrency transaction.
8810#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8811pub struct CryptocurrencyResponse {
8812    /// That the transaction has met the standard criteria for confirmation on the network.
8813/// (For example, 6 confirmations for level one bitcoin.)
8814    #[serde(rename = "confirmed")]
8815    pub confirmed: bool,
8816    /// The amount submitted to the blockchain.
8817    #[serde(rename = "cryptoAuthorizedAmount")]
8818    pub crypto_authorized_amount: String,
8819    /// The network level fee assessed for the transaction denominated in cryptocurrency.
8820/// This fee goes to channel operators and crypto miners, not BlockChyp.
8821    #[serde(rename = "cryptoNetworkFee")]
8822    pub crypto_network_fee: String,
8823    /// The three letter cryptocurrency code used for the transactions.
8824    #[serde(rename = "cryptocurrency")]
8825    pub cryptocurrency: String,
8826    /// Whether or not the transaction was processed on the level one or level two network.
8827    #[serde(rename = "cryptoNetwork")]
8828    pub crypto_network: String,
8829    /// The address on the crypto network the transaction was sent to.
8830    #[serde(rename = "cryptoReceiveAddress")]
8831    pub crypto_receive_address: String,
8832    /// Hash or other identifier that identifies the block on the cryptocurrency network, if
8833/// available or relevant.
8834    #[serde(rename = "cryptoBlock")]
8835    pub crypto_block: String,
8836    /// Hash or other transaction identifier that identifies the transaction on the
8837/// cryptocurrency network, if available or relevant.
8838    #[serde(rename = "cryptoTransactionId")]
8839    pub crypto_transaction_id: String,
8840    /// The payment request URI used for the transaction, if available.
8841    #[serde(rename = "cryptoPaymentRequest")]
8842    pub crypto_payment_request: String,
8843    /// Used for additional status information related to crypto transactions.
8844    #[serde(rename = "cryptoStatus")]
8845    pub crypto_status: String,
8846
8847}
8848
8849/// Response details about tender amounts.
8850#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8851pub struct PaymentAmounts {
8852    /// Whether or not the transaction was approved for a partial amount.
8853    #[serde(rename = "partialAuth")]
8854    pub partial_auth: bool,
8855    /// Whether or not an alternate currency was used.
8856    #[serde(rename = "altCurrency")]
8857    pub alt_currency: bool,
8858    /// Whether or not a request was settled on an FSA card.
8859    #[serde(rename = "fsaAuth")]
8860    pub fsa_auth: bool,
8861    /// The currency code used for the transaction.
8862    #[serde(rename = "currencyCode")]
8863    pub currency_code: String,
8864    /// The requested amount.
8865    #[serde(rename = "requestedAmount")]
8866    pub requested_amount: String,
8867    /// The authorized amount. May not match the requested amount in the event of a partial
8868/// auth.
8869    #[serde(rename = "authorizedAmount")]
8870    pub authorized_amount: String,
8871    /// The remaining balance on the payment method.
8872    #[serde(rename = "remainingBalance")]
8873    pub remaining_balance: String,
8874    /// The tip amount.
8875    #[serde(rename = "tipAmount")]
8876    pub tip_amount: String,
8877    /// The tax amount.
8878    #[serde(rename = "taxAmount")]
8879    pub tax_amount: String,
8880    /// The cash back amount the customer requested during the transaction.
8881    #[serde(rename = "requestedCashBackAmount")]
8882    pub requested_cash_back_amount: String,
8883    /// The amount of cash back authorized by the gateway. This amount will be the entire amount
8884/// requested, or zero.
8885    #[serde(rename = "authorizedCashBackAmount")]
8886    pub authorized_cash_back_amount: String,
8887
8888}
8889
8890/// Request details about a payment method.
8891#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8892pub struct PaymentMethod {
8893    /// The payment token to be used for this transaction. This should be used for recurring
8894/// transactions.
8895    #[serde(rename = "token")]
8896    pub token: String,
8897    /// Track 1 magnetic stripe data.
8898    #[serde(rename = "track1")]
8899    pub track_1: String,
8900    /// Track 2 magnetic stripe data.
8901    #[serde(rename = "track2")]
8902    pub track_2: String,
8903    /// The primary account number. We recommend using the terminal or e-commerce
8904/// tokenization libraries instead of passing account numbers in directly, as this would
8905/// put your application in PCI scope.
8906    #[serde(rename = "pan")]
8907    pub pan: String,
8908    /// The ACH routing number for ACH transactions.
8909    #[serde(rename = "routingNumber")]
8910    pub routing_number: String,
8911    /// The cardholder name. Only required if the request includes a primary account number or
8912/// track data.
8913    #[serde(rename = "cardholderName")]
8914    pub cardholder_name: String,
8915    /// The card expiration month for use with PAN based transactions.
8916    #[serde(rename = "expMonth")]
8917    pub exp_month: String,
8918    /// The card expiration year for use with PAN based transactions.
8919    #[serde(rename = "expYear")]
8920    pub exp_year: String,
8921    /// The card CVV for use with PAN based transactions.
8922    #[serde(rename = "cvv")]
8923    pub cvv: String,
8924    /// The cardholder address for use with address verification.
8925    #[serde(rename = "address")]
8926    pub address: String,
8927    /// The cardholder postal code for use with address verification.
8928    #[serde(rename = "postalCode")]
8929    pub postal_code: String,
8930    /// The cardholder country.
8931    #[serde(rename = "country")]
8932    pub country: String,
8933    /// That the payment entry method is a manual keyed transaction. If this is true, no other
8934/// payment method will be accepted.
8935    #[serde(rename = "manualEntry")]
8936    pub manual_entry: bool,
8937    /// The key serial number used for DUKPT encryption.
8938    #[serde(rename = "ksn")]
8939    pub ksn: String,
8940    /// The encrypted pin block.
8941    #[serde(rename = "pinBlock")]
8942    pub pin_block: String,
8943    /// Designates categories of cards: credit, debit, EBT.
8944    #[serde(rename = "cardType")]
8945    pub card_type: CardType,
8946    /// Designates brands of payment methods: Visa, Discover, etc.
8947    #[serde(rename = "paymentType")]
8948    pub payment_type: String,
8949
8950}
8951
8952/// Request details about tender amounts.
8953#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8954pub struct RequestAmount {
8955    /// The transaction currency code.
8956    #[serde(rename = "currencyCode")]
8957    pub currency_code: String,
8958    /// The requested amount.
8959    #[serde(rename = "amount")]
8960    pub amount: String,
8961    /// That the request is tax exempt. Only required for tax exempt level 2 processing.
8962    #[serde(rename = "taxExempt")]
8963    pub tax_exempt: bool,
8964    /// A flag to add a surcharge to the transaction to cover credit card fees, if permitted.
8965    #[serde(rename = "surcharge")]
8966    pub surcharge: bool,
8967    /// A flag that applies a discount to negate the surcharge for debit transactions or other
8968/// surcharge ineligible payment methods.
8969    #[serde(rename = "cashDiscount")]
8970    pub cash_discount: bool,
8971
8972}
8973
8974/// Request subtotals.
8975#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8976pub struct Subtotals {
8977    /// The tip amount.
8978    #[serde(rename = "tipAmount")]
8979    pub tip_amount: String,
8980    /// The tax amount.
8981    #[serde(rename = "taxAmount")]
8982    pub tax_amount: String,
8983
8984}
8985
8986/// A reference to a previous transaction.
8987#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8988pub struct PreviousTransaction {
8989    /// The ID of the previous transaction being referenced.
8990    #[serde(rename = "transactionId")]
8991    pub transaction_id: String,
8992
8993}
8994
8995/// Core response fields for a transaction.
8996#[derive(Debug, Default, Clone, Serialize, Deserialize)]
8997pub struct CoreResponse {
8998    /// The ID assigned to the transaction.
8999    #[serde(rename = "transactionId")]
9000    pub transaction_id: String,
9001    /// The ID assigned to the batch.
9002    #[serde(rename = "batchId")]
9003    pub batch_id: String,
9004    /// The transaction reference string assigned to the transaction request. If no
9005/// transaction ref was assiged on the request, then the gateway will randomly generate
9006/// one.
9007    #[serde(rename = "transactionRef")]
9008    pub transaction_ref: String,
9009    /// The type of transaction.
9010    #[serde(rename = "transactionType")]
9011    pub transaction_type: String,
9012    /// The timestamp of the transaction.
9013    #[serde(rename = "timestamp")]
9014    pub timestamp: String,
9015    /// The hash of the last tick block.
9016    #[serde(rename = "tickBlock")]
9017    pub tick_block: String,
9018    /// That the transaction was processed on the test gateway.
9019    #[serde(rename = "test")]
9020    pub test: bool,
9021    /// The settlement account for merchants with split settlements.
9022    #[serde(rename = "destinationAccount")]
9023    pub destination_account: String,
9024    /// The ECC signature of the response. Can be used to ensure that it was signed by the
9025/// terminal and detect man-in-the middle attacks.
9026    #[serde(rename = "sig")]
9027    pub sig: String,
9028
9029}
9030
9031pub fn clear_field<T>(data: T, field: &str) -> Result<T, Box<dyn std::error::Error>>
9032where 
9033   T: Serialize + DeserializeOwned + Clone,
9034{
9035   let mut json_value = serde_json::to_value(&data)?;
9036
9037   if let Value::Object(ref mut map) = json_value {
9038      map.remove(field);
9039   }
9040
9041   Ok(serde_json::from_value(json_value)?)
9042}
9043
9044pub fn to_signature_request<T: Serialize>(request: &T) -> Result<SignatureRequest, Box<dyn std::error::Error>> {
9045    let request_json = serde_json::to_value(request)?;
9046    match serde_json::from_value::<SignatureRequest>(request_json) {
9047        Ok(signature_request) => Ok(signature_request),
9048        Err(err) => Err(Box::new(err)),
9049    }
9050}
9051
9052pub fn to_signature_response<T: Serialize>(response: &T) -> Result<SignatureResponse, Box<dyn std::error::Error>> {
9053    let response_json = serde_json::to_value(response)?;
9054    match serde_json::from_value::<SignatureResponse>(response_json) {
9055        Ok(signature_response) => Ok(signature_response),
9056        Err(err) => Err(Box::new(err)),
9057    }
9058}
9059
9060pub fn copy_from_signature_request<T, R>(from: &T, to: &mut R) -> Result<Option<R>, Box<dyn std::error::Error>>
9061where
9062    T: Serialize,
9063    R: DeserializeOwned + Serialize + Clone,
9064{
9065   let from_json = serde_json::to_value(from)?;
9066   let to_json = serde_json::to_value(to)?;
9067   let mut from_map = from_json.as_object().ok_or("Failed to convert from to object")?.clone();
9068   let mut to_map = to_json.as_object().ok_or("Failed to convert to to object")?.clone();
9069   let mut ok = false;
9070
9071   for (key, value) in from_map.iter_mut() {
9072      if let Some(to_field) = to_map.get_mut(key) {
9073         *to_field = value.clone();
9074         ok = true;
9075      }
9076   }
9077
9078   if ok {
9079      Ok(serde_json::from_value(to_json)?)
9080   } else {
9081      Ok(None)
9082   }
9083}