1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Hanzo Cloud API
*
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PaymentIn {
/// AmountCents is the amount to charge, in whole cents (5000 is $50.00). Server-side bounds apply and are authoritative — the default floor is $1 and the ceiling $5,000, so a fat-fingered or hostile amount is refused before any money moves.
#[serde(rename = "amountCents", skip_serializing_if = "Option::is_none")]
pub amount_cents: Option<i32>,
/// Currency is the ISO 4217 code, lower-cased. Empty means usd.
#[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
pub currency: Option<String>,
/// IdempotencyKey makes a retry safe: the same key never charges twice, it replays the first result. Sending one is strongly recommended for an agent, which retries by construction. Empty falls back to a windowed key derived from the amount and currency, so a double-submit inside 15 minutes still collapses onto one charge.
#[serde(rename = "idempotencyKey", skip_serializing_if = "Option::is_none")]
pub idempotency_key: Option<String>,
/// SourceID is the single-use payment token that stands in for the card: a Square Web Payments SDK nonce minted in the browser, or a Square sandbox test nonce when the org's credentials are sandbox ones. The card number itself never reaches this process, which is what keeps it out of PCI scope.
#[serde(rename = "sourceId", skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
}
impl PaymentIn {
pub fn new() -> PaymentIn {
PaymentIn {
amount_cents: None,
currency: None,
idempotency_key: None,
source_id: None,
}
}
}