58 lines
2.8 KiB
Rust
58 lines
2.8 KiB
Rust
|
/*
|
|||
|
* Tpay.com Technical Documentation
|
|||
|
*
|
|||
|
* <p class=\"changes-disclaimer\"> Demo transaction/masspayments api key: <input type=\"text\" id=\"transaction_key\" value=\"75f86137a6635df826e3efe2e66f7c9a946fdde1\" class=\"ui-form-control\"/><label for=\"transaction_key\" style=\"display: none;\" id=\"tr_api_label\">COPIED!</label><br/><br/> Demo cards api key: <input type=\"text\" id=\"cards_key\" value=\"bda5eda723bf1ae71a82e90a249803d3f852248d\" class=\"ui-form-control\"/><label for=\"cards_key\" style=\"display: none;\" id=\"cards_api_label\">COPIED!</label><br/><br/> The terms seller and merchant are used interchangeably and they both refer to a person or a company registered at tpay.com to accept online payments. <br/> Whenever term merchant panel is used it refers to the part of tpay.com website located at <a href=\"https://secure.tpay.com/panel\" target=\"_blank\">secure.tpay.com/panel</a>. <br/><br/> For sandbox purposes use merchant demo account <br/><br/> ID - 1010, Password - demo<br/><br/>Remember that this is a shared account, so all data passed through will be publicly visible.</p>
|
|||
|
*
|
|||
|
* The version of the OpenAPI document: 1.2.1
|
|||
|
* Contact: pt@tpay.com
|
|||
|
* Generated by: https://openapi-generator.tech
|
|||
|
*/
|
|||
|
|
|||
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|||
|
pub struct PresaleFields {
|
|||
|
/// transaction description
|
|||
|
#[serde(rename = "desc")]
|
|||
|
pub desc: String,
|
|||
|
/// Client token
|
|||
|
#[serde(rename = "cli_auth")]
|
|||
|
pub cli_auth: String,
|
|||
|
/// transaction amount casted to float
|
|||
|
#[serde(rename = "amount")]
|
|||
|
pub amount: f32,
|
|||
|
/// API password.
|
|||
|
#[serde(rename = "api_password")]
|
|||
|
pub api_password: String,
|
|||
|
/// Sign is calculated from cryptographic hash function set in Merchant’s Panel (default SHA-1): hash_alg (method + cli_auth + desc + amount + currency + order_id + language + verification code) where + means concatenation with ampersand symbol. ie. amount + currency = 10.99&985
|
|||
|
#[serde(rename = "sign")]
|
|||
|
pub sign: String,
|
|||
|
/// transaction currency in ISO numeric format
|
|||
|
#[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
|
|||
|
pub currency: Option<i32>,
|
|||
|
/// merchant order ID used to recognise payment
|
|||
|
#[serde(rename = "order_id", skip_serializing_if = "Option::is_none")]
|
|||
|
pub order_id: Option<String>,
|
|||
|
#[serde(rename = "language", skip_serializing_if = "Option::is_none")]
|
|||
|
pub language: Option<crate::models::Language>,
|
|||
|
}
|
|||
|
|
|||
|
impl PresaleFields {
|
|||
|
pub fn new(
|
|||
|
desc: String,
|
|||
|
cli_auth: String,
|
|||
|
amount: f32,
|
|||
|
api_password: String,
|
|||
|
sign: String,
|
|||
|
) -> PresaleFields {
|
|||
|
PresaleFields {
|
|||
|
desc,
|
|||
|
cli_auth,
|
|||
|
amount,
|
|||
|
api_password,
|
|||
|
sign,
|
|||
|
currency: None,
|
|||
|
order_id: None,
|
|||
|
language: None,
|
|||
|
}
|
|||
|
}
|
|||
|
}
|