Test orders, add missing field in order

This commit is contained in:
Adrian Woźniak 2022-06-08 15:22:43 +02:00
parent c4939f7581
commit 4bc914b6df
No known key found for this signature in database
GPG Key ID: 0012845A89C7352B
127 changed files with 5905 additions and 64 deletions

3
.env
View File

@ -17,6 +17,9 @@ PAYU_CLIENT_ID="145227"
PAYU_CLIENT_SECRET="12f071174cb7eb79d4aac5bc2f07563f" PAYU_CLIENT_SECRET="12f071174cb7eb79d4aac5bc2f07563f"
PAYU_CLIENT_MERCHANT_ID=300746 PAYU_CLIENT_MERCHANT_ID=300746
TPAY_TRANSACTION_API_KEY=75f86137a6635df826e3efe2e66f7c9a946fdde1
TPAY_CARDS_API_KEY=bda5eda723bf1ae71a82e90a249803d3f852248d
#WEB_HOST=https://bazzar.ita-prog.pl #WEB_HOST=https://bazzar.ita-prog.pl
WEB_HOST=0.0.0.0 WEB_HOST=0.0.0.0

12
Cargo.lock generated
View File

@ -2703,6 +2703,17 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "openapi"
version = "1.0.0"
dependencies = [
"reqwest",
"serde",
"serde_derive",
"serde_json",
"url",
]
[[package]] [[package]]
name = "openssl" name = "openssl"
version = "0.10.40" version = "0.10.40"
@ -3300,6 +3311,7 @@ dependencies = [
"lazy_static", "lazy_static",
"log", "log",
"mime", "mime",
"mime_guess",
"native-tls", "native-tls",
"percent-encoding", "percent-encoding",
"pin-project-lite", "pin-project-lite",

View File

@ -20,6 +20,8 @@ members = [
"db-seed", "db-seed",
"api", "api",
"web", "web",
# vendor
"vendor/t_pay",
] ]
[profile.release] [profile.release]

View File

@ -2,10 +2,12 @@ use crate::{db_async_handler, Result};
#[derive(Debug, Copy, Clone, PartialEq, serde::Serialize, thiserror::Error)] #[derive(Debug, Copy, Clone, PartialEq, serde::Serialize, thiserror::Error)]
pub enum Error { pub enum Error {
#[error("Can't load account addresses")] #[error("Can't load order addresses")]
OrderAddress, OrderAddress,
#[error("Failed to save account address")] #[error("Failed to save order address")]
CreateOrderAddress, CreateOrderAddress,
#[error("Failed to change order address")]
UpdateOrderAddress,
} }
#[derive(actix::Message)] #[derive(actix::Message)]
@ -35,6 +37,7 @@ SELECT
order_addresses.city, order_addresses.city,
order_addresses.country, order_addresses.country,
order_addresses.zip order_addresses.zip
order_addresses.phone
FROM order_addresses FROM order_addresses
INNER JOIN orders ON orders.address_id = order_addresses.id INNER JOIN orders ON orders.address_id = order_addresses.id
WHERE orders.id = $1 WHERE orders.id = $1
@ -55,6 +58,7 @@ pub struct CreateOrderAddress {
pub city: model::City, pub city: model::City,
pub country: model::Country, pub country: model::Country,
pub zip: model::Zip, pub zip: model::Zip,
pub phone: model::Phone,
} }
db_async_handler!( db_async_handler!(
@ -70,9 +74,9 @@ pub(crate) async fn create_order_address(
) -> Result<model::OrderAddress> { ) -> Result<model::OrderAddress> {
sqlx::query_as( sqlx::query_as(
r#" r#"
INSERT INTO order_addresses ( name, email, street, city, country, zip ) INSERT INTO order_addresses ( name, email, street, city, country, zip, phone )
VALUES ($1, $2, $3, $4, $5, $6) VALUES ($1, $2, $3, $4, $5, $6, $7)
RETURNING id, name, email, street, city, country, zip RETURNING id, name, email, street, city, country, zip, phone
"#, "#,
) )
.bind(msg.name) .bind(msg.name)
@ -81,9 +85,14 @@ RETURNING id, name, email, street, city, country, zip
.bind(msg.city) .bind(msg.city)
.bind(msg.country) .bind(msg.country)
.bind(msg.zip) .bind(msg.zip)
.bind(msg.phone)
.fetch_one(pool) .fetch_one(pool)
.await .await
.map_err(|_| Error::CreateOrderAddress.into()) .map_err(|e| {
tracing::error!("{}", e);
dbg!(e);
Error::CreateOrderAddress.into()
})
} }
#[derive(actix::Message)] #[derive(actix::Message)]
@ -96,25 +105,26 @@ pub struct UpdateOrderAddress {
pub city: model::City, pub city: model::City,
pub country: model::Country, pub country: model::Country,
pub zip: model::Zip, pub zip: model::Zip,
pub phone: model::Phone,
} }
db_async_handler!( db_async_handler!(
UpdateOrderAddress, UpdateOrderAddress,
update_account_address, update_order_address,
model::OrderAddress, model::OrderAddress,
inner_update_account_address inner_update_order_address
); );
pub(crate) async fn update_account_address( pub(crate) async fn update_order_address(
msg: UpdateOrderAddress, msg: UpdateOrderAddress,
pool: &mut sqlx::Transaction<'_, sqlx::Postgres>, pool: &mut sqlx::Transaction<'_, sqlx::Postgres>,
) -> Result<model::OrderAddress> { ) -> Result<model::OrderAddress> {
sqlx::query_as( sqlx::query_as(
r#" r#"
UPDATE order_addresses UPDATE order_addresses
SET name = $2, email = $3, street = $4, city = $5, country = $6, zip = $7 SET name = $2, email = $3, street = $4, city = $5, country = $6, zip = $7, phone = $8
WHERE id = $1 WHERE id = $1
RETURNING id, name, email, street, city, country, zip RETURNING id, name, email, street, city, country, zip, phone
"#, "#,
) )
.bind(msg.id) .bind(msg.id)
@ -124,9 +134,14 @@ RETURNING id, name, email, street, city, country, zip
.bind(msg.city) .bind(msg.city)
.bind(msg.country) .bind(msg.country)
.bind(msg.zip) .bind(msg.zip)
.bind(msg.phone)
.fetch_one(pool) .fetch_one(pool)
.await .await
.map_err(|_| Error::CreateOrderAddress.into()) .map_err(|e| {
tracing::error!("{}", e);
dbg!(e);
Error::UpdateOrderAddress.into()
})
} }
#[cfg(test)] #[cfg(test)]
@ -134,11 +149,92 @@ mod tests {
use config::UpdateConfig; use config::UpdateConfig;
use fake::Fake; use fake::Fake;
use model::*; use model::*;
use uuid::Uuid;
pub struct NoOpts; pub struct NoOpts;
impl UpdateConfig for NoOpts {} impl UpdateConfig for NoOpts {}
use crate::*; use crate::*;
async fn test_order_address(
t: &mut sqlx::Transaction<'_, sqlx::Postgres>,
) -> model::OrderAddress {
let name: String = fake::faker::name::en::Name().fake();
let email: String = fake::faker::internet::en::FreeEmail().fake();
let phone: String = fake::faker::phone_number::en::PhoneNumber().fake();
let street: String = fake::faker::address::en::StreetName().fake();
let city: String = fake::faker::address::en::CityName().fake();
let country: String = fake::faker::address::en::CountryName().fake();
let zip: String = fake::faker::address::en::ZipCode().fake();
super::create_order_address(
CreateOrderAddress {
name: Name::new(name),
email: Email::new(email),
street: Street::new(street),
city: City::new(city),
country: Country::new(country),
zip: Zip::new(zip),
phone: Phone::new(phone),
},
t,
)
.await
.unwrap()
}
#[actix::test]
async fn create() {
testx::db_t!(t);
test_order_address(&mut t).await;
testx::db_rollback!(t);
}
#[actix::test]
async fn update() {
testx::db_t!(t);
let original = test_order_address(&mut t).await;
let updated = super::update_order_address(
UpdateOrderAddress {
id: original.id,
name: Default::default(),
email: Default::default(),
street: Default::default(),
city: Default::default(),
country: Default::default(),
zip: Default::default(),
phone: Default::default(),
},
&mut t,
)
.await
.unwrap();
testx::db_rollback!(t);
assert_ne!(updated, original);
assert_eq!(
updated,
model::OrderAddress {
id: original.id,
name: Default::default(),
email: Default::default(),
street: Default::default(),
city: Default::default(),
country: Default::default(),
zip: Default::default(),
phone: Default::default()
}
);
}
async fn order_address() {
testx::db_t!(t);
test_order_address(&mut t).await;
testx::db_rollback!(t);
}
} }

View File

@ -1,7 +1,6 @@
#[cfg(feature = "dummy")] #[cfg(feature = "dummy")]
use fake::Fake; use fake::Fake;
use model::*; use model::*;
use sqlx::PgPool;
use super::Result; use super::Result;
use crate::db_async_handler; use crate::db_async_handler;
@ -24,9 +23,17 @@ pub enum Error {
#[rtype(result = "Result<Vec<OrderItem>>")] #[rtype(result = "Result<Vec<OrderItem>>")]
pub struct AllOrderItems; pub struct AllOrderItems;
db_async_handler!(AllOrderItems, all_order_items, Vec<OrderItem>); db_async_handler!(
AllOrderItems,
all_order_items,
Vec<OrderItem>,
inner_all_order_items
);
pub(crate) async fn all_order_items(_msg: AllOrderItems, pool: PgPool) -> Result<Vec<OrderItem>> { pub(crate) async fn all_order_items(
_msg: AllOrderItems,
t: &mut sqlx::Transaction<'_, sqlx::Postgres>,
) -> Result<Vec<OrderItem>> {
sqlx::query_as( sqlx::query_as(
r#" r#"
SELECT id, product_id, order_id, quantity, quantity_unit SELECT id, product_id, order_id, quantity, quantity_unit
@ -34,7 +41,7 @@ FROM order_items
ORDER BY id DESC ORDER BY id DESC
"#, "#,
) )
.fetch_all(&pool) .fetch_all(t)
.await .await
.map_err(|e| { .map_err(|e| {
tracing::error!("{e:?}"); tracing::error!("{e:?}");
@ -52,16 +59,17 @@ pub struct CreateOrderItem {
pub quantity_unit: QuantityUnit, pub quantity_unit: QuantityUnit,
} }
db_async_handler!(CreateOrderItem, inner_create_order_item, OrderItem); db_async_handler!(
CreateOrderItem,
create_order_item,
OrderItem,
inner_create_order_item
);
async fn inner_create_order_item(msg: CreateOrderItem, db: PgPool) -> Result<OrderItem> { pub(crate) async fn create_order_item(
create_order_item(msg, &db).await msg: CreateOrderItem,
} t: &mut sqlx::Transaction<'_, sqlx::Postgres>,
) -> Result<OrderItem> {
pub(crate) async fn create_order_item<'e, E>(msg: CreateOrderItem, db: E) -> Result<OrderItem>
where
E: sqlx::Executor<'e, Database = sqlx::Postgres>,
{
sqlx::query_as( sqlx::query_as(
r#" r#"
INSERT INTO order_items (product_id, order_id, quantity, quantity_unit) INSERT INTO order_items (product_id, order_id, quantity, quantity_unit)
@ -73,10 +81,11 @@ RETURNING id, product_id, order_id, quantity, quantity_unit
.bind(msg.order_id) .bind(msg.order_id)
.bind(msg.quantity) .bind(msg.quantity)
.bind(msg.quantity_unit) .bind(msg.quantity_unit)
.fetch_one(db) .fetch_one(t)
.await .await
.map_err(|e| { .map_err(|e| {
tracing::error!("{e:?}"); tracing::error!("{e:?}");
dbg!(e);
super::Error::OrderItem(Error::CantCreate) super::Error::OrderItem(Error::CantCreate)
}) })
} }
@ -87,9 +96,12 @@ pub struct FindOrderItem {
pub id: OrderItemId, pub id: OrderItemId,
} }
db_async_handler!(FindOrderItem, find_order_item, OrderItem); db_async_handler!(FindOrderItem, find_order_item, OrderItem, inner_find_order);
pub(crate) async fn find_order_item(msg: FindOrderItem, db: PgPool) -> Result<OrderItem> { pub(crate) async fn find_order_item(
msg: FindOrderItem,
t: &mut sqlx::Transaction<'_, sqlx::Postgres>,
) -> Result<OrderItem> {
sqlx::query_as( sqlx::query_as(
r#" r#"
SELECT id, product_id, order_id, quantity, quantity_unit SELECT id, product_id, order_id, quantity, quantity_unit
@ -98,7 +110,7 @@ WHERE id = $1
"#, "#,
) )
.bind(msg.id) .bind(msg.id)
.fetch_one(&db) .fetch_one(t)
.await .await
.map_err(|e| { .map_err(|e| {
tracing::error!("{e:?}"); tracing::error!("{e:?}");
@ -112,9 +124,12 @@ pub struct OrderItems {
pub order_id: OrderId, pub order_id: OrderId,
} }
db_async_handler!(OrderItems, order_items, Vec<OrderItem>); db_async_handler!(OrderItems, order_items, Vec<OrderItem>, inner_order_items);
pub(crate) async fn order_items(msg: OrderItems, pool: PgPool) -> Result<Vec<OrderItem>> { pub(crate) async fn order_items(
msg: OrderItems,
t: &mut sqlx::Transaction<'_, sqlx::Postgres>,
) -> Result<Vec<OrderItem>> {
sqlx::query_as( sqlx::query_as(
r#" r#"
SELECT id, product_id, order_id, quantity, quantity_unit SELECT id, product_id, order_id, quantity, quantity_unit
@ -124,10 +139,191 @@ ORDER BY id DESC
"#, "#,
) )
.bind(msg.order_id) .bind(msg.order_id)
.fetch_all(&pool) .fetch_all(t)
.await .await
.map_err(|e| { .map_err(|e| {
tracing::error!("{e:?}"); tracing::error!("{e:?}");
Error::OrderItems.into() Error::OrderItems.into()
}) })
} }
#[cfg(test)]
mod tests {
use config::UpdateConfig;
use fake::Fake;
use model::*;
use uuid::Uuid;
pub struct NoOpts;
impl UpdateConfig for NoOpts {}
use crate::*;
async fn test_order_address(
t: &mut sqlx::Transaction<'_, sqlx::Postgres>,
) -> model::OrderAddress {
use fake::faker::address::en;
let zip: String = en::ZipCode().fake();
create_order_address(
CreateOrderAddress {
name: Default::default(),
email: Default::default(),
street: Default::default(),
city: Default::default(),
country: Default::default(),
zip: Zip::new(zip),
phone: Default::default(),
},
t,
)
.await
.unwrap()
}
async fn test_account(t: &mut sqlx::Transaction<'_, sqlx::Postgres>) -> FullAccount {
use fake::faker::internet::en;
let login: String = en::Username().fake();
let email: String = en::FreeEmail().fake();
let hash: String = en::Password(11..20).fake();
create_account(
CreateAccount {
email: Email::new(email),
login: Login::new(login),
pass_hash: PassHash::new(hash),
role: Role::Admin,
},
t,
)
.await
.unwrap()
}
async fn test_shopping_cart(
t: &mut sqlx::Transaction<'_, sqlx::Postgres>,
buyer_id: AccountId,
) -> ShoppingCart {
let cart = create_shopping_cart(
CreateShoppingCart {
buyer_id,
payment_method: PaymentMethod::PaymentOnTheSpot,
},
&mut *t,
)
.await
.unwrap();
update_shopping_cart(
UpdateShoppingCart {
id: cart.id,
buyer_id: cart.buyer_id,
payment_method: cart.payment_method,
state: ShoppingCartState::Active,
checkout_notes: None,
},
&mut *t,
)
.await
.unwrap()
}
async fn test_order(t: &mut sqlx::Transaction<'_, sqlx::Postgres>) -> Order {
let buyer_id = test_account(t).await.id;
crate::create_order(
CreateOrder {
buyer_id,
items: vec![],
shopping_cart_id: Some(test_shopping_cart(t, buyer_id).await.id),
checkout_notes: None,
delivery_address_id: test_order_address(t).await.id,
},
t,
)
.await
.unwrap()
}
async fn test_product(t: &mut sqlx::Transaction<'_, sqlx::Postgres>) -> Product {
crate::create_product(
CreateProduct {
name: ProductName::new(format!("{}", Uuid::new_v4())),
short_description: ProductShortDesc::new(format!("{}", Uuid::new_v4())),
long_description: ProductLongDesc::new(format!("{}", Uuid::new_v4())),
category: None,
price: Price::from_u32(4688),
deliver_days_flag: Day::Friday | Day::Saturday | Day::Sunday,
},
t,
)
.await
.unwrap()
}
async fn test_order_item(
t: &mut sqlx::Transaction<'_, sqlx::Postgres>,
order_id: Option<OrderId>,
) -> OrderItem {
let order_id = match order_id {
Some(id) => id,
_ => test_order(&mut *t).await.id,
};
let product_id = test_product(&mut *t).await.id;
super::create_order_item(
CreateOrderItem {
product_id,
order_id,
quantity: Default::default(),
quantity_unit: QuantityUnit::Gram,
},
t,
)
.await
.unwrap()
}
#[actix::test]
async fn create() {
testx::db_t!(t);
test_order_item(&mut t, None).await;
testx::db_rollback!(t);
}
#[actix::test]
async fn order_items() {
testx::db_t!(t);
let order1 = test_order(&mut t).await;
test_order_item(&mut t, Some(order1.id)).await;
test_order_item(&mut t, Some(order1.id)).await;
test_order_item(&mut t, Some(order1.id)).await;
let mut expected = vec![];
let order2 = test_order(&mut t).await;
let item1 = test_order_item(&mut t, Some(order2.id)).await;
let item2 = test_order_item(&mut t, Some(order2.id)).await;
let item3 = test_order_item(&mut t, Some(order2.id)).await;
expected.push(item3);
expected.push(item2);
expected.push(item1);
let order3 = test_order(&mut t).await;
test_order_item(&mut t, Some(order3.id)).await;
test_order_item(&mut t, Some(order3.id)).await;
test_order_item(&mut t, Some(order3.id)).await;
let loaded = super::order_items(
OrderItems {
order_id: order2.id,
},
&mut t,
)
.await;
testx::db_rollback!(t);
assert_eq!(loaded, Ok(expected));
}
}

View File

@ -188,7 +188,7 @@ pub(crate) async fn update_order_by_ext(
r#" r#"
UPDATE orders UPDATE orders
SET status = $2 SET status = $2
WHERE order_ext_id = $1 WHERE order_ext_id = $1 :: UUID
RETURNING id, buyer_id, status, order_ext_id, service_order_id, checkout_notes, address_id RETURNING id, buyer_id, status, order_ext_id, service_order_id, checkout_notes, address_id
"#, "#,
) )
@ -198,6 +198,7 @@ RETURNING id, buyer_id, status, order_ext_id, service_order_id, checkout_notes,
.await .await
.map_err(|e| { .map_err(|e| {
tracing::error!("{e:?}"); tracing::error!("{e:?}");
dbg!(e);
super::Error::AccountOrder(Error::CantCreate) super::Error::AccountOrder(Error::CantCreate)
}) })
} }
@ -295,6 +296,7 @@ mod tests {
city: Default::default(), city: Default::default(),
country: Default::default(), country: Default::default(),
zip: Default::default(), zip: Default::default(),
phone: Default::default(),
}, },
t, t,
) )
@ -305,7 +307,7 @@ mod tests {
async fn test_product(t: &mut sqlx::Transaction<'_, sqlx::Postgres>) -> Product { async fn test_product(t: &mut sqlx::Transaction<'_, sqlx::Postgres>) -> Product {
create_product( create_product(
CreateProduct { CreateProduct {
name: ProductName::new(format!("{}", Uuid::new_v4())), name: ProductName::new(format!("a{}", Uuid::new_v4())),
short_description: ProductShortDesc::new(format!("{}", Uuid::new_v4())), short_description: ProductShortDesc::new(format!("{}", Uuid::new_v4())),
long_description: ProductLongDesc::new(format!("{}", Uuid::new_v4())), long_description: ProductLongDesc::new(format!("{}", Uuid::new_v4())),
category: None, category: None,
@ -328,13 +330,7 @@ mod tests {
_ => test_account(&mut *t).await.id, _ => test_account(&mut *t).await.id,
}; };
sqlx::query( sqlx::query(r#" UPDATE shopping_carts SET state = 'closed' WHERE buyer_id = $1 "#)
r#"
UPDATE shopping_carts
SET state = 'closed'
WHERE buyer_id = $1
"#,
)
.bind(buyer_id) .bind(buyer_id)
.execute(&mut *t) .execute(&mut *t)
.await .await
@ -511,4 +507,38 @@ WHERE buyer_id = $1
.unwrap(); .unwrap();
testx::db_rollback!(t); testx::db_rollback!(t);
} }
#[actix::test]
async fn update_by_ext() {
testx::db_t!(t);
let address_id = test_order_address(&mut t).await.id;
let original = test_empty_order_without_cart(&mut t, None, address_id).await;
let updated = super::update_order_by_ext(
UpdateOrderByExt {
order_ext_id: original.order_ext_id.clone().to_string(),
status: OrderStatus::Payed,
},
&mut t,
)
.await
.unwrap();
testx::db_rollback!(t);
assert_ne!(updated, original);
assert_eq!(
updated,
Order {
id: original.id,
buyer_id: original.buyer_id,
status: OrderStatus::Payed,
order_ext_id: original.order_ext_id,
service_order_id: None,
checkout_notes: None,
address_id: original.address_id
}
);
}
} }

View File

@ -159,11 +159,11 @@ where
sqlx::query_as( sqlx::query_as(
r#" r#"
UPDATE products UPDATE products
SET name = $2 AND SET name = $2,
short_description = $3 AND short_description = $3,
long_description = $4 AND long_description = $4,
category = $5 AND category = $5,
price = $6 AND price = $6,
deliver_days_flag = $7 deliver_days_flag = $7
WHERE id = $1 WHERE id = $1
RETURNING id, RETURNING id,
@ -186,6 +186,7 @@ RETURNING id,
.await .await
.map_err(|e| { .map_err(|e| {
tracing::error!("{e:?}"); tracing::error!("{e:?}");
dbg!(e);
crate::Error::Product(Error::Update) crate::Error::Product(Error::Update)
}) })
} }
@ -276,7 +277,7 @@ ORDER BY products.id
#[derive(Message)] #[derive(Message)]
#[rtype(result = "Result<Vec<model::Product>>")] #[rtype(result = "Result<Vec<model::Product>>")]
pub struct FindProducts { pub struct FindProducts {
pub product_ids: Vec<model::ProductId>, pub product_ids: Vec<ProductId>,
} }
crate::db_async_handler!( crate::db_async_handler!(
@ -289,7 +290,7 @@ crate::db_async_handler!(
pub(crate) async fn find_products( pub(crate) async fn find_products(
msg: FindProducts, msg: FindProducts,
pool: &mut sqlx::Transaction<'_, sqlx::Postgres>, pool: &mut sqlx::Transaction<'_, sqlx::Postgres>,
) -> Result<Vec<model::Product>> { ) -> Result<Vec<Product>> {
MultiLoad::new( MultiLoad::new(
pool, pool,
r#" r#"
@ -358,7 +359,7 @@ mod tests {
} }
#[actix::test] #[actix::test]
async fn create_product() { async fn create() {
testx::db_t!(t); testx::db_t!(t);
test_product(&mut t, None, None, None, None, None, None).await; test_product(&mut t, None, None, None, None, None, None).await;
@ -397,4 +398,49 @@ mod tests {
assert_eq!(product, p2); assert_eq!(product, p2);
assert_ne!(product, p3); assert_ne!(product, p3);
} }
#[actix::test]
async fn update() {
testx::db_t!(t);
let original = test_product(&mut t, None, None, None, None, None, None).await;
let updated = update_product(
UpdateProduct {
id: original.id,
name: ProductName::new("a9s0dja0sjd0jas09dj"),
short_description: ProductShortDesc::new("ajs9d8ua9sdu9ahsd98has"),
long_description: ProductLongDesc::new("hja89sdy9yha9sdy98ayusd9hya9sy8dh"),
category: None,
price: Price::from_u32(823794),
deliver_days_flag: Day::Tuesday | Day::Saturday,
},
&mut t,
)
.await
.unwrap();
let reloaded = find_product(
FindProduct {
product_id: original.id,
},
&mut t,
)
.await
.unwrap();
testx::db_rollback!(t);
assert_ne!(updated, original);
assert_eq!(updated, reloaded);
assert_eq!(
updated,
Product {
id: original.id,
name: ProductName::new("a9s0dja0sjd0jas09dj"),
short_description: ProductShortDesc::new("ajs9d8ua9sdu9ahsd98has"),
long_description: ProductLongDesc::new("hja89sdy9yha9sdy98ayusd9hya9sy8dh"),
category: None,
price: Price::from_u32(823794),
deliver_days_flag: Day::Tuesday | Day::Saturday,
}
);
}
} }

View File

@ -172,6 +172,7 @@ pub(crate) async fn create_account_order(
city: address.city, city: address.city,
country: address.country, country: address.country,
zip: address.zip, zip: address.zip,
phone: address.phone,
}, },
Error::InvalidOrderAddress Error::InvalidOrderAddress
); );

View File

@ -1,3 +1,6 @@
mod pay_u_adapter;
mod t_pay_adapter;
use std::collections::HashMap; use std::collections::HashMap;
use std::sync::Arc; use std::sync::Arc;

View File

@ -0,0 +1,2 @@
ALTER TABLE order_addresses
ADD COLUMN phone TEXT NOT NULL;

View File

@ -8,6 +8,7 @@ pub mod encrypt;
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
use std::ops; use std::ops;
use std::ops::BitOr;
use std::str::FromStr; use std::str::FromStr;
use derive_more::{Deref, DerefMut, Display, From}; use derive_more::{Deref, DerefMut, Display, From};
@ -126,7 +127,7 @@ pub const CATEGORIES: [Category; 9] = [
#[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))] #[cfg_attr(feature = "db", sqlx(rename_all = "snake_case"))]
#[derive(Copy, Clone, Debug, Hash, Display, Deserialize, Serialize)] #[derive(Copy, Clone, Debug, Hash, PartialEq, Display, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
pub enum OrderStatus { pub enum OrderStatus {
#[display(fmt = "Potwierdzone")] #[display(fmt = "Potwierdzone")]
@ -540,7 +541,7 @@ impl<'de> serde::Deserialize<'de> for NonNegative {
)] )]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
pub enum Day { pub enum Day {
Monday = 1 << 0, Monday = 1,
Tuesday = 1 << 1, Tuesday = 1 << 1,
Wednesday = 1 << 2, Wednesday = 1 << 2,
Thursday = 1 << 3, Thursday = 1 << 3,
@ -574,6 +575,14 @@ impl Day {
} }
} }
impl BitOr for Day {
type Output = Days;
fn bitor(self, rhs: Self) -> Self::Output {
Days(vec![self, rhs])
}
}
impl TryFrom<i32> for Day { impl TryFrom<i32> for Day {
type Error = TransformError; type Error = TransformError;
@ -603,6 +612,15 @@ impl TryFrom<i32> for Day {
#[serde(transparent)] #[serde(transparent)]
pub struct Days(pub Vec<Day>); pub struct Days(pub Vec<Day>);
impl BitOr<Day> for Days {
type Output = Self;
fn bitor(mut self, rhs: Day) -> Self::Output {
self.0.push(rhs);
self
}
}
impl ops::Deref for Days { impl ops::Deref for Days {
type Target = Vec<Day>; type Target = Vec<Day>;
@ -620,7 +638,7 @@ where
&self, &self,
buf: &mut <sqlx::Postgres as ::sqlx::database::HasArguments<'q>>::ArgumentBuffer, buf: &mut <sqlx::Postgres as ::sqlx::database::HasArguments<'q>>::ArgumentBuffer,
) -> ::sqlx::encode::IsNull { ) -> ::sqlx::encode::IsNull {
let value = self.0.iter().fold(1, |memo, v| memo | *v as i32); let value = self.0.iter().fold(0, |memo, v| memo | *v as i32);
<i32 as ::sqlx::encode::Encode<sqlx::Postgres>>::encode_by_ref(&value, buf) <i32 as ::sqlx::encode::Encode<sqlx::Postgres>>::encode_by_ref(&value, buf)
} }
@ -883,27 +901,27 @@ pub struct Stock {
#[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Display, Deref)] #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Display, Deref)]
#[serde(transparent)] #[serde(transparent)]
pub struct OrderAddressId(RecordId); pub struct OrderAddressId(RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Display, Deref)] #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Display, Deref)]
#[serde(transparent)] #[serde(transparent)]
pub struct OrderId(RecordId); pub struct OrderId(RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Display, Deref)] #[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Display, Deref)]
#[serde(transparent)] #[serde(transparent)]
pub struct ExtOrderId(String); pub struct ExtOrderId(String);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Serialize, Deserialize)] #[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct Order { pub struct Order {
pub id: OrderId, pub id: OrderId,
pub buyer_id: AccountId, pub buyer_id: AccountId,
@ -950,12 +968,12 @@ impl From<Order> for PublicOrder {
#[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", derive(sqlx::Type))]
#[cfg_attr(feature = "db", sqlx(transparent))] #[cfg_attr(feature = "db", sqlx(transparent))]
#[derive(Serialize, Deserialize, Copy, Clone, Debug, Deref)] #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Deref)]
pub struct OrderItemId(pub RecordId); pub struct OrderItemId(pub RecordId);
#[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Serialize, Deserialize, Debug)] #[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderItem { pub struct OrderItem {
pub id: OrderItemId, pub id: OrderItemId,
pub product_id: ProductId, pub product_id: ProductId,
@ -1323,7 +1341,7 @@ pub struct AccountAddress {
#[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "db", derive(sqlx::FromRow))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))]
#[derive(Serialize, Deserialize, Debug)] #[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderAddress { pub struct OrderAddress {
pub id: OrderAddressId, pub id: OrderAddressId,
pub name: Name, pub name: Name,
@ -1332,4 +1350,5 @@ pub struct OrderAddress {
pub city: City, pub city: City,
pub country: Country, pub country: Country,
pub zip: Zip, pub zip: Zip,
pub phone: Phone,
} }

3
vendor/t_pay/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/target/
**/*.rs.bk
Cargo.lock

23
vendor/t_pay/.openapi-generator-ignore vendored Normal file
View File

@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

112
vendor/t_pay/.openapi-generator/FILES vendored Normal file
View File

@ -0,0 +1,112 @@
.gitignore
.openapi-generator-ignore
.travis.yml
Cargo.toml
README.md
docs/BlikAlias.md
docs/BlikAliasResponse.md
docs/BlikFields.md
docs/BlikResponse.md
docs/CardsAPIApi.md
docs/CardsErrCode.md
docs/ChargebackStatus.md
docs/CheckFields.md
docs/CheckResponse.md
docs/CreateFields.md
docs/CreateResponse.md
docs/DeregisterFields.md
docs/GetFields.md
docs/GetResponse.md
docs/Language.md
docs/MasspaymentAuthorizeFields.md
docs/MasspaymentAuthorizeResponse.md
docs/MasspaymentCreateFields.md
docs/MasspaymentCreateResponse.md
docs/MasspaymentErrCode.md
docs/MasspaymentErrDesc.md
docs/MasspaymentPacksFields.md
docs/MasspaymentPacksResponse.md
docs/MasspaymentTransfersFields.md
docs/MasspaymentTransfersResponse.md
docs/MasspaymentsApi.md
docs/Onetimer.md
docs/PacksObject.md
docs/PaymentAttempts.md
docs/PresaleFields.md
docs/RefundAnyFields.md
docs/RefundAnyResponse.md
docs/RefundFields.md
docs/RefundResponse.md
docs/RefundStatusResponse.md
docs/RefundTransactionFields.md
docs/RegisterSaleFields.md
docs/RegisterSaleResponse.md
docs/ReportFields.md
docs/ReportResponse.md
docs/Result.md
docs/SaleFields.md
docs/SaleResponse.md
docs/SecuresaleFields.md
docs/SecuresaleResponse.md
docs/TransactionAPIApi.md
docs/TransactionErrorCodes.md
docs/TransfersObject.md
docs/VcFinishFields.md
docs/VcPrepareFields.md
docs/VcPrepareResponse.md
git_push.sh
src/apis/cards_api_api.rs
src/apis/configuration.rs
src/apis/masspayments_api.rs
src/apis/mod.rs
src/apis/transaction_api_api.rs
src/lib.rs
src/models/blik_alias.rs
src/models/blik_alias_response.rs
src/models/blik_fields.rs
src/models/blik_response.rs
src/models/cards_err_code.rs
src/models/chargeback_status.rs
src/models/check_fields.rs
src/models/check_response.rs
src/models/create_fields.rs
src/models/create_response.rs
src/models/deregister_fields.rs
src/models/get_fields.rs
src/models/get_response.rs
src/models/language.rs
src/models/masspayment_authorize_fields.rs
src/models/masspayment_authorize_response.rs
src/models/masspayment_create_fields.rs
src/models/masspayment_create_response.rs
src/models/masspayment_err_code.rs
src/models/masspayment_err_desc.rs
src/models/masspayment_packs_fields.rs
src/models/masspayment_packs_response.rs
src/models/masspayment_transfers_fields.rs
src/models/masspayment_transfers_response.rs
src/models/mod.rs
src/models/onetimer.rs
src/models/packs_object.rs
src/models/payment_attempts.rs
src/models/presale_fields.rs
src/models/refund_any_fields.rs
src/models/refund_any_response.rs
src/models/refund_fields.rs
src/models/refund_response.rs
src/models/refund_status_response.rs
src/models/refund_transaction_fields.rs
src/models/register_sale_fields.rs
src/models/register_sale_response.rs
src/models/report_fields.rs
src/models/report_response.rs
src/models/result.rs
src/models/sale_fields.rs
src/models/sale_response.rs
src/models/securesale_fields.rs
src/models/securesale_response.rs
src/models/transaction_error_codes.rs
src/models/transfers_object.rs
src/models/vc_finish_fields.rs
src/models/vc_prepare_fields.rs
src/models/vc_prepare_response.rs

View File

@ -0,0 +1 @@
5.2.0-SNAPSHOT

1
vendor/t_pay/.travis.yml vendored Normal file
View File

@ -0,0 +1 @@
language: rust

17
vendor/t_pay/Cargo.toml vendored Normal file
View File

@ -0,0 +1,17 @@
[package]
name = "openapi"
version = "1.0.0"
authors = ["OpenAPI Generator team and contributors"]
edition = "2018"
[dependencies]
serde = "^1.0"
serde_derive = "^1.0"
serde_json = "^1.0"
url = "^2.2"
[dependencies.reqwest]
version = "^0.11"
default-features = false
features = ["json", "multipart"]
[dev-dependencies]

112
vendor/t_pay/README.md vendored Normal file
View File

@ -0,0 +1,112 @@
# Rust API client for openapi
<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>
## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client.
- API version: 1.2.1
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.RustClientCodegen
## Installation
Put the package under your project folder and add the following to `Cargo.toml` under `[dependencies]`:
```
openapi = { path = "./generated" }
```
## Documentation for API Endpoints
All URIs are relative to *https://docs.tpay.com/Proxy.php*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*CardsAPIApi* | [**api_cards_api_key_check_post**](docs/CardsAPIApi.md#api_cards_api_key_check_post) | **POST** /api/cards/{api_key}/check | check
*CardsAPIApi* | [**api_cards_api_key_deregister_post**](docs/CardsAPIApi.md#api_cards_api_key_deregister_post) | **POST** /api/cards/{api_key}/deregister | deregister
*CardsAPIApi* | [**api_cards_api_key_presale_post**](docs/CardsAPIApi.md#api_cards_api_key_presale_post) | **POST** /api/cards/{api_key}/presale | presale
*CardsAPIApi* | [**api_cards_api_key_refund_post**](docs/CardsAPIApi.md#api_cards_api_key_refund_post) | **POST** /api/cards/{api_key}/refund | refund
*CardsAPIApi* | [**api_cards_api_key_register_sale_post**](docs/CardsAPIApi.md#api_cards_api_key_register_sale_post) | **POST** /api/cards/{api_key}/register_sale | register sale
*CardsAPIApi* | [**api_cards_api_key_sale_post**](docs/CardsAPIApi.md#api_cards_api_key_sale_post) | **POST** /api/cards/{api_key}/sale | sale
*CardsAPIApi* | [**api_cards_api_key_securesale_post**](docs/CardsAPIApi.md#api_cards_api_key_securesale_post) | **POST** /api/cards/{api_key}/securesale | secure sale
*CardsAPIApi* | [**api_cards_api_key_visacheckout_finish_post**](docs/CardsAPIApi.md#api_cards_api_key_visacheckout_finish_post) | **POST** /api/cards/{api_key}/visacheckout_finish | visacheckout finish
*CardsAPIApi* | [**api_cards_api_key_visacheckout_prepare_post**](docs/CardsAPIApi.md#api_cards_api_key_visacheckout_prepare_post) | **POST** /api/cards/{api_key}/visacheckout_prepare | visacheckout prepare
*MasspaymentsApi* | [**api_gw_api_key_masspayment_authorize_post**](docs/MasspaymentsApi.md#api_gw_api_key_masspayment_authorize_post) | **POST** /api/gw/{api_key}/masspayment/authorize | authorize
*MasspaymentsApi* | [**api_gw_api_key_masspayment_create_post**](docs/MasspaymentsApi.md#api_gw_api_key_masspayment_create_post) | **POST** /api/gw/{api_key}/masspayment/create | create
*MasspaymentsApi* | [**api_gw_api_key_masspayment_packs_post**](docs/MasspaymentsApi.md#api_gw_api_key_masspayment_packs_post) | **POST** /api/gw/{api_key}/masspayment/packs | packs
*MasspaymentsApi* | [**api_gw_api_key_masspayment_transfers_post**](docs/MasspaymentsApi.md#api_gw_api_key_masspayment_transfers_post) | **POST** /api/gw/{api_key}/masspayment/transfers | transfers
*TransactionAPIApi* | [**api_gw_api_key_chargeback_any_post**](docs/TransactionAPIApi.md#api_gw_api_key_chargeback_any_post) | **POST** /api/gw/{api_key}/chargeback/any | any
*TransactionAPIApi* | [**api_gw_api_key_chargeback_status_post**](docs/TransactionAPIApi.md#api_gw_api_key_chargeback_status_post) | **POST** /api/gw/{api_key}/chargeback/status | status
*TransactionAPIApi* | [**api_gw_api_key_chargeback_transaction_post**](docs/TransactionAPIApi.md#api_gw_api_key_chargeback_transaction_post) | **POST** /api/gw/{api_key}/chargeback/transaction | transaction
*TransactionAPIApi* | [**api_gw_api_key_transaction_blik_post**](docs/TransactionAPIApi.md#api_gw_api_key_transaction_blik_post) | **POST** /api/gw/{api_key}/transaction/blik | blik
*TransactionAPIApi* | [**api_gw_api_key_transaction_create_post**](docs/TransactionAPIApi.md#api_gw_api_key_transaction_create_post) | **POST** /api/gw/{api_key}/transaction/create | create
*TransactionAPIApi* | [**api_gw_api_key_transaction_get_post**](docs/TransactionAPIApi.md#api_gw_api_key_transaction_get_post) | **POST** /api/gw/{api_key}/transaction/get | get
*TransactionAPIApi* | [**api_gw_api_key_transaction_report_post**](docs/TransactionAPIApi.md#api_gw_api_key_transaction_report_post) | **POST** /api/gw/{api_key}/transaction/report | report
## Documentation For Models
- [BlikAlias](docs/BlikAlias.md)
- [BlikAliasResponse](docs/BlikAliasResponse.md)
- [BlikFields](docs/BlikFields.md)
- [BlikResponse](docs/BlikResponse.md)
- [CardsErrCode](docs/CardsErrCode.md)
- [ChargebackStatus](docs/ChargebackStatus.md)
- [CheckFields](docs/CheckFields.md)
- [CheckResponse](docs/CheckResponse.md)
- [CreateFields](docs/CreateFields.md)
- [CreateResponse](docs/CreateResponse.md)
- [DeregisterFields](docs/DeregisterFields.md)
- [GetFields](docs/GetFields.md)
- [GetResponse](docs/GetResponse.md)
- [Language](docs/Language.md)
- [MasspaymentAuthorizeFields](docs/MasspaymentAuthorizeFields.md)
- [MasspaymentAuthorizeResponse](docs/MasspaymentAuthorizeResponse.md)
- [MasspaymentCreateFields](docs/MasspaymentCreateFields.md)
- [MasspaymentCreateResponse](docs/MasspaymentCreateResponse.md)
- [MasspaymentErrCode](docs/MasspaymentErrCode.md)
- [MasspaymentErrDesc](docs/MasspaymentErrDesc.md)
- [MasspaymentPacksFields](docs/MasspaymentPacksFields.md)
- [MasspaymentPacksResponse](docs/MasspaymentPacksResponse.md)
- [MasspaymentTransfersFields](docs/MasspaymentTransfersFields.md)
- [MasspaymentTransfersResponse](docs/MasspaymentTransfersResponse.md)
- [Onetimer](docs/Onetimer.md)
- [PacksObject](docs/PacksObject.md)
- [PaymentAttempts](docs/PaymentAttempts.md)
- [PresaleFields](docs/PresaleFields.md)
- [RefundAnyFields](docs/RefundAnyFields.md)
- [RefundAnyResponse](docs/RefundAnyResponse.md)
- [RefundFields](docs/RefundFields.md)
- [RefundResponse](docs/RefundResponse.md)
- [RefundStatusResponse](docs/RefundStatusResponse.md)
- [RefundTransactionFields](docs/RefundTransactionFields.md)
- [RegisterSaleFields](docs/RegisterSaleFields.md)
- [RegisterSaleResponse](docs/RegisterSaleResponse.md)
- [ReportFields](docs/ReportFields.md)
- [ReportResponse](docs/ReportResponse.md)
- [Result](docs/Result.md)
- [SaleFields](docs/SaleFields.md)
- [SaleResponse](docs/SaleResponse.md)
- [SecuresaleFields](docs/SecuresaleFields.md)
- [SecuresaleResponse](docs/SecuresaleResponse.md)
- [TransactionErrorCodes](docs/TransactionErrorCodes.md)
- [TransfersObject](docs/TransfersObject.md)
- [VcFinishFields](docs/VcFinishFields.md)
- [VcPrepareFields](docs/VcPrepareFields.md)
- [VcPrepareResponse](docs/VcPrepareResponse.md)
To get access to the crate's generated documentation, use:
```
cargo doc --open
```
## Author
pt@tpay.com

13
vendor/t_pay/docs/BlikAlias.md vendored Normal file
View File

@ -0,0 +1,13 @@
# BlikAlias
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | Option<**String**> | alias generated in merchant system (unique for each customer) | [optional]
**_type** | Option<**String**> | Alias type | [optional]
**key** | Option<**String**> | This field should contain alias key (returned by first api call with error ERR82) in case of using non-unique alias | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

12
vendor/t_pay/docs/BlikAliasResponse.md vendored Normal file
View File

@ -0,0 +1,12 @@
# BlikAliasResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**application_name** | Option<**String**> | Alias user friendly name saved at mobile app (blik request label parameter) | [optional]
**application_code** | Option<**String**> | Alias key which has to be send in case of using non-unique alias | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

15
vendor/t_pay/docs/BlikFields.md vendored Normal file
View File

@ -0,0 +1,15 @@
# BlikFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | **String** | Transaction title |
**code** | Option<**String**> | 6 digit code generated in customer bank mobile app (required if customer does not have registered alias or when customer does not want to pay by regietered device). BLIK code contains only digits but can start with zero or multiple zeroes, so you must not cast this variable to int. | [optional]
**api_password** | **String** | API password. |
**alias** | Option<[**Vec<crate::models::BlikAlias>**](blik_alias.md)> | Mandatory field when creating oneClick transactions, optional for standart Blik transactions with 6 digit code. In case of alias registration attempt you can send only 1 alias per 1 request. | [optional]
**_type** | Option<**i32**> | Transaction type. 0 - WEB mode (default value). 1 - POS mode dedicated for payment terminals | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

13
vendor/t_pay/docs/BlikResponse.md vendored Normal file
View File

@ -0,0 +1,13 @@
# BlikResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | Option<**i32**> | Attention! result: 1 does not indicate transfer of funds! This is successful user app popup indicator. | [optional]
**available_user_apps** | Option<[**Vec<crate::models::BlikAliasResponse>**](blik_alias_response.md)> | | [optional]
**err** | Option<[**crate::models::TransactionErrorCodes**](transaction_error_codes.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

296
vendor/t_pay/docs/CardsAPIApi.md vendored Normal file
View File

@ -0,0 +1,296 @@
# \CardsAPIApi
All URIs are relative to *https://docs.tpay.com/Proxy.php*
Method | HTTP request | Description
------------- | ------------- | -------------
[**api_cards_api_key_check_post**](CardsAPIApi.md#api_cards_api_key_check_post) | **POST** /api/cards/{api_key}/check | check
[**api_cards_api_key_deregister_post**](CardsAPIApi.md#api_cards_api_key_deregister_post) | **POST** /api/cards/{api_key}/deregister | deregister
[**api_cards_api_key_presale_post**](CardsAPIApi.md#api_cards_api_key_presale_post) | **POST** /api/cards/{api_key}/presale | presale
[**api_cards_api_key_refund_post**](CardsAPIApi.md#api_cards_api_key_refund_post) | **POST** /api/cards/{api_key}/refund | refund
[**api_cards_api_key_register_sale_post**](CardsAPIApi.md#api_cards_api_key_register_sale_post) | **POST** /api/cards/{api_key}/register_sale | register sale
[**api_cards_api_key_sale_post**](CardsAPIApi.md#api_cards_api_key_sale_post) | **POST** /api/cards/{api_key}/sale | sale
[**api_cards_api_key_securesale_post**](CardsAPIApi.md#api_cards_api_key_securesale_post) | **POST** /api/cards/{api_key}/securesale | secure sale
[**api_cards_api_key_visacheckout_finish_post**](CardsAPIApi.md#api_cards_api_key_visacheckout_finish_post) | **POST** /api/cards/{api_key}/visacheckout_finish | visacheckout finish
[**api_cards_api_key_visacheckout_prepare_post**](CardsAPIApi.md#api_cards_api_key_visacheckout_prepare_post) | **POST** /api/cards/{api_key}/visacheckout_prepare | visacheckout prepare
## api_cards_api_key_check_post
> crate::models::CheckResponse api_cards_api_key_check_post(api_key, basic_data)
check
Method, which can be used to ping our API server to establish a monitoring service on the Merchant system.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**CheckFields**](CheckFields.md)> | check method data | |
### Return type
[**crate::models::CheckResponse**](check_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_cards_api_key_deregister_post
> serde_json::Value api_cards_api_key_deregister_post(api_key, basic_data)
deregister
The method used to deregister client credit card token from Tpay and Merchant system.<br/>A client can also do it himself from the link in an email after payment.<br/><br/>After successful deregistration Merchant will not be able anymore to charge client's card. Tpay system sends notification about this deregistration to merchant endpoint, defined in merchant panel settings.<br/><br/><b>NOTICE:</b> To test this method you need to generate client token and calculate sign with your own API access data.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**DeregisterFields**](DeregisterFields.md)> | Transaction data. | |
### Return type
[**serde_json::Value**](serde_json::Value.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_cards_api_key_presale_post
> crate::models::RegisterSaleResponse api_cards_api_key_presale_post(api_key, basic_data)
presale
The method used to create a new sale for payment on demand. It can be called after receiving a notification with client registered token (cli_auth parameter). It can not be used if 'onetimer' parameter was sent in register_sale or client has unregistered (by the link in an email sent by tpay.com after registering clients credit card or by API).<br/><br/><b>Additional information</b> Please feel free to read detailed case study of <a href=\"https://support.tpay.com/en/case-study/wdrozenie-platnosci-rekurencyjnych-cyklicznych\" target=\"_blank\">Implementation of the recurrent payments</a>
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**PresaleFields**](PresaleFields.md)> | Transaction data. | |
### Return type
[**crate::models::RegisterSaleResponse**](register_sale_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_cards_api_key_refund_post
> crate::models::RefundResponse api_cards_api_key_refund_post(api_key, basic_data)
refund
The method used to transfer money back to the client. The refund can reference to chosen sale (sale_auth) or directly to the client (cli_auth).<br/><br/> In both cases, the amount is adjustable in parameter amount. If the only cli_auth is sent, the amount parameter is required. If sale_auth is passed amount and currency are not necessary - the system will take default values from the specified sale and make a full amount refund.<br/>If you pass the amount parameter and specific sale_auth, you can create more than one refund until the sum of all refunds reach the transaction amount. <br><br/> In test mode this method has 50% probability of success and the status parameter is picked randomly. <br/>
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**RefundFields**](RefundFields.md)> | Transaction data. | |
### Return type
[**crate::models::RefundResponse**](refund_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_cards_api_key_register_sale_post
> crate::models::RegisterSaleResponse api_cards_api_key_register_sale_post(api_key, basic_data)
register sale
The method used to create sale initialisation in tpay.com system. The successful request returns sale_auth used to redirect a client to transaction panel. <br><br>The parameter sale_auth can be used to redirect a client to payment transaction panel: <br> <b> https://secure.tpay.com/cards/ </b><br> with argument sale_auth passed with the POST or GET method. <br><br> <b>Test mode notice!</b><br> In test mode, the transaction panel offers multiple system answers. You can choose at the transaction panel (instead of making a real transaction) to accept or decline payment to test all paths. In production mode client will be directly redirected to payment gateway with credit card data form. <br> Notification about positive transaction status will be sent to result URL which is set in account settings.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**RegisterSaleFields**](RegisterSaleFields.md)> | Transaction data. | |
### Return type
[**crate::models::RegisterSaleResponse**](register_sale_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_cards_api_key_sale_post
> crate::models::SaleResponse api_cards_api_key_sale_post(api_key, basic_data)
sale
The method used to execute created sale with presale method. Sale defined with sale_auth can be executed only once. If the method is called second time with the same parameters, the system returns actual sale status - in parameter status - done for correct payment and declined for rejected payment. In that case, client card is not charged the second time. <br><br> Passed cli_auth has to match with cli_auth used while creating a sale in presale method. <br><br><b>Test mode notice!</b> The method will return correct status with 50% probability. The same concerns declined status. In this case, reason value is also randomly picked.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**SaleFields**](SaleFields.md)> | Transaction data. | |
### Return type
[**crate::models::SaleResponse**](sale_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_cards_api_key_securesale_post
> crate::models::SecuresaleResponse api_cards_api_key_securesale_post(api_key, basic_data)
secure sale
This method allows Merchant to host payment form on his website and perform sale without any client redirection to tpay.com system. Securesale method supports 3D Secure validation which is an additional security layer for online credit and debit card transactions. This approach requires special security considerations. We support secure communication by encrypting card data (card number, validity date and cvv/cvs number) on the client side (javascript) with Merchant public RSA key and send it as one parameter (card) to our API gate. A valid SSL certificate on the Merchant domain is required. Application flow is presented below for clarification:<br/><br/> 1. Generate webpage with your public RSA key in javascript<br/> 2. Before sending payment form, insert new input with encrypted card data using your public key and clear inputs with card data so only encrypted data will be sent and submit form. <br/> 3. In backend prepare parameters and send them with securesale method <br/> 4. Inform client about payment result<br/> <br/> Card cypher is made from string<br/><br/> card number|expiry date(MM/YY or MM/YYYY)|cvv or cvc|host <br/><br/> eg. \"1234567891234567|05/17|123|https://merchantwebsite.com\" <br/><br/> We have published code samples, libraries and instructions to give some insights on the process - see https://github.com/tpay-com/tpay-php . The library used in the example has a limit of 117 input characters for encryption. <br/> <b>In production mode, this generated hash works only once and should always be generated even for the same card data.</b><br/><br/> There are two ways for performing payment<br/><br/> a) <b>Pay by card without 3D- Secure.</b> <br/> If input parameters are correct, request is processed correctly and the entered card does not have the 3D-Secure option enabled, method returns parameters in JSON format<br/><br/> b) <b>Pay by card with 3D-Secure.</b> <br/>If input parameters are correct, the request is processed correctly and the card has enabled the 3D-Secure, the method returns the 3ds_url parameter in JSON format. <br/><br/> An example 3ds URL is presented below <br/><br/> https://secure.tpay.com/cards/?sale_auth=2587bf3a98dfa699ef9d01eba38359b7 <br/><br/> • The best way to implement 3DS is to open a link to 3D-Secure authentication in a new window. If this method is used, parameter \"enable_pow_url\" should be sent with value 1. After a correct authorization, a customer will be redirected to the Merchants Site. Return URL is set in Merchants Panel or sent dynamically. <br/><br/> • Do not use an inline frame to implement the 3D-Secure authentication on Merchants Site. In this case, some banks can block 3DS authorisation. <br/><br/> The parameters are sent with POST method. Merchant system has to respond to the notification by printing array in JSON format.<br/> See Card's notifications section.<br/><br/> <b>Test mode notice!</b> <br/>In test mode, transaction panel offers the choice of system answer for transactions with 3D-Secure authentication. You can choose to accept or decline payment to test all paths.<br/><br/><b>Additional information</b> Please feel free to read detailed case study of <a href=\"https://support.tpay.com/en/case-study/wdrozenie-bramki-platnosci-kartami-na-stronie-sklepu\" target=\"_blank\">Implementation of the card payment gateway at the store's website<a/>
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**SecuresaleFields**](SecuresaleFields.md)> | Transaction data. | |
### Return type
[**crate::models::SecuresaleResponse**](securesale_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_cards_api_key_visacheckout_finish_post
> crate::models::SecuresaleResponse api_cards_api_key_visacheckout_finish_post(api_key, basic_data)
visacheckout finish
The Method used to finish Visa Checkout payment. <br/><br/> Summary_data has format compliant with Visa Checkout Summary Payment Data. Its structure is described in Visa Checkout documentation at <a href=\"https://developer.visa.com/products/visa_checkout/guides#extracting-consumer-data\">extracting-consumer-data</a><br><br/> The example table with this format can be found at <a href=\"https://developer.visa.com/capabilities/visa_checkout/docs#pdfs_for_merchants_integrating_with_visa_checkout\">Link</a> <br><br>When some data change between visacheckout_prepare and visacheckout_finish, you should send the modified data with the summary_data table. You can only send to tpay.com the data, which changes (i.e. only the amount ) but you need to send it in the summary_data JSON structure. <br/>Other fields if not changed dont have to be sent.<br/> The response format is the same as in SecureSale method - see the method for more details.<br/><br/><b>NOTICE:</b> To use Visa Checkout methods, you need to have access to cards API at your account and pass Visa requirements (see Visa Checkout Integration section).
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**VcFinishFields**](VcFinishFields.md)> | Transaction data. | |
### Return type
[**crate::models::SecuresaleResponse**](securesale_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_cards_api_key_visacheckout_prepare_post
> crate::models::VcPrepareResponse api_cards_api_key_visacheckout_prepare_post(api_key, basic_data)
visacheckout prepare
The method used to prepare Visa Checkout payment. <br/><br/><b>NOTICE:</b> To use Visa Checkout methods, you need to have access to cards API at your account and pass Visa requirements (see Visa Checkout Integration section).
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**VcPrepareFields**](VcPrepareFields.md)> | Transaction data. | |
### Return type
[**crate::models::VcPrepareResponse**](vc_prepare_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

10
vendor/t_pay/docs/CardsErrCode.md vendored Normal file
View File

@ -0,0 +1,10 @@
# CardsErrCode
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

14
vendor/t_pay/docs/ChargebackStatus.md vendored Normal file
View File

@ -0,0 +1,14 @@
# ChargebackStatus
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | Option<**String**> | Chargeback title in Tpay.com system | [optional]
**date** | Option<**String**> | Chargeback creation time | [optional]
**amount** | Option<**f32**> | Refunded amount | [optional]
**status** | Option<**String**> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

11
vendor/t_pay/docs/CheckFields.md vendored Normal file
View File

@ -0,0 +1,11 @@
# CheckFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**api_password** | Option<**String**> | API password. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

12
vendor/t_pay/docs/CheckResponse.md vendored Normal file
View File

@ -0,0 +1,12 @@
# CheckResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | Option<[**crate::models::Result**](result.md)> | | [optional]
**content** | Option<**String**> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

32
vendor/t_pay/docs/CreateFields.md vendored Normal file
View File

@ -0,0 +1,32 @@
# CreateFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **i32** | Merchant ID in Tpay.com system |
**amount** | **f32** | Transaction amount. Please always send the amount with two decimal places like 10.00 |
**description** | **String** | Transaction description |
**crc** | Option<**String**> | Auxiliary parameter to identify the transaction on the merchant side. We do recommend to encode your crc value in base64. The exact value of crc used to create transaction will be returned in tpay payment notification as tr_crc parameter. | [optional]
**md5sum** | **String** | md5 sum calculated from id.'&'.amount.'&'.crc.'&'.security_code where dots means concatenation (security code can be found in merchant panel). |
**group** | **i32** | Transaction group number see the \"id\" element in https://secure.tpay.com/groups-{id}0.js . For example https://secure.tpay.com/groups-10100.js or https://secure.tpay.com/groups-10100.js?json |
**result_url** | Option<**String**> | Merchant endpoint for payment notification | [optional]
**result_email** | Option<**String**> | Email address where notification after payment will be sent (overrides defined in merchant panel). You can add more addresses by comma concatenation. | [optional]
**merchant_description** | Option<**String**> | Name of merchant displayed in transaction panel (overrides defined in merchant panel) | [optional]
**custom_description** | Option<**String**> | Additional info to be displayed in transaction panel (overrides defined in merchant panel) | [optional]
**return_url** | Option<**String**> | url to redirect customer in case of payment success | [optional]
**return_error_url** | Option<**String**> | url to redirect customer in case of payment failure | [optional]
**language** | Option<**String**> | Customer language | [optional][default to Language_Pl]
**email** | **String** | customer email |
**name** | **String** | customer name |
**address** | Option<**String**> | customer address (parameter is empty if this field was not send with create method) | [optional]
**city** | Option<**String**> | customer city (parameter is empty if this field was not send with create method) | [optional]
**zip** | Option<**String**> | customer postal code (parameter is empty if this field was not send with create method) | [optional]
**country** | Option<**String**> | Two letters - see ISO 3166-1 document | [optional]
**phone** | Option<**String**> | customer phone number (parameter is empty if this field was not send with create method) | [optional]
**accept_tos** | Option<**i32**> | Acceptance of Tpay.com regulations done by customer on Merchant site | [optional]
**api_password** | **String** | API password. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

18
vendor/t_pay/docs/CreateResponse.md vendored Normal file
View File

@ -0,0 +1,18 @@
# CreateResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | [**crate::models::Result**](result.md) | |
**err** | Option<[**crate::models::TransactionErrorCodes**](transaction_error_codes.md)> | | [optional]
**title** | Option<**String**> | Transaction title | [optional]
**amount** | Option<**f32**> | transaction amount casted to float | [optional]
**account_number** | Option<**f32**> | bank account number (only for manual bank transfers) | [optional]
**online** | Option<**i32**> | Booking payments online indicator | [optional]
**url** | Option<**String**> | Link to transaction (for redirecting to payment) | [optional]
**desc** | Option<**String**> | optional field, contains names of invalid fields. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

14
vendor/t_pay/docs/DeregisterFields.md vendored Normal file
View File

@ -0,0 +1,14 @@
# DeregisterFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cli_auth** | **String** | Client token |
**language** | Option<[**crate::models::Language**](language.md)> | | [optional]
**api_password** | **String** | API password. |
**sign** | **String** | Sign is calculated from cryptographic hash function set in Merchants Panel (default SHA-1): hash_alg (method + cli_auth + language + verification code) where + means concatenation with ampersand symbol. ie. cli_auth + language = t59c2810d59285e3e0ee9d1f1eda1c2f4c554e24&pl |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

12
vendor/t_pay/docs/GetFields.md vendored Normal file
View File

@ -0,0 +1,12 @@
# GetFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | **String** | Transaction title |
**api_password** | **String** | API password. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

29
vendor/t_pay/docs/GetResponse.md vendored Normal file
View File

@ -0,0 +1,29 @@
# GetResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | Option<[**crate::models::Result**](result.md)> | | [optional]
**status** | Option<**String**> | | [optional]
**error_code** | Option<**String**> | Depending on setting in merchant panel, error_code may be different than none for correct status, when acceptance of overpays and surcharges has been set. | [optional]
**start_time** | Option<**String**> | Transaction creation time | [optional]
**payment_time** | Option<**String**> | Date of payment or empty for pending transactions | [optional]
**chargeback_time** | Option<**String**> | Date of payment refund or empty for not refunded transactions | [optional]
**channel** | Option<**i32**> | Payment channel ID can be recognised in merchant panel (your offer section) | [optional]
**test_mode** | Option<**String**> | Returns 1 if transaction was in test mode | [optional]
**amount** | Option<**f32**> | transaction amount casted to float | [optional]
**amount_paid** | Option<**f32**> | The amount paid by customer | [optional]
**name** | Option<**String**> | customer name | [optional]
**email** | Option<**String**> | customer email | [optional]
**address** | Option<**String**> | customer address (parameter is empty if this field was not send with create method) | [optional]
**code** | Option<**String**> | customer postal code (parameter is empty if this field was not send with create method) | [optional]
**city** | Option<**String**> | customer city (parameter is empty if this field was not send with create method) | [optional]
**phone** | Option<**String**> | customer phone number (parameter is empty if this field was not send with create method) | [optional]
**country** | Option<**String**> | Two letters - see ISO 3166-1 document | [optional]
**err** | Option<[**crate::models::TransactionErrorCodes**](transaction_error_codes.md)> | | [optional]
**payment_attempts** | Option<[**Vec<crate::models::PaymentAttempts>**](payment_attempts.md)> | List of payment attempts. Currently is returned only for BLIK payment method | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

10
vendor/t_pay/docs/Language.md vendored Normal file
View File

@ -0,0 +1,10 @@
# Language
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,12 @@
# MasspaymentAuthorizeFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pack_id** | **i32** | ID of created pack using method create. |
**api_password** | **String** | API password. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,12 @@
# MasspaymentAuthorizeResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | Option<[**crate::models::Result**](result.md)> | | [optional]
**error** | Option<[**crate::models::MasspaymentErrCode**](masspayment_err_code.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,13 @@
# MasspaymentCreateFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**csv** | **String** | Transfers list encoded with base64. Format has been described in metchod description |
**api_password** | **String** | API password. |
**sign** | **String** | Checksum to verify parameters received from Merchant. Generated according to outline below using SHA1 function: SHA1(seller_id + transfers list (before encrypting in base64) + Merchant confirmation code) Implementing checksum in PHP: sha1($seller_id. $csv . $confirmation_code) |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,17 @@
# MasspaymentCreateResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | Option<[**crate::models::Result**](result.md)> | | [optional]
**sum** | Option<**f32**> | Sum of transfers in the package | [optional]
**count** | Option<**i32**> | Number of transfers defined in CSV file | [optional]
**pack_id** | Option<**i32**> | ID of created pack using method create. | [optional]
**referers** | Option<**String**> | Field visible if transfersID has been sent (see chap. \"Exemplary CSV file\") in JSON format as following: ID in transfer : ID of transfers in tpay.com system. This allows tracking single transfers. | [optional]
**error** | Option<[**crate::models::MasspaymentErrCode**](masspayment_err_code.md)> | | [optional]
**desc** | Option<[**crate::models::MasspaymentErrDesc**](masspayment_err_desc.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

10
vendor/t_pay/docs/MasspaymentErrCode.md vendored Normal file
View File

@ -0,0 +1,10 @@
# MasspaymentErrCode
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

10
vendor/t_pay/docs/MasspaymentErrDesc.md vendored Normal file
View File

@ -0,0 +1,10 @@
# MasspaymentErrDesc
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,14 @@
# MasspaymentPacksFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pack_id** | Option<**i32**> | ID of created pack using method create. | [optional]
**from_date** | Option<**String**> | Creation date of pack created with method create. | [optional]
**to_date** | Option<**String**> | Ending date of pack created with method create. | [optional]
**api_password** | **String** | API password. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,13 @@
# MasspaymentPacksResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | Option<[**crate::models::Result**](result.md)> | | [optional]
**packs** | Option<[**Vec<crate::models::PacksObject>**](PacksObject.md)> | | [optional]
**error** | Option<[**crate::models::MasspaymentErrCode**](masspayment_err_code.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,13 @@
# MasspaymentTransfersFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pack_id** | Option<**i32**> | ID of created pack using method create. | [optional]
**tr_id** | Option<**String**> | Transfer ID in tpay.com system (see method create) | [optional]
**api_password** | Option<**String**> | API password. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,13 @@
# MasspaymentTransfersResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | Option<[**crate::models::Result**](result.md)> | | [optional]
**transfers** | Option<[**Vec<crate::models::TransfersObject>**](TransfersObject.md)> | | [optional]
**error** | Option<[**crate::models::MasspaymentErrCode**](masspayment_err_code.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

136
vendor/t_pay/docs/MasspaymentsApi.md vendored Normal file
View File

@ -0,0 +1,136 @@
# \MasspaymentsApi
All URIs are relative to *https://docs.tpay.com/Proxy.php*
Method | HTTP request | Description
------------- | ------------- | -------------
[**api_gw_api_key_masspayment_authorize_post**](MasspaymentsApi.md#api_gw_api_key_masspayment_authorize_post) | **POST** /api/gw/{api_key}/masspayment/authorize | authorize
[**api_gw_api_key_masspayment_create_post**](MasspaymentsApi.md#api_gw_api_key_masspayment_create_post) | **POST** /api/gw/{api_key}/masspayment/create | create
[**api_gw_api_key_masspayment_packs_post**](MasspaymentsApi.md#api_gw_api_key_masspayment_packs_post) | **POST** /api/gw/{api_key}/masspayment/packs | packs
[**api_gw_api_key_masspayment_transfers_post**](MasspaymentsApi.md#api_gw_api_key_masspayment_transfers_post) | **POST** /api/gw/{api_key}/masspayment/transfers | transfers
## api_gw_api_key_masspayment_authorize_post
> crate::models::MasspaymentAuthorizeResponse api_gw_api_key_masspayment_authorize_post(api_key, basic_data)
authorize
This method authorizes the processing of chosen pack of transfers.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**MasspaymentAuthorizeFields**](MasspaymentAuthorizeFields.md)> | Transaction data. | |
### Return type
[**crate::models::MasspaymentAuthorizeResponse**](masspayment_authorize_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_gw_api_key_masspayment_create_post
> crate::models::MasspaymentCreateResponse api_gw_api_key_masspayment_create_post(api_key, basic_data)
create
This method adds a pack of transfers to the Tpay system. After executing a correct operation, you need to request authorize method to confirm payout processing. Transfers are being made once a day on workdays. You can find confirmation code in Merchant Panel, settings tab-> notifications. Variable $seller_id is Merchants ID in tpay.com system. <br/><br/> <b>Example CSV file</b><br/> Each line contains one transfer formatted as in the example below. Columns are separated by a semicolon. <br/> The file does not have a header.<br/><br/> account number (26 digits);receiver (part 1) (35 characters);receiver (part 2) (35 characters);receiver (part 3) (35 characters);receiver (part 4) (35 characters);amount (dot or comma separator);title (part 1) (35 characters);title (part 2) (35 characters);Tpay transaction ID<br/><br/> Place transfer receiver name in 1-4 receiver fields. Each field can be maximum 35 characters long.<br/> If receiver name is for example 40 characters long, you should put 35 in receiver 1 field, and 5 characters in receiver 2 field.<br/> The same rule is valid for title field. The transaction ID field is not required, whithout this field, the file format looks like this: <br/><br/> account number (26 digits);receiver (part 1) (35 characters);receiver (part 2) (35 characters);receiver (part 3) (35 characters);receiver (part 4) (35 characters);amount (dot or comma separator);title (part 1) (35 characters);title (part 2) (35 characters);Transaction ID from merchant system<br/><br/> Example CSV file can be downloaded from:<br/> <a href=\"https://secure.tpay.com/partner/pliki/przyklad.csv\" target=\"_blank\">Download</a>
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**MasspaymentCreateFields**](MasspaymentCreateFields.md)> | Transaction data. | |
### Return type
[**crate::models::MasspaymentCreateResponse**](masspayment_create_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_gw_api_key_masspayment_packs_post
> crate::models::MasspaymentPacksResponse api_gw_api_key_masspayment_packs_post(api_key, basic_data)
packs
This method allows browsing through created packages. If none of the parameters has been sent, all packages for the Merchants account will be returned. If any records exist, there will be pack objects in pack section representing respective transfer packages. You can send pack_id to browse contents of specific pack or send time range to browse all packages within time range
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**MasspaymentPacksFields**](MasspaymentPacksFields.md)> | Transaction data. | |
### Return type
[**crate::models::MasspaymentPacksResponse**](masspayment_packs_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_gw_api_key_masspayment_transfers_post
> crate::models::MasspaymentTransfersResponse api_gw_api_key_masspayment_transfers_post(api_key, basic_data)
transfers
This method allows browsing through transfers within one package. Required parameters (besides those described in mass payments main description), at least 1 is obligatory. If any records exist, there will be transfer objects in transfers section representing several transfers.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**MasspaymentTransfersFields**](MasspaymentTransfersFields.md)> | Transaction data. | |
### Return type
[**crate::models::MasspaymentTransfersResponse**](masspayment_transfers_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

10
vendor/t_pay/docs/Onetimer.md vendored Normal file
View File

@ -0,0 +1,10 @@
# Onetimer
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

17
vendor/t_pay/docs/PacksObject.md vendored Normal file
View File

@ -0,0 +1,17 @@
# PacksObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pack_id** | Option<**i32**> | ID of created pack using method create. | [optional]
**date** | Option<**String**> | Date of package creation | [optional]
**auth_date** | Option<**String**> | Date of package authorization (method authorize) | [optional]
**status** | Option<**String**> | Package status | [optional]
**count** | Option<**i32**> | Number of transfers in the package | [optional]
**sum** | Option<**f32**> | Sum of transfers in the package | [optional]
**cost** | Option<**f32**> | Additional cost of processing transfers in the package | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

12
vendor/t_pay/docs/PaymentAttempts.md vendored Normal file
View File

@ -0,0 +1,12 @@
# PaymentAttempts
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**date** | Option<**String**> | Time of payment attempt | [optional]
**payment_error_code** | Option<**String**> | Error code if any occurred. Null if payment was successful. See Transaction API error codes for more details. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

18
vendor/t_pay/docs/PresaleFields.md vendored Normal file
View File

@ -0,0 +1,18 @@
# PresaleFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**desc** | **String** | transaction description |
**cli_auth** | **String** | Client token |
**amount** | **f32** | transaction amount casted to float |
**api_password** | **String** | API password. |
**sign** | **String** | Sign is calculated from cryptographic hash function set in Merchants 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 |
**currency** | Option<**i32**> | transaction currency in ISO numeric format | [optional][default to 985]
**order_id** | Option<**String**> | merchant order ID used to recognise payment | [optional]
**language** | Option<[**crate::models::Language**](language.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

13
vendor/t_pay/docs/RefundAnyFields.md vendored Normal file
View File

@ -0,0 +1,13 @@
# RefundAnyFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | **String** | Transaction title |
**chargeback_amount** | **f64** | refund amount (can not be greater than transaction amount) |
**api_password** | **String** | API password. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

12
vendor/t_pay/docs/RefundAnyResponse.md vendored Normal file
View File

@ -0,0 +1,12 @@
# RefundAnyResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | **i32** | Request result (digit; 1 correct, 0 - incorrect) |
**err** | Option<[**crate::models::TransactionErrorCodes**](transaction_error_codes.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

18
vendor/t_pay/docs/RefundFields.md vendored Normal file
View File

@ -0,0 +1,18 @@
# RefundFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cli_auth** | Option<**String**> | Client token | [optional]
**sale_auth** | Option<**String**> | Transaction id in tpay.com system | [optional]
**desc** | **String** | |
**currency** | Option<**i32**> | transaction currency in ISO numeric format | [optional][default to 985]
**amount** | Option<**f32**> | transaction amount casted to float | [optional]
**language** | Option<[**crate::models::Language**](language.md)> | | [optional]
**api_password** | **String** | API password. |
**sign** | **String** | Sign is calculated from cryptographic hash function set in Merchants Panel (default SHA-1): hash_alg (method + cli_auth + sale_auth + desc + amount + currency + language + verification code); where + means concatenation with ampersand symbol. ie. currency + language = 985&pl |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

23
vendor/t_pay/docs/RefundResponse.md vendored Normal file
View File

@ -0,0 +1,23 @@
# RefundResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | [**crate::models::Result**](result.md) | |
**test_mode** | Option<**String**> | This parameter is present in response and included in sign calculation only when the merchant account is in test mode. | [optional]
**sale_auth** | **String** | Transaction id in tpay.com system |
**sale_ref** | Option<**String**> | | [optional]
**currency** | **i32** | transaction currency in ISO numeric format | [default to 985]
**amount** | **f32** | transaction amount casted to float |
**date** | Option<**String**> | Date of payment | [optional]
**status** | **String** | |
**reason** | Option<**String**> | Acquirer (Elavon / eService) rejection code - see \"Card Payments Rejection Codes\" for more details | [optional]
**sign** | **String** | Response sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code). |
**card** | Option<**String**> | | [optional]
**cli_auth** | Option<**String**> | Client token | [optional]
**err_code** | Option<[**crate::models::CardsErrCode**](cards_err_code.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,13 @@
# RefundStatusResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | **i32** | Request result (digit; 1 correct, 0 - incorrect) |
**chargebacks** | Option<[**Vec<crate::models::ChargebackStatus>**](chargeback_status.md)> | Chargebacks associated to transaction | [optional]
**err** | Option<[**crate::models::TransactionErrorCodes**](transaction_error_codes.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,12 @@
# RefundTransactionFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**title** | **String** | Transaction title |
**api_password** | **String** | API password. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

22
vendor/t_pay/docs/RegisterSaleFields.md vendored Normal file
View File

@ -0,0 +1,22 @@
# RegisterSaleFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | customer name |
**email** | **String** | customer email |
**desc** | **String** | transaction description |
**amount** | **f32** | transaction amount casted to float |
**api_password** | **String** | API password. |
**sign** | **String** | Sign is calculated from cryptographic hash function set in Merchants Panel (default SHA-1): sha1(method + name + email + desc + amount + currency + order_id + onetimer + language + verification code) where + means concatenation with ampersand symbol. ie. name + email = john done&john.doe@example.com |
**currency** | Option<**i32**> | transaction currency in ISO numeric format | [optional][default to 985]
**onetimer** | Option<[**crate::models::Onetimer**](onetimer.md)> | | [optional]
**pow_url** | Option<**String**> | url to redirect customer in case of payment success | [optional]
**pow_url_blad** | Option<**String**> | url to redirect customer in case of payment failure | [optional]
**order_id** | Option<**String**> | merchant order ID used to recognise payment | [optional]
**language** | Option<[**crate::models::Language**](language.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,15 @@
# RegisterSaleResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | Option<[**crate::models::Result**](result.md)> | | [optional]
**sale_auth** | Option<**String**> | Transaction id in tpay.com system | [optional]
**sign** | Option<**String**> | Sign is calculated from cryptographic hash function set in Merchants Panel (default SHA-1): sha1(sale_auth + verification code) where + means concatenation. | [optional]
**err_code** | Option<[**crate::models::CardsErrCode**](cards_err_code.md)> | | [optional]
**err_desc** | Option<**String**> | Error code description if an error occurs or not present in response. - see \"Card Payments Rejection Codes\" for more details | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

13
vendor/t_pay/docs/ReportFields.md vendored Normal file
View File

@ -0,0 +1,13 @@
# ReportFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**from_date** | **String** | start range of generated report |
**to_date** | **String** | end range of generated report |
**api_password** | **String** | API password. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

13
vendor/t_pay/docs/ReportResponse.md vendored Normal file
View File

@ -0,0 +1,13 @@
# ReportResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | Option<[**crate::models::Result**](result.md)> | | [optional]
**report** | Option<**String**> | Report content encoded in base64. Characters encoding is UTF8. After decoding the report you will get: <br> (header[NL], empty line[NL], columns description[NL], transactions list, each in new line, where [NL] is a new line indicator): Summary of transactions and refunds sorted by dates<br/> LP;Transaction ID;Transaction amount;Paid amount;commission %;flat commission; commission taken;Transaction CRC;Transaction description;Payment date;Refund date;E-mail;Customer name;Address;Postal code;City;Country;Phone;Additional description (Acquirer (Elavon / eService));RRN (Acquirer (Elavon / eService)) <br/> Columns are separated by ; (semicolon). | [optional]
**err** | Option<[**crate::models::TransactionErrorCodes**](transaction_error_codes.md)> | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

10
vendor/t_pay/docs/Result.md vendored Normal file
View File

@ -0,0 +1,10 @@
# Result
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

14
vendor/t_pay/docs/SaleFields.md vendored Normal file
View File

@ -0,0 +1,14 @@
# SaleFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cli_auth** | **String** | Client token |
**sale_auth** | **String** | Transaction id in tpay.com system |
**api_password** | **String** | API password. |
**sign** | **String** | Request sign is calculated from cryptographic hash function set in Merchants Panel (default SHA-1): hash_alg (method + cli_auth + sale_auth + verification code); where + means concatenation with ampersand symbol. ie. name + email = john done&john.doe@example.com. Passed cli_auth has to match with cli_auth used while creating sale in presale method. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

20
vendor/t_pay/docs/SaleResponse.md vendored Normal file
View File

@ -0,0 +1,20 @@
# SaleResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | [**crate::models::Result**](result.md) | |
**test_mode** | Option<**String**> | This parameter is present in response and included in sign calculation only when the merchant account is in test mode. | [optional]
**sale_auth** | **String** | Transaction id in tpay.com system |
**cli_auth** | Option<**String**> | Client token | [optional]
**currency** | **i32** | transaction currency in ISO numeric format | [default to 985]
**amount** | **f32** | transaction amount casted to float |
**date** | Option<**String**> | Date of payment | [optional]
**status** | **String** | |
**reason** | Option<**String**> | Acquirer (Elavon / eService) rejection code - see \"Card Payments Rejection Codes\" for more details | [optional]
**sign** | **String** | Response sign = hash_alg(test_mode + sale_auth + cli_auth + currency + amount + date + status + reason + verification code) |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

24
vendor/t_pay/docs/SecuresaleFields.md vendored Normal file
View File

@ -0,0 +1,24 @@
# SecuresaleFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | customer name |
**email** | **String** | customer email |
**desc** | **String** | transaction description |
**amount** | **f32** | transaction amount casted to float |
**api_password** | **String** | API password. |
**sign** | **String** | Sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg (method + card + name + email + desc + amount + currency + order_id + onetimer + language + enable_pow_url + verification code) where + means concatenation with ampersand symbol. ie. name + email = john done&john.doe@example.com |
**currency** | **i32** | transaction currency in ISO numeric format | [default to 985]
**onetimer** | Option<[**crate::models::Onetimer**](onetimer.md)> | | [optional]
**pow_url** | Option<**String**> | url to redirect customer in case of payment success | [optional]
**pow_url_blad** | Option<**String**> | url to redirect customer in case of payment failure | [optional]
**order_id** | Option<**String**> | merchant order ID used to recognise payment | [optional]
**language** | Option<[**crate::models::Language**](language.md)> | | [optional]
**enable_pow_url** | Option<**i32**> | | [optional]
**card** | **String** | Card hash calculated by schema described in method description |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

24
vendor/t_pay/docs/SecuresaleResponse.md vendored Normal file
View File

@ -0,0 +1,24 @@
# SecuresaleResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**var_3ds_url** | Option<**String**> | | [optional]
**result** | Option<[**crate::models::Result**](result.md)> | | [optional]
**test_mode** | Option<**String**> | This parameter is present in response and included in sign calculation only when the merchant account is in test mode. | [optional]
**sale_auth** | Option<**String**> | Transaction id in tpay.com system | [optional]
**cli_auth** | Option<**String**> | Client token | [optional]
**currency** | Option<**i32**> | transaction currency in ISO numeric format | [optional][default to 985]
**amount** | Option<**f32**> | transaction amount casted to float | [optional]
**date** | Option<**String**> | Date of payment | [optional]
**status** | Option<**String**> | | [optional]
**reason** | Option<**String**> | Acquirer (Elavon / eService) rejection code - see \"Card Payments Rejection Codes\" for more details | [optional]
**card** | Option<**String**> | Card number last 4 digits - for example ****1234 | [optional]
**sign** | Option<**String**> | sign is calculated from cryptographic hash function set in Merchant panel (default SHA-1) hash_alg(test_mode + sale_auth + cli_auth + card + currency + amount + date + status + verification code) | [optional]
**err_code** | Option<[**crate::models::CardsErrCode**](cards_err_code.md)> | | [optional]
**err_desc** | Option<**String**> | Error code description if an error occurs or not present in response. - see \"Card Payments Rejection Codes\" for more details | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

232
vendor/t_pay/docs/TransactionAPIApi.md vendored Normal file
View File

@ -0,0 +1,232 @@
# \TransactionAPIApi
All URIs are relative to *https://docs.tpay.com/Proxy.php*
Method | HTTP request | Description
------------- | ------------- | -------------
[**api_gw_api_key_chargeback_any_post**](TransactionAPIApi.md#api_gw_api_key_chargeback_any_post) | **POST** /api/gw/{api_key}/chargeback/any | any
[**api_gw_api_key_chargeback_status_post**](TransactionAPIApi.md#api_gw_api_key_chargeback_status_post) | **POST** /api/gw/{api_key}/chargeback/status | status
[**api_gw_api_key_chargeback_transaction_post**](TransactionAPIApi.md#api_gw_api_key_chargeback_transaction_post) | **POST** /api/gw/{api_key}/chargeback/transaction | transaction
[**api_gw_api_key_transaction_blik_post**](TransactionAPIApi.md#api_gw_api_key_transaction_blik_post) | **POST** /api/gw/{api_key}/transaction/blik | blik
[**api_gw_api_key_transaction_create_post**](TransactionAPIApi.md#api_gw_api_key_transaction_create_post) | **POST** /api/gw/{api_key}/transaction/create | create
[**api_gw_api_key_transaction_get_post**](TransactionAPIApi.md#api_gw_api_key_transaction_get_post) | **POST** /api/gw/{api_key}/transaction/get | get
[**api_gw_api_key_transaction_report_post**](TransactionAPIApi.md#api_gw_api_key_transaction_report_post) | **POST** /api/gw/{api_key}/transaction/report | report
## api_gw_api_key_chargeback_any_post
> crate::models::RefundAnyResponse api_gw_api_key_chargeback_any_post(api_key, refund_any_data)
any
The method used to refund part of the transaction amount. <br/><br/><b>NOTICE:</b> This method works only in production mode!<br/>To test this method, you need to create the transaction in production mode with your own API access.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**refund_any_data** | Option<[**RefundAnyFields**](RefundAnyFields.md)> | Request body. | |
### Return type
[**crate::models::RefundAnyResponse**](refund_any_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_gw_api_key_chargeback_status_post
> crate::models::RefundStatusResponse api_gw_api_key_chargeback_status_post(api_key, refund_transaction_data)
status
The method used to check transaction refunds statuses.<br/>Some refunds statuses may be not available immediately after calling refund methods due to gathering refund details process.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**refund_transaction_data** | Option<[**RefundTransactionFields**](RefundTransactionFields.md)> | Request body. | |
### Return type
[**crate::models::RefundStatusResponse**](refund_status_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_gw_api_key_chargeback_transaction_post
> crate::models::RefundAnyResponse api_gw_api_key_chargeback_transaction_post(api_key, refund_transaction_data)
transaction
The method used to refund full transaction amount. You can get transaction title from 'create' method when generating the transaction.<br/><br/><b>NOTICE:</b> This method works only in production mode!<br/>To test this method, you need to create the transaction in production mode with your own API access.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**refund_transaction_data** | Option<[**RefundTransactionFields**](RefundTransactionFields.md)> | Request body. | |
### Return type
[**crate::models::RefundAnyResponse**](refund_any_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_gw_api_key_transaction_blik_post
> crate::models::BlikResponse api_gw_api_key_transaction_blik_post(api_key, blik_data)
blik
This method allows sending a BLIK code in direct communication between merchant and BLIK system. In create method you should set 150 as a value for parameter group, this is a BLIK payment channel. Method returns parameter result equal to 1 which means that payment popup has been successfully displayed at customer mobile application. After accepting payment by the customer, tpay.com system sends a standard notification to merchant's endpoint declared in wyn_url parameter (this parameter should be sent in 'create' method.)<br/><br/><b>NOTICE:</b> to test this method, you need to create the transaction with 'create' method and replace title parameter value with the returned title.<br/>Blik method works with the specific set of parameters depending on payment type case. Please see BLIK workflow section.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**blik_data** | Option<[**BlikFields**](BlikFields.md)> | Request body. | |
### Return type
[**crate::models::BlikResponse**](blik_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_gw_api_key_transaction_create_post
> crate::models::CreateResponse api_gw_api_key_transaction_create_post(api_key, basic_data)
create
This method allows you to prepare transaction for a customer. The method returns transaction title required for other API methods and redirection link for a customer.<br/>This method also returns account details for manual money transfers.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**basic_data** | Option<[**CreateFields**](CreateFields.md)> | Transaction data. | |
### Return type
[**crate::models::CreateResponse**](create_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_gw_api_key_transaction_get_post
> crate::models::GetResponse api_gw_api_key_transaction_get_post(api_key, get_data)
get
This method allows you to get all information about the transaction by sending previously generated title.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**get_data** | Option<[**GetFields**](GetFields.md)> | Request body. | |
### Return type
[**crate::models::GetResponse**](get_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## api_gw_api_key_transaction_report_post
> crate::models::ReportResponse api_gw_api_key_transaction_report_post(api_key, report_data)
report
This method returns payments report for the declared time range, generated in CSV format (semicolon separators) and encoded in base64 - the same format as in merchant panel. If you like to arrange result as an associative array, you can use the ready <a href=\"https://github.com/tpay-com/tpay-php/blob/master/tpayLibs/examples/TransactionReportsApi.php\" target=\"_blank\">script</a> from Tpay PHP library.
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**api_key** | **String** | The api key. | [required] |
**report_data** | Option<[**ReportFields**](ReportFields.md)> | Request body. | |
### Return type
[**crate::models::ReportResponse**](report_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -0,0 +1,10 @@
# TransactionErrorCodes
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

23
vendor/t_pay/docs/TransfersObject.md vendored Normal file
View File

@ -0,0 +1,23 @@
# TransfersObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**date** | Option<**String**> | Date of creating payment | [optional]
**auth_date** | Option<**String**> | Date of payment authorization (method authorize). Field can be empty. | [optional]
**acc_date** | Option<**String**> | Date of posting payment | [optional]
**status** | Option<**String**> | Payment status | [optional]
**accnum** | Option<**String**> | Bank account number (format IBAN, 26 digits) | [optional]
**rcv1** | Option<**String**> | Receiver name (first part) | [optional]
**rcv2** | Option<**String**> | Receiver name (second part) | [optional]
**rcv3** | Option<**String**> | Receiver name (third part) | [optional]
**rcv4** | Option<**String**> | Receiver name (fourth part) | [optional]
**amount** | Option<**f32**> | transaction amount casted to float | [optional]
**title1** | Option<**String**> | Payment title (first part) | [optional]
**title2** | Option<**String**> | Payment title (second part) | [optional]
**tr_id** | Option<**f32**> | Payment ID in tpay.com system | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

16
vendor/t_pay/docs/VcFinishFields.md vendored Normal file
View File

@ -0,0 +1,16 @@
# VcFinishFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**api_password** | **String** | API password. |
**summary_data** | Option<[**Vec<crate::models::Array>**](array.md)> | Modified summary_data parameter received from visacheckout_prepare. Can be used, when the total amount or other parameters changea in the order process. | [optional]
**call_id** | **String** | Visa Checkout Call Id |
**language** | Option<[**crate::models::Language**](language.md)> | | [optional]
**sign** | **String** | Sign is calculated from cryptographic hash function set in Merchants Panel (default SHA-1): hash_alg (method + call_id + language + enable_pow_url + verification code) where + means concatenation. |
**enable_pow_url** | Option<**i32**> | If parameter was sent, system will redirect a cutomer to the merchant site after payment. 1 redirect Adress is set in Merchant Panel. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

14
vendor/t_pay/docs/VcPrepareFields.md vendored Normal file
View File

@ -0,0 +1,14 @@
# VcPrepareFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**api_password** | **String** | API password. |
**call_id** | **String** | Visa Checkout Call Id |
**language** | Option<[**crate::models::Language**](language.md)> | | [optional]
**sign** | **String** | Sign is calculated from cryptographic hash function set in Merchants Panel (default SHA-1): hash_alg (method + call_id + language + verification code) where + means concatenation. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

12
vendor/t_pay/docs/VcPrepareResponse.md vendored Normal file
View File

@ -0,0 +1,12 @@
# VcPrepareResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**result** | Option<[**crate::models::Result**](result.md)> | | [optional]
**summary_data** | Option<[**Vec<crate::models::Array>**](array.md)> | summary Visa Checkout data connected with passed Call Id | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

58
vendor/t_pay/git_push.sh vendored Normal file
View File

@ -0,0 +1,58 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host=""
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id=""
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id=""
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note=""
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

473
vendor/t_pay/src/apis/cards_api_api.rs vendored Normal file
View File

@ -0,0 +1,473 @@
/*
* 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
*/
use reqwest;
use super::{configuration, Error};
use crate::apis::ResponseContent;
/// struct for typed errors of method `api_cards_api_key_check_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiCardsApiKeyCheckPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_cards_api_key_deregister_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiCardsApiKeyDeregisterPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_cards_api_key_presale_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiCardsApiKeyPresalePostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_cards_api_key_refund_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiCardsApiKeyRefundPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_cards_api_key_register_sale_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiCardsApiKeyRegisterSalePostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_cards_api_key_sale_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiCardsApiKeySalePostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_cards_api_key_securesale_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiCardsApiKeySecuresalePostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_cards_api_key_visacheckout_finish_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiCardsApiKeyVisacheckoutFinishPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_cards_api_key_visacheckout_prepare_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiCardsApiKeyVisacheckoutPreparePostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// Method, which can be used to ping our API server to establish a monitoring service on the Merchant system.
pub async fn api_cards_api_key_check_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::CheckFields>,
) -> Result<crate::models::CheckResponse, Error<ApiCardsApiKeyCheckPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/cards/{api_key}/check",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiCardsApiKeyCheckPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// The method used to deregister client credit card token from Tpay and Merchant system.<br/>A client can also do it himself from the link in an email after payment.<br/><br/>After successful deregistration Merchant will not be able anymore to charge client's card. Tpay system sends notification about this deregistration to merchant endpoint, defined in merchant panel settings.<br/><br/><b>NOTICE:</b> To test this method you need to generate client token and calculate sign with your own API access data.
pub async fn api_cards_api_key_deregister_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::DeregisterFields>,
) -> Result<serde_json::Value, Error<ApiCardsApiKeyDeregisterPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/cards/{api_key}/deregister",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiCardsApiKeyDeregisterPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// The method used to create a new sale for payment on demand. It can be called after receiving a notification with client registered token (cli_auth parameter). It can not be used if 'onetimer' parameter was sent in register_sale or client has unregistered (by the link in an email sent by tpay.com after registering clients credit card or by API).<br/><br/><b>Additional information</b> Please feel free to read detailed case study of <a href=\"https://support.tpay.com/en/case-study/wdrozenie-platnosci-rekurencyjnych-cyklicznych\" target=\"_blank\">Implementation of the recurrent payments</a>
pub async fn api_cards_api_key_presale_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::PresaleFields>,
) -> Result<crate::models::RegisterSaleResponse, Error<ApiCardsApiKeyPresalePostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/cards/{api_key}/presale",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiCardsApiKeyPresalePostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// The method used to transfer money back to the client. The refund can reference to chosen sale (sale_auth) or directly to the client (cli_auth).<br/><br/> In both cases, the amount is adjustable in parameter amount. If the only cli_auth is sent, the amount parameter is required. If sale_auth is passed amount and currency are not necessary - the system will take default values from the specified sale and make a full amount refund.<br/>If you pass the amount parameter and specific sale_auth, you can create more than one refund until the sum of all refunds reach the transaction amount. <br><br/> In test mode this method has 50% probability of success and the status parameter is picked randomly. <br/>
pub async fn api_cards_api_key_refund_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::RefundFields>,
) -> Result<crate::models::RefundResponse, Error<ApiCardsApiKeyRefundPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/cards/{api_key}/refund",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiCardsApiKeyRefundPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// The method used to create sale initialisation in tpay.com system. The successful request returns sale_auth used to redirect a client to transaction panel. <br><br>The parameter sale_auth can be used to redirect a client to payment transaction panel: <br> <b> https://secure.tpay.com/cards/ </b><br> with argument sale_auth passed with the POST or GET method. <br><br> <b>Test mode notice!</b><br> In test mode, the transaction panel offers multiple system answers. You can choose at the transaction panel (instead of making a real transaction) to accept or decline payment to test all paths. In production mode client will be directly redirected to payment gateway with credit card data form. <br> Notification about positive transaction status will be sent to result URL which is set in account settings.
pub async fn api_cards_api_key_register_sale_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::RegisterSaleFields>,
) -> Result<crate::models::RegisterSaleResponse, Error<ApiCardsApiKeyRegisterSalePostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/cards/{api_key}/register_sale",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiCardsApiKeyRegisterSalePostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// The method used to execute created sale with presale method. Sale defined with sale_auth can be executed only once. If the method is called second time with the same parameters, the system returns actual sale status - in parameter status - done for correct payment and declined for rejected payment. In that case, client card is not charged the second time. <br><br> Passed cli_auth has to match with cli_auth used while creating a sale in presale method. <br><br><b>Test mode notice!</b> The method will return correct status with 50% probability. The same concerns declined status. In this case, reason value is also randomly picked.
pub async fn api_cards_api_key_sale_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::SaleFields>,
) -> Result<crate::models::SaleResponse, Error<ApiCardsApiKeySalePostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/cards/{api_key}/sale",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiCardsApiKeySalePostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// This method allows Merchant to host payment form on his website and perform sale without any client redirection to tpay.com system. Securesale method supports 3D Secure validation which is an additional security layer for online credit and debit card transactions. This approach requires special security considerations. We support secure communication by encrypting card data (card number, validity date and cvv/cvs number) on the client side (javascript) with Merchant public RSA key and send it as one parameter (card) to our API gate. A valid SSL certificate on the Merchant domain is required. Application flow is presented below for clarification:<br/><br/> 1. Generate webpage with your public RSA key in javascript<br/> 2. Before sending payment form, insert new input with encrypted card data using your public key and clear inputs with card data so only encrypted data will be sent and submit form. <br/> 3. In backend prepare parameters and send them with securesale method <br/> 4. Inform client about payment result<br/> <br/> Card cypher is made from string<br/><br/> card number|expiry date(MM/YY or MM/YYYY)|cvv or cvc|host <br/><br/> eg. \"1234567891234567|05/17|123|https://merchantwebsite.com\" <br/><br/> We have published code samples, libraries and instructions to give some insights on the process - see https://github.com/tpay-com/tpay-php . The library used in the example has a limit of 117 input characters for encryption. <br/> <b>In production mode, this generated hash works only once and should always be generated even for the same card data.</b><br/><br/> There are two ways for performing payment<br/><br/> a) <b>Pay by card without 3D- Secure.</b> <br/> If input parameters are correct, request is processed correctly and the entered card does not have the 3D-Secure option enabled, method returns parameters in JSON format<br/><br/> b) <b>Pay by card with 3D-Secure.</b> <br/>If input parameters are correct, the request is processed correctly and the card has enabled the 3D-Secure, the method returns the 3ds_url parameter in JSON format. <br/><br/> An example 3ds URL is presented below <br/><br/> https://secure.tpay.com/cards/?sale_auth=2587bf3a98dfa699ef9d01eba38359b7 <br/><br/> • The best way to implement 3DS is to open a link to 3D-Secure authentication in a new window. If this method is used, parameter \"enable_pow_url\" should be sent with value 1. After a correct authorization, a customer will be redirected to the Merchants Site. Return URL is set in Merchants Panel or sent dynamically. <br/><br/> • Do not use an inline frame to implement the 3D-Secure authentication on Merchants Site. In this case, some banks can block 3DS authorisation. <br/><br/> The parameters are sent with POST method. Merchant system has to respond to the notification by printing array in JSON format.<br/> See Card's notifications section.<br/><br/> <b>Test mode notice!</b> <br/>In test mode, transaction panel offers the choice of system answer for transactions with 3D-Secure authentication. You can choose to accept or decline payment to test all paths.<br/><br/><b>Additional information</b> Please feel free to read detailed case study of <a href=\"https://support.tpay.com/en/case-study/wdrozenie-bramki-platnosci-kartami-na-stronie-sklepu\" target=\"_blank\">Implementation of the card payment gateway at the store's website<a/>
pub async fn api_cards_api_key_securesale_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::SecuresaleFields>,
) -> Result<crate::models::SecuresaleResponse, Error<ApiCardsApiKeySecuresalePostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/cards/{api_key}/securesale",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiCardsApiKeySecuresalePostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// The Method used to finish Visa Checkout payment. <br/><br/> Summary_data has format compliant with Visa Checkout Summary Payment Data. Its structure is described in Visa Checkout documentation at <a href=\"https://developer.visa.com/products/visa_checkout/guides#extracting-consumer-data\">extracting-consumer-data</a><br><br/> The example table with this format can be found at <a href=\"https://developer.visa.com/capabilities/visa_checkout/docs#pdfs_for_merchants_integrating_with_visa_checkout\">Link</a> <br><br>When some data change between visacheckout_prepare and visacheckout_finish, you should send the modified data with the summary_data table. You can only send to tpay.com the data, which changes (i.e. only the amount ) but you need to send it in the summary_data JSON structure. <br/>Other fields if not changed dont have to be sent.<br/> The response format is the same as in SecureSale method - see the method for more details.<br/><br/><b>NOTICE:</b> To use Visa Checkout methods, you need to have access to cards API at your account and pass Visa requirements (see Visa Checkout Integration section).
pub async fn api_cards_api_key_visacheckout_finish_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::VcFinishFields>,
) -> Result<crate::models::SecuresaleResponse, Error<ApiCardsApiKeyVisacheckoutFinishPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/cards/{api_key}/visacheckout_finish",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiCardsApiKeyVisacheckoutFinishPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// The method used to prepare Visa Checkout payment. <br/><br/><b>NOTICE:</b> To use Visa Checkout methods, you need to have access to cards API at your account and pass Visa requirements (see Visa Checkout Integration section).
pub async fn api_cards_api_key_visacheckout_prepare_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::VcPrepareFields>,
) -> Result<crate::models::VcPrepareResponse, Error<ApiCardsApiKeyVisacheckoutPreparePostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/cards/{api_key}/visacheckout_prepare",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiCardsApiKeyVisacheckoutPreparePostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}

51
vendor/t_pay/src/apis/configuration.rs vendored Normal file
View File

@ -0,0 +1,51 @@
/*
* 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
*/
use reqwest;
#[derive(Debug, Clone)]
pub struct Configuration {
pub base_path: String,
pub user_agent: Option<String>,
pub client: reqwest::Client,
pub basic_auth: Option<BasicAuth>,
pub oauth_access_token: Option<String>,
pub bearer_access_token: Option<String>,
pub api_key: Option<ApiKey>,
// TODO: take an oauth2 token source, similar to the go one
}
pub type BasicAuth = (String, Option<String>);
#[derive(Debug, Clone)]
pub struct ApiKey {
pub prefix: Option<String>,
pub key: String,
}
impl Configuration {
pub fn new() -> Configuration {
Configuration::default()
}
}
impl Default for Configuration {
fn default() -> Self {
Configuration {
base_path: "https://docs.tpay.com/Proxy.php".to_owned(),
user_agent: Some("OpenAPI-Generator/1.2.1/rust".to_owned()),
client: reqwest::Client::new(),
basic_auth: None,
oauth_access_token: None,
bearer_access_token: None,
api_key: None,
}
}
}

View File

@ -0,0 +1,225 @@
/*
* 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
*/
use reqwest;
use super::{configuration, Error};
use crate::apis::ResponseContent;
/// struct for typed errors of method `api_gw_api_key_masspayment_authorize_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyMasspaymentAuthorizePostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_gw_api_key_masspayment_create_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyMasspaymentCreatePostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_gw_api_key_masspayment_packs_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyMasspaymentPacksPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_gw_api_key_masspayment_transfers_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyMasspaymentTransfersPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// This method authorizes the processing of chosen pack of transfers.
pub async fn api_gw_api_key_masspayment_authorize_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::MasspaymentAuthorizeFields>,
) -> Result<
crate::models::MasspaymentAuthorizeResponse,
Error<ApiGwApiKeyMasspaymentAuthorizePostError>,
> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/masspayment/authorize",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyMasspaymentAuthorizePostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// This method adds a pack of transfers to the Tpay system. After executing a correct operation, you need to request authorize method to confirm payout processing. Transfers are being made once a day on workdays. You can find confirmation code in Merchant Panel, settings tab-> notifications. Variable $seller_id is Merchants ID in tpay.com system. <br/><br/> <b>Example CSV file</b><br/> Each line contains one transfer formatted as in the example below. Columns are separated by a semicolon. <br/> The file does not have a header.<br/><br/> account number (26 digits);receiver (part 1) (35 characters);receiver (part 2) (35 characters);receiver (part 3) (35 characters);receiver (part 4) (35 characters);amount (dot or comma separator);title (part 1) (35 characters);title (part 2) (35 characters);Tpay transaction ID<br/><br/> Place transfer receiver name in 1-4 receiver fields. Each field can be maximum 35 characters long.<br/> If receiver name is for example 40 characters long, you should put 35 in receiver 1 field, and 5 characters in receiver 2 field.<br/> The same rule is valid for title field. The transaction ID field is not required, whithout this field, the file format looks like this: <br/><br/> account number (26 digits);receiver (part 1) (35 characters);receiver (part 2) (35 characters);receiver (part 3) (35 characters);receiver (part 4) (35 characters);amount (dot or comma separator);title (part 1) (35 characters);title (part 2) (35 characters);Transaction ID from merchant system<br/><br/> Example CSV file can be downloaded from:<br/> <a href=\"https://secure.tpay.com/partner/pliki/przyklad.csv\" target=\"_blank\">Download</a>
pub async fn api_gw_api_key_masspayment_create_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::MasspaymentCreateFields>,
) -> Result<crate::models::MasspaymentCreateResponse, Error<ApiGwApiKeyMasspaymentCreatePostError>>
{
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/masspayment/create",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyMasspaymentCreatePostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// This method allows browsing through created packages. If none of the parameters has been sent, all packages for the Merchants account will be returned. If any records exist, there will be pack objects in pack section representing respective transfer packages. You can send pack_id to browse contents of specific pack or send time range to browse all packages within time range
pub async fn api_gw_api_key_masspayment_packs_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::MasspaymentPacksFields>,
) -> Result<crate::models::MasspaymentPacksResponse, Error<ApiGwApiKeyMasspaymentPacksPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/masspayment/packs",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyMasspaymentPacksPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// This method allows browsing through transfers within one package. Required parameters (besides those described in mass payments main description), at least 1 is obligatory. If any records exist, there will be transfer objects in transfers section representing several transfers.
pub async fn api_gw_api_key_masspayment_transfers_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::MasspaymentTransfersFields>,
) -> Result<
crate::models::MasspaymentTransfersResponse,
Error<ApiGwApiKeyMasspaymentTransfersPostError>,
> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/masspayment/transfers",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyMasspaymentTransfersPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}

68
vendor/t_pay/src/apis/mod.rs vendored Normal file
View File

@ -0,0 +1,68 @@
use std::error;
use std::fmt;
#[derive(Debug, Clone)]
pub struct ResponseContent<T> {
pub status: reqwest::StatusCode,
pub content: String,
pub entity: Option<T>,
}
#[derive(Debug)]
pub enum Error<T> {
Reqwest(reqwest::Error),
Serde(serde_json::Error),
Io(std::io::Error),
ResponseError(ResponseContent<T>),
}
impl<T> fmt::Display for Error<T> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let (module, e) = match self {
Error::Reqwest(e) => ("reqwest", e.to_string()),
Error::Serde(e) => ("serde", e.to_string()),
Error::Io(e) => ("IO", e.to_string()),
Error::ResponseError(e) => ("response", format!("status code {}", e.status)),
};
write!(f, "error in {}: {}", module, e)
}
}
impl<T: fmt::Debug> error::Error for Error<T> {
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
Some(match self {
Error::Reqwest(e) => e,
Error::Serde(e) => e,
Error::Io(e) => e,
Error::ResponseError(_) => return None,
})
}
}
impl<T> From<reqwest::Error> for Error<T> {
fn from(e: reqwest::Error) -> Self {
Error::Reqwest(e)
}
}
impl<T> From<serde_json::Error> for Error<T> {
fn from(e: serde_json::Error) -> Self {
Error::Serde(e)
}
}
impl<T> From<std::io::Error> for Error<T> {
fn from(e: std::io::Error) -> Self {
Error::Io(e)
}
}
pub fn urlencode<T: AsRef<str>>(s: T) -> String {
::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect()
}
pub mod cards_api_api;
pub mod masspayments_api;
pub mod transaction_api_api;
pub mod configuration;

View File

@ -0,0 +1,371 @@
/*
* 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
*/
use reqwest;
use super::{configuration, Error};
use crate::apis::ResponseContent;
/// struct for typed errors of method `api_gw_api_key_chargeback_any_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyChargebackAnyPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_gw_api_key_chargeback_status_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyChargebackStatusPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_gw_api_key_chargeback_transaction_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyChargebackTransactionPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_gw_api_key_transaction_blik_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyTransactionBlikPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_gw_api_key_transaction_create_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyTransactionCreatePostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_gw_api_key_transaction_get_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyTransactionGetPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method `api_gw_api_key_transaction_report_post`
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ApiGwApiKeyTransactionReportPostError {
Status401(),
Status404(),
UnknownValue(serde_json::Value),
}
/// The method used to refund part of the transaction amount. <br/><br/><b>NOTICE:</b> This method works only in production mode!<br/>To test this method, you need to create the transaction in production mode with your own API access.
pub async fn api_gw_api_key_chargeback_any_post(
configuration: &configuration::Configuration,
api_key: &str,
refund_any_data: Option<crate::models::RefundAnyFields>,
) -> Result<crate::models::RefundAnyResponse, Error<ApiGwApiKeyChargebackAnyPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/chargeback/any",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&refund_any_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyChargebackAnyPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// The method used to check transaction refunds statuses.<br/>Some refunds statuses may be not available immediately after calling refund methods due to gathering refund details process.
pub async fn api_gw_api_key_chargeback_status_post(
configuration: &configuration::Configuration,
api_key: &str,
refund_transaction_data: Option<crate::models::RefundTransactionFields>,
) -> Result<crate::models::RefundStatusResponse, Error<ApiGwApiKeyChargebackStatusPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/chargeback/status",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&refund_transaction_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyChargebackStatusPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// The method used to refund full transaction amount. You can get transaction title from 'create' method when generating the transaction.<br/><br/><b>NOTICE:</b> This method works only in production mode!<br/>To test this method, you need to create the transaction in production mode with your own API access.
pub async fn api_gw_api_key_chargeback_transaction_post(
configuration: &configuration::Configuration,
api_key: &str,
refund_transaction_data: Option<crate::models::RefundTransactionFields>,
) -> Result<crate::models::RefundAnyResponse, Error<ApiGwApiKeyChargebackTransactionPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/chargeback/transaction",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&refund_transaction_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyChargebackTransactionPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// This method allows sending a BLIK code in direct communication between merchant and BLIK system. In create method you should set 150 as a value for parameter group, this is a BLIK payment channel. Method returns parameter result equal to 1 which means that payment popup has been successfully displayed at customer mobile application. After accepting payment by the customer, tpay.com system sends a standard notification to merchant's endpoint declared in wyn_url parameter (this parameter should be sent in 'create' method.)<br/><br/><b>NOTICE:</b> to test this method, you need to create the transaction with 'create' method and replace title parameter value with the returned title.<br/>Blik method works with the specific set of parameters depending on payment type case. Please see BLIK workflow section.
pub async fn api_gw_api_key_transaction_blik_post(
configuration: &configuration::Configuration,
api_key: &str,
blik_data: Option<crate::models::BlikFields>,
) -> Result<crate::models::BlikResponse, Error<ApiGwApiKeyTransactionBlikPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/transaction/blik",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&blik_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyTransactionBlikPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// This method allows you to prepare transaction for a customer. The method returns transaction title required for other API methods and redirection link for a customer.<br/>This method also returns account details for manual money transfers.
pub async fn api_gw_api_key_transaction_create_post(
configuration: &configuration::Configuration,
api_key: &str,
basic_data: Option<crate::models::CreateFields>,
) -> Result<crate::models::CreateResponse, Error<ApiGwApiKeyTransactionCreatePostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/transaction/create",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&basic_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyTransactionCreatePostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// This method allows you to get all information about the transaction by sending previously generated title.
pub async fn api_gw_api_key_transaction_get_post(
configuration: &configuration::Configuration,
api_key: &str,
get_data: Option<crate::models::GetFields>,
) -> Result<crate::models::GetResponse, Error<ApiGwApiKeyTransactionGetPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/transaction/get",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&get_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyTransactionGetPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}
/// This method returns payments report for the declared time range, generated in CSV format (semicolon separators) and encoded in base64 - the same format as in merchant panel. If you like to arrange result as an associative array, you can use the ready <a href=\"https://github.com/tpay-com/tpay-php/blob/master/tpayLibs/examples/TransactionReportsApi.php\" target=\"_blank\">script</a> from Tpay PHP library.
pub async fn api_gw_api_key_transaction_report_post(
configuration: &configuration::Configuration,
api_key: &str,
report_data: Option<crate::models::ReportFields>,
) -> Result<crate::models::ReportResponse, Error<ApiGwApiKeyTransactionReportPostError>> {
let local_var_client = &configuration.client;
let local_var_uri_str = format!(
"{}/api/gw/{api_key}/transaction/report",
configuration.base_path,
api_key = crate::apis::urlencode(api_key)
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = configuration.user_agent {
local_var_req_builder =
local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&report_data);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ApiGwApiKeyTransactionReportPostError> =
serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Err(Error::ResponseError(local_var_error))
}
}

10
vendor/t_pay/src/lib.rs vendored Normal file
View File

@ -0,0 +1,10 @@
#[macro_use]
extern crate serde_derive;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate url;
pub mod apis;
pub mod models;

39
vendor/t_pay/src/models/blik_alias.rs vendored Normal file
View File

@ -0,0 +1,39 @@
/*
* 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 BlikAlias {
/// alias generated in merchant system (unique for each customer)
#[serde(rename = "value", skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
/// Alias type
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub _type: Option<Type>,
/// This field should contain alias key (returned by first api call with error ERR82) in case of using non-unique alias
#[serde(rename = "key", skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
}
impl BlikAlias {
pub fn new() -> BlikAlias {
BlikAlias {
value: None,
_type: None,
key: None,
}
}
}
/// Alias type
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "UID")]
UID,
}

View File

@ -0,0 +1,31 @@
/*
* 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
*/
/// BlikAliasResponse : Array containing list of banks associated with this alias
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct BlikAliasResponse {
/// Alias user friendly name saved at mobile app (blik request label parameter)
#[serde(rename = "applicationName", skip_serializing_if = "Option::is_none")]
pub application_name: Option<String>,
/// Alias key which has to be send in case of using non-unique alias
#[serde(rename = "applicationCode", skip_serializing_if = "Option::is_none")]
pub application_code: Option<String>,
}
impl BlikAliasResponse {
/// Array containing list of banks associated with this alias
pub fn new() -> BlikAliasResponse {
BlikAliasResponse {
application_name: None,
application_code: None,
}
}
}

40
vendor/t_pay/src/models/blik_fields.rs vendored Normal file
View File

@ -0,0 +1,40 @@
/*
* 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 BlikFields {
/// Transaction title
#[serde(rename = "title")]
pub title: String,
/// 6 digit code generated in customer bank mobile app (required if customer does not have registered alias or when customer does not want to pay by regietered device). BLIK code contains only digits but can start with zero or multiple zeroes, so you must not cast this variable to int.
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
/// API password.
#[serde(rename = "api_password")]
pub api_password: String,
/// Mandatory field when creating oneClick transactions, optional for standart Blik transactions with 6 digit code. In case of alias registration attempt you can send only 1 alias per 1 request.
#[serde(rename = "alias", skip_serializing_if = "Option::is_none")]
pub alias: Option<Vec<crate::models::BlikAlias>>,
/// Transaction type. 0 - WEB mode (default value). 1 - POS mode dedicated for payment terminals
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub _type: Option<i32>,
}
impl BlikFields {
pub fn new(title: String, api_password: String) -> BlikFields {
BlikFields {
title,
code: None,
api_password,
alias: None,
_type: None,
}
}
}

View File

@ -0,0 +1,30 @@
/*
* 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 BlikResponse {
/// Attention! result: 1 does not indicate transfer of funds! This is successful user app popup indicator.
#[serde(rename = "result", skip_serializing_if = "Option::is_none")]
pub result: Option<i32>,
#[serde(rename = "availableUserApps", skip_serializing_if = "Option::is_none")]
pub available_user_apps: Option<Vec<crate::models::BlikAliasResponse>>,
#[serde(rename = "err", skip_serializing_if = "Option::is_none")]
pub err: Option<crate::models::TransactionErrorCodes>,
}
impl BlikResponse {
pub fn new() -> BlikResponse {
BlikResponse {
result: None,
available_user_apps: None,
err: None,
}
}
}

View File

@ -0,0 +1,77 @@
/*
* 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
*/
/// CardsErrCode : Error code number if an error occurs or not present in response.
/// Error code number if an error occurs or not present in response.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CardsErrCode {
#[serde(rename = "1")]
_1,
#[serde(rename = "2")]
_2,
#[serde(rename = "3")]
_3,
#[serde(rename = "4")]
_4,
#[serde(rename = "5")]
_5,
#[serde(rename = "6")]
_6,
#[serde(rename = "7")]
_7,
#[serde(rename = "8")]
_8,
#[serde(rename = "9")]
_9,
#[serde(rename = "10")]
_10,
#[serde(rename = "11")]
_11,
#[serde(rename = "12")]
_12,
#[serde(rename = "13")]
_13,
#[serde(rename = "14")]
_14,
#[serde(rename = "15")]
_15,
#[serde(rename = "16")]
_16,
#[serde(rename = "17")]
_17,
#[serde(rename = "18")]
_18,
}
impl ToString for CardsErrCode {
fn to_string(&self) -> String {
match self {
Self::_1 => String::from("1"),
Self::_2 => String::from("2"),
Self::_3 => String::from("3"),
Self::_4 => String::from("4"),
Self::_5 => String::from("5"),
Self::_6 => String::from("6"),
Self::_7 => String::from("7"),
Self::_8 => String::from("8"),
Self::_9 => String::from("9"),
Self::_10 => String::from("10"),
Self::_11 => String::from("11"),
Self::_12 => String::from("12"),
Self::_13 => String::from("13"),
Self::_14 => String::from("14"),
Self::_15 => String::from("15"),
Self::_16 => String::from("16"),
Self::_17 => String::from("17"),
Self::_18 => String::from("18"),
}
}
}

View File

@ -0,0 +1,46 @@
/*
* 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 ChargebackStatus {
/// Chargeback title in Tpay.com system
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
/// Chargeback creation time
#[serde(rename = "date", skip_serializing_if = "Option::is_none")]
pub date: Option<String>,
/// Refunded amount
#[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
pub amount: Option<f32>,
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
}
impl ChargebackStatus {
pub fn new() -> ChargebackStatus {
ChargebackStatus {
title: None,
date: None,
amount: None,
status: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "completed")]
Completed,
#[serde(rename = "pending")]
Pending,
#[serde(rename = "incorrect")]
Incorrect,
}

22
vendor/t_pay/src/models/check_fields.rs vendored Normal file
View File

@ -0,0 +1,22 @@
/*
* 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 CheckFields {
/// API password.
#[serde(rename = "api_password", skip_serializing_if = "Option::is_none")]
pub api_password: Option<String>,
}
impl CheckFields {
pub fn new() -> CheckFields {
CheckFields { api_password: None }
}
}

View File

@ -0,0 +1,26 @@
/*
* 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 CheckResponse {
#[serde(rename = "result", skip_serializing_if = "Option::is_none")]
pub result: Option<crate::models::Result>,
#[serde(rename = "content", skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
}
impl CheckResponse {
pub fn new() -> CheckResponse {
CheckResponse {
result: None,
content: None,
}
}
}

131
vendor/t_pay/src/models/create_fields.rs vendored Normal file
View File

@ -0,0 +1,131 @@
/*
* 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 CreateFields {
/// Merchant ID in Tpay.com system
#[serde(rename = "id")]
pub id: i32,
/// Transaction amount. Please always send the amount with two decimal places like 10.00
#[serde(rename = "amount")]
pub amount: f32,
/// Transaction description
#[serde(rename = "description")]
pub description: String,
/// Auxiliary parameter to identify the transaction on the merchant side. We do recommend to encode your crc value in base64. The exact value of crc used to create transaction will be returned in tpay payment notification as tr_crc parameter.
#[serde(rename = "crc", skip_serializing_if = "Option::is_none")]
pub crc: Option<String>,
/// md5 sum calculated from id.'&'.amount.'&'.crc.'&'.security_code where dots means concatenation (security code can be found in merchant panel).
#[serde(rename = "md5sum")]
pub md5sum: String,
/// Transaction group number see the \"id\" element in https://secure.tpay.com/groups-{id}0.js . For example https://secure.tpay.com/groups-10100.js or https://secure.tpay.com/groups-10100.js?json
#[serde(rename = "group")]
pub group: i32,
/// Merchant endpoint for payment notification
#[serde(rename = "result_url", skip_serializing_if = "Option::is_none")]
pub result_url: Option<String>,
/// Email address where notification after payment will be sent (overrides defined in merchant panel). You can add more addresses by comma concatenation.
#[serde(rename = "result_email", skip_serializing_if = "Option::is_none")]
pub result_email: Option<String>,
/// Name of merchant displayed in transaction panel (overrides defined in merchant panel)
#[serde(
rename = "merchant_description",
skip_serializing_if = "Option::is_none"
)]
pub merchant_description: Option<String>,
/// Additional info to be displayed in transaction panel (overrides defined in merchant panel)
#[serde(rename = "custom_description", skip_serializing_if = "Option::is_none")]
pub custom_description: Option<String>,
/// url to redirect customer in case of payment success
#[serde(rename = "return_url", skip_serializing_if = "Option::is_none")]
pub return_url: Option<String>,
/// url to redirect customer in case of payment failure
#[serde(rename = "return_error_url", skip_serializing_if = "Option::is_none")]
pub return_error_url: Option<String>,
/// Customer language
#[serde(rename = "language", skip_serializing_if = "Option::is_none")]
pub language: Option<Language>,
/// customer email
#[serde(rename = "email")]
pub email: String,
/// customer name
#[serde(rename = "name")]
pub name: String,
/// customer address (parameter is empty if this field was not send with create method)
#[serde(rename = "address", skip_serializing_if = "Option::is_none")]
pub address: Option<String>,
/// customer city (parameter is empty if this field was not send with create method)
#[serde(rename = "city", skip_serializing_if = "Option::is_none")]
pub city: Option<String>,
/// customer postal code (parameter is empty if this field was not send with create method)
#[serde(rename = "zip", skip_serializing_if = "Option::is_none")]
pub zip: Option<String>,
/// Two letters - see ISO 3166-1 document
#[serde(rename = "country", skip_serializing_if = "Option::is_none")]
pub country: Option<String>,
/// customer phone number (parameter is empty if this field was not send with create method)
#[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
pub phone: Option<String>,
/// Acceptance of Tpay.com regulations done by customer on Merchant site
#[serde(rename = "accept_tos", skip_serializing_if = "Option::is_none")]
pub accept_tos: Option<i32>,
/// API password.
#[serde(rename = "api_password")]
pub api_password: String,
}
impl CreateFields {
pub fn new(
id: i32,
amount: f32,
description: String,
md5sum: String,
group: i32,
email: String,
name: String,
api_password: String,
) -> CreateFields {
CreateFields {
id,
amount,
description,
crc: None,
md5sum,
group,
result_url: None,
result_email: None,
merchant_description: None,
custom_description: None,
return_url: None,
return_error_url: None,
language: None,
email,
name,
address: None,
city: None,
zip: None,
country: None,
phone: None,
accept_tos: None,
api_password,
}
}
}
/// Customer language
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Language {
#[serde(rename = "pl")]
Pl,
#[serde(rename = "en")]
En,
#[serde(rename = "de")]
De,
}

View File

@ -0,0 +1,50 @@
/*
* 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 CreateResponse {
#[serde(rename = "result")]
pub result: crate::models::Result,
#[serde(rename = "err", skip_serializing_if = "Option::is_none")]
pub err: Option<crate::models::TransactionErrorCodes>,
/// Transaction title
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
/// transaction amount casted to float
#[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
pub amount: Option<f32>,
/// bank account number (only for manual bank transfers)
#[serde(rename = "account_number", skip_serializing_if = "Option::is_none")]
pub account_number: Option<f32>,
/// Booking payments online indicator
#[serde(rename = "online", skip_serializing_if = "Option::is_none")]
pub online: Option<i32>,
/// Link to transaction (for redirecting to payment)
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
/// optional field, contains names of invalid fields.
#[serde(rename = "desc", skip_serializing_if = "Option::is_none")]
pub desc: Option<String>,
}
impl CreateResponse {
pub fn new(result: crate::models::Result) -> CreateResponse {
CreateResponse {
result,
err: None,
title: None,
amount: None,
account_number: None,
online: None,
url: None,
desc: None,
}
}
}

View File

@ -0,0 +1,35 @@
/*
* 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 DeregisterFields {
/// Client token
#[serde(rename = "cli_auth")]
pub cli_auth: String,
#[serde(rename = "language", skip_serializing_if = "Option::is_none")]
pub language: Option<crate::models::Language>,
/// API password.
#[serde(rename = "api_password")]
pub api_password: String,
/// Sign is calculated from cryptographic hash function set in Merchants Panel (default SHA-1): hash_alg (method + cli_auth + language + verification code) where + means concatenation with ampersand symbol. ie. cli_auth + language = t59c2810d59285e3e0ee9d1f1eda1c2f4c554e24&pl
#[serde(rename = "sign")]
pub sign: String,
}
impl DeregisterFields {
pub fn new(cli_auth: String, api_password: String, sign: String) -> DeregisterFields {
DeregisterFields {
cli_auth,
language: None,
api_password,
sign,
}
}
}

28
vendor/t_pay/src/models/get_fields.rs vendored Normal file
View File

@ -0,0 +1,28 @@
/*
* 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 GetFields {
/// Transaction title
#[serde(rename = "title")]
pub title: String,
/// API password.
#[serde(rename = "api_password")]
pub api_password: String,
}
impl GetFields {
pub fn new(title: String, api_password: String) -> GetFields {
GetFields {
title,
api_password,
}
}
}

126
vendor/t_pay/src/models/get_response.rs vendored Normal file
View File

@ -0,0 +1,126 @@
/*
* 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 GetResponse {
#[serde(rename = "result", skip_serializing_if = "Option::is_none")]
pub result: Option<crate::models::Result>,
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
/// Depending on setting in merchant panel, error_code may be different than none for correct status, when acceptance of overpays and surcharges has been set.
#[serde(rename = "error_code", skip_serializing_if = "Option::is_none")]
pub error_code: Option<ErrorCode>,
/// Transaction creation time
#[serde(rename = "start_time", skip_serializing_if = "Option::is_none")]
pub start_time: Option<String>,
/// Date of payment or empty for pending transactions
#[serde(rename = "payment_time", skip_serializing_if = "Option::is_none")]
pub payment_time: Option<String>,
/// Date of payment refund or empty for not refunded transactions
#[serde(rename = "chargeback_time", skip_serializing_if = "Option::is_none")]
pub chargeback_time: Option<String>,
/// Payment channel ID can be recognised in merchant panel (your offer section)
#[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
pub channel: Option<i32>,
/// Returns 1 if transaction was in test mode
#[serde(rename = "test_mode", skip_serializing_if = "Option::is_none")]
pub test_mode: Option<TestMode>,
/// transaction amount casted to float
#[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
pub amount: Option<f32>,
/// The amount paid by customer
#[serde(rename = "amount_paid", skip_serializing_if = "Option::is_none")]
pub amount_paid: Option<f32>,
/// customer name
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// customer email
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
/// customer address (parameter is empty if this field was not send with create method)
#[serde(rename = "address", skip_serializing_if = "Option::is_none")]
pub address: Option<String>,
/// customer postal code (parameter is empty if this field was not send with create method)
#[serde(rename = "code", skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
/// customer city (parameter is empty if this field was not send with create method)
#[serde(rename = "city", skip_serializing_if = "Option::is_none")]
pub city: Option<String>,
/// customer phone number (parameter is empty if this field was not send with create method)
#[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
pub phone: Option<String>,
/// Two letters - see ISO 3166-1 document
#[serde(rename = "country", skip_serializing_if = "Option::is_none")]
pub country: Option<String>,
#[serde(rename = "err", skip_serializing_if = "Option::is_none")]
pub err: Option<crate::models::TransactionErrorCodes>,
/// List of payment attempts. Currently is returned only for BLIK payment method
#[serde(rename = "paymentAttempts", skip_serializing_if = "Option::is_none")]
pub payment_attempts: Option<Vec<crate::models::PaymentAttempts>>,
}
impl GetResponse {
pub fn new() -> GetResponse {
GetResponse {
result: None,
status: None,
error_code: None,
start_time: None,
payment_time: None,
chargeback_time: None,
channel: None,
test_mode: None,
amount: None,
amount_paid: None,
name: None,
email: None,
address: None,
code: None,
city: None,
phone: None,
country: None,
err: None,
payment_attempts: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "correct")]
Correct,
#[serde(rename = "paid")]
Paid,
#[serde(rename = "pending")]
Pending,
#[serde(rename = "error")]
Error,
#[serde(rename = "chargeback")]
Chargeback,
}
/// Depending on setting in merchant panel, error_code may be different than none for correct status, when acceptance of overpays and surcharges has been set.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ErrorCode {
#[serde(rename = "none")]
None,
#[serde(rename = "overpay")]
Overpay,
#[serde(rename = "surcharge")]
Surcharge,
}
/// Returns 1 if transaction was in test mode
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TestMode {
#[serde(rename = "0")]
_0,
#[serde(rename = "1")]
_1,
}

62
vendor/t_pay/src/models/language.rs vendored Normal file
View File

@ -0,0 +1,62 @@
/*
* 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
*/
/// Language : language for 3DS gateway
/// language for 3DS gateway
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Language {
#[serde(rename = "pl")]
Pl,
#[serde(rename = "en")]
En,
#[serde(rename = "fr")]
Fr,
#[serde(rename = "es")]
Es,
#[serde(rename = "it")]
It,
#[serde(rename = "ru")]
Ru,
#[serde(rename = "de")]
De,
#[serde(rename = "uk")]
Uk,
#[serde(rename = "ro")]
Ro,
#[serde(rename = "hu")]
Hu,
#[serde(rename = "cs")]
Cs,
#[serde(rename = "bg")]
Bg,
#[serde(rename = "hr")]
Hr,
}
impl ToString for Language {
fn to_string(&self) -> String {
match self {
Self::Pl => String::from("pl"),
Self::En => String::from("en"),
Self::Fr => String::from("fr"),
Self::Es => String::from("es"),
Self::It => String::from("it"),
Self::Ru => String::from("ru"),
Self::De => String::from("de"),
Self::Uk => String::from("uk"),
Self::Ro => String::from("ro"),
Self::Hu => String::from("hu"),
Self::Cs => String::from("cs"),
Self::Bg => String::from("bg"),
Self::Hr => String::from("hr"),
}
}
}

View File

@ -0,0 +1,28 @@
/*
* 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 MasspaymentAuthorizeFields {
/// ID of created pack using method create.
#[serde(rename = "pack_id")]
pub pack_id: i32,
/// API password.
#[serde(rename = "api_password")]
pub api_password: String,
}
impl MasspaymentAuthorizeFields {
pub fn new(pack_id: i32, api_password: String) -> MasspaymentAuthorizeFields {
MasspaymentAuthorizeFields {
pack_id,
api_password,
}
}
}

View File

@ -0,0 +1,26 @@
/*
* 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 MasspaymentAuthorizeResponse {
#[serde(rename = "result", skip_serializing_if = "Option::is_none")]
pub result: Option<crate::models::Result>,
#[serde(rename = "error", skip_serializing_if = "Option::is_none")]
pub error: Option<crate::models::MasspaymentErrCode>,
}
impl MasspaymentAuthorizeResponse {
pub fn new() -> MasspaymentAuthorizeResponse {
MasspaymentAuthorizeResponse {
result: None,
error: None,
}
}
}

View File

@ -0,0 +1,32 @@
/*
* 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 MasspaymentCreateFields {
/// Transfers list encoded with base64. Format has been described in metchod description
#[serde(rename = "csv")]
pub csv: String,
/// API password.
#[serde(rename = "api_password")]
pub api_password: String,
/// Checksum to verify parameters received from Merchant. Generated according to outline below using SHA1 function: SHA1(seller_id + transfers list (before encrypting in base64) + Merchant confirmation code) Implementing checksum in PHP: sha1($seller_id. $csv . $confirmation_code)
#[serde(rename = "sign")]
pub sign: String,
}
impl MasspaymentCreateFields {
pub fn new(csv: String, api_password: String, sign: String) -> MasspaymentCreateFields {
MasspaymentCreateFields {
csv,
api_password,
sign,
}
}
}

View File

@ -0,0 +1,45 @@
/*
* 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 MasspaymentCreateResponse {
#[serde(rename = "result", skip_serializing_if = "Option::is_none")]
pub result: Option<crate::models::Result>,
/// Sum of transfers in the package
#[serde(rename = "sum", skip_serializing_if = "Option::is_none")]
pub sum: Option<f32>,
/// Number of transfers defined in CSV file
#[serde(rename = "count", skip_serializing_if = "Option::is_none")]
pub count: Option<i32>,
/// ID of created pack using method create.
#[serde(rename = "pack_id", skip_serializing_if = "Option::is_none")]
pub pack_id: Option<i32>,
/// Field visible if transfersID has been sent (see chap. \"Exemplary CSV file\") in JSON format as following: ID in transfer : ID of transfers in tpay.com system. This allows tracking single transfers.
#[serde(rename = "referers", skip_serializing_if = "Option::is_none")]
pub referers: Option<String>,
#[serde(rename = "error", skip_serializing_if = "Option::is_none")]
pub error: Option<crate::models::MasspaymentErrCode>,
#[serde(rename = "desc", skip_serializing_if = "Option::is_none")]
pub desc: Option<crate::models::MasspaymentErrDesc>,
}
impl MasspaymentCreateResponse {
pub fn new() -> MasspaymentCreateResponse {
MasspaymentCreateResponse {
result: None,
sum: None,
count: None,
pack_id: None,
referers: None,
error: None,
desc: None,
}
}
}

View File

@ -0,0 +1,96 @@
/*
* 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, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MasspaymentErrCode {
#[serde(rename = "ERR4")]
ERR4,
#[serde(rename = "ERR6")]
ERR6,
#[serde(rename = "ERR7")]
ERR7,
#[serde(rename = "ERR8")]
ERR8,
#[serde(rename = "ERR9")]
ERR9,
#[serde(rename = "ERR10")]
ERR10,
#[serde(rename = "ERR11")]
ERR11,
#[serde(rename = "ERR12")]
ERR12,
#[serde(rename = "ERR13")]
ERR13,
#[serde(rename = "ERR14")]
ERR14,
#[serde(rename = "ERR15")]
ERR15,
#[serde(rename = "ERR16")]
ERR16,
#[serde(rename = "ERR17")]
ERR17,
#[serde(rename = "ERR18")]
ERR18,
#[serde(rename = "ERR19")]
ERR19,
#[serde(rename = "ERR20")]
ERR20,
#[serde(rename = "ERR21")]
ERR21,
#[serde(rename = "ERR22")]
ERR22,
#[serde(rename = "ERR23")]
ERR23,
#[serde(rename = "ERR24")]
ERR24,
#[serde(rename = "ERR99")]
ERR99,
#[serde(rename = "ERR98")]
ERR98,
#[serde(rename = "ERR97")]
ERR97,
#[serde(rename = "ERR31")]
ERR31,
#[serde(rename = "ERR32")]
ERR32,
}
impl ToString for MasspaymentErrCode {
fn to_string(&self) -> String {
match self {
Self::ERR4 => String::from("ERR4"),
Self::ERR6 => String::from("ERR6"),
Self::ERR7 => String::from("ERR7"),
Self::ERR8 => String::from("ERR8"),
Self::ERR9 => String::from("ERR9"),
Self::ERR10 => String::from("ERR10"),
Self::ERR11 => String::from("ERR11"),
Self::ERR12 => String::from("ERR12"),
Self::ERR13 => String::from("ERR13"),
Self::ERR14 => String::from("ERR14"),
Self::ERR15 => String::from("ERR15"),
Self::ERR16 => String::from("ERR16"),
Self::ERR17 => String::from("ERR17"),
Self::ERR18 => String::from("ERR18"),
Self::ERR19 => String::from("ERR19"),
Self::ERR20 => String::from("ERR20"),
Self::ERR21 => String::from("ERR21"),
Self::ERR22 => String::from("ERR22"),
Self::ERR23 => String::from("ERR23"),
Self::ERR24 => String::from("ERR24"),
Self::ERR99 => String::from("ERR99"),
Self::ERR98 => String::from("ERR98"),
Self::ERR97 => String::from("ERR97"),
Self::ERR31 => String::from("ERR31"),
Self::ERR32 => String::from("ERR32"),
}
}
}

View File

@ -0,0 +1,124 @@
/*
* 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, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum MasspaymentErrDesc {
#[serde(rename = "File that has been sent is not CSV file")]
FileThatHasBeenSentIsNotCSVFile,
#[serde(rename = "Incorrect checksum (sign)")]
IncorrectChecksumSign,
#[serde(rename = "Incorrect line format")]
IncorrectLineFormat,
#[serde(rename = "Incorrect bank account number")]
IncorrectBankAccountNumber,
#[serde(rename = "Name of the receiver must not be empty")]
NameOfTheReceiverMustNotBeEmpty,
#[serde(rename = "Name of the receiver 1 is too long max, 35 characters")]
NameOfTheReceiver1IsTooLongMax35Characters,
#[serde(rename = "Name of the receiver 2 is too long max, 35 characters")]
NameOfTheReceiver2IsTooLongMax35Characters,
#[serde(rename = "Name of the receiver 3 is too long max, 35 characters")]
NameOfTheReceiver3IsTooLongMax35Characters,
#[serde(rename = "Name of the receiver 4 is too long max, 35 characters")]
NameOfTheReceiver4IsTooLongMax35Characters,
#[serde(rename = "Incorrect amount format")]
IncorrectAmountFormat,
#[serde(rename = "Payment title field must not be empty")]
PaymentTitleFieldMustNotBeEmpty,
#[serde(rename = "Payment title field 1 is too long max. 35 characters")]
PaymentTitleField1IsTooLongMax35Characters,
#[serde(rename = "Payment title field 2 is too long max. 35 characters")]
PaymentTitleField2IsTooLongMax35Characters,
#[serde(rename = "Internal error")]
InternalError,
#[serde(rename = "Failed to load CSV file")]
FailedToLoadCSVFile,
#[serde(rename = "Transfer processing error")]
TransferProcessingError,
#[serde(rename = "Incorrect pack_id or the package has not been found")]
IncorrectPackIdOrThePackageHasNotBeenFound,
#[serde(rename = "Package authorization error")]
PackageAuthorizationError,
#[serde(rename = "Insufficient funds for package autorization")]
InsufficientFundsForPackageAutorization,
#[serde(rename = "Package has already been authorized")]
PackageHasAlreadyBeenAuthorized,
#[serde(rename = "General error")]
GeneralError,
#[serde(rename = "Login error (incorrent key or api_password)")]
LoginErrorIncorrentKeyOrApiPassword,
#[serde(rename = "No such method")]
NoSuchMethod,
#[serde(rename = "Access disabled")]
AccessDisabled,
#[serde(rename = "Access denied (via Merchant Panel settings)")]
AccessDeniedViaMerchantPanelSettings,
}
impl ToString for MasspaymentErrDesc {
fn to_string(&self) -> String {
match self {
Self::FileThatHasBeenSentIsNotCSVFile => {
String::from("File that has been sent is not CSV file")
}
Self::IncorrectChecksumSign => String::from("Incorrect checksum (sign)"),
Self::IncorrectLineFormat => String::from("Incorrect line format"),
Self::IncorrectBankAccountNumber => String::from("Incorrect bank account number"),
Self::NameOfTheReceiverMustNotBeEmpty => {
String::from("Name of the receiver must not be empty")
}
Self::NameOfTheReceiver1IsTooLongMax35Characters => {
String::from("Name of the receiver 1 is too long max, 35 characters")
}
Self::NameOfTheReceiver2IsTooLongMax35Characters => {
String::from("Name of the receiver 2 is too long max, 35 characters")
}
Self::NameOfTheReceiver3IsTooLongMax35Characters => {
String::from("Name of the receiver 3 is too long max, 35 characters")
}
Self::NameOfTheReceiver4IsTooLongMax35Characters => {
String::from("Name of the receiver 4 is too long max, 35 characters")
}
Self::IncorrectAmountFormat => String::from("Incorrect amount format"),
Self::PaymentTitleFieldMustNotBeEmpty => {
String::from("Payment title field must not be empty")
}
Self::PaymentTitleField1IsTooLongMax35Characters => {
String::from("Payment title field 1 is too long max. 35 characters")
}
Self::PaymentTitleField2IsTooLongMax35Characters => {
String::from("Payment title field 2 is too long max. 35 characters")
}
Self::InternalError => String::from("Internal error"),
Self::FailedToLoadCSVFile => String::from("Failed to load CSV file"),
Self::TransferProcessingError => String::from("Transfer processing error"),
Self::IncorrectPackIdOrThePackageHasNotBeenFound => {
String::from("Incorrect pack_id or the package has not been found")
}
Self::PackageAuthorizationError => String::from("Package authorization error"),
Self::InsufficientFundsForPackageAutorization => {
String::from("Insufficient funds for package autorization")
}
Self::PackageHasAlreadyBeenAuthorized => {
String::from("Package has already been authorized")
}
Self::GeneralError => String::from("General error"),
Self::LoginErrorIncorrentKeyOrApiPassword => {
String::from("Login error (incorrent key or api_password)")
}
Self::NoSuchMethod => String::from("No such method"),
Self::AccessDisabled => String::from("Access disabled"),
Self::AccessDeniedViaMerchantPanelSettings => {
String::from("Access denied (via Merchant Panel settings)")
}
}
}
}

View File

@ -0,0 +1,36 @@
/*
* 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 MasspaymentPacksFields {
/// ID of created pack using method create.
#[serde(rename = "pack_id", skip_serializing_if = "Option::is_none")]
pub pack_id: Option<i32>,
/// Creation date of pack created with method create.
#[serde(rename = "from_date", skip_serializing_if = "Option::is_none")]
pub from_date: Option<String>,
/// Ending date of pack created with method create.
#[serde(rename = "to_date", skip_serializing_if = "Option::is_none")]
pub to_date: Option<String>,
/// API password.
#[serde(rename = "api_password")]
pub api_password: String,
}
impl MasspaymentPacksFields {
pub fn new(api_password: String) -> MasspaymentPacksFields {
MasspaymentPacksFields {
pack_id: None,
from_date: None,
to_date: None,
api_password,
}
}
}

View File

@ -0,0 +1,29 @@
/*
* 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 MasspaymentPacksResponse {
#[serde(rename = "result", skip_serializing_if = "Option::is_none")]
pub result: Option<crate::models::Result>,
#[serde(rename = "packs", skip_serializing_if = "Option::is_none")]
pub packs: Option<Vec<crate::models::PacksObject>>,
#[serde(rename = "error", skip_serializing_if = "Option::is_none")]
pub error: Option<crate::models::MasspaymentErrCode>,
}
impl MasspaymentPacksResponse {
pub fn new() -> MasspaymentPacksResponse {
MasspaymentPacksResponse {
result: None,
packs: None,
error: None,
}
}
}

Some files were not shown because too many files have changed in this diff Show More