From 4bc914b6dff428fbfa360d82c79ef9ecfdd64032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Wo=C5=BAniak?= Date: Wed, 8 Jun 2022 15:22:43 +0200 Subject: [PATCH] Test orders, add missing field in order --- .env | 3 + Cargo.lock | 12 + Cargo.toml | 2 + .../database_manager/src/order_addresses.rs | 122 ++++- actors/database_manager/src/order_items.rs | 236 ++++++++- actors/database_manager/src/orders.rs | 56 ++- actors/database_manager/src/products.rs | 62 ++- actors/order_manager/src/lib.rs | 1 + actors/payment_manager/src/lib.rs | 3 + .../payment_manager/src/pay_u_adapter/mod.rs | 0 .../payment_manager/src/t_pay_adapter/mod.rs | 0 ...20608131251_add_phone_to_order_address.sql | 2 + shared/model/src/lib.rs | 39 +- vendor/t_pay/.gitignore | 3 + vendor/t_pay/.openapi-generator-ignore | 23 + vendor/t_pay/.openapi-generator/FILES | 112 +++++ vendor/t_pay/.openapi-generator/VERSION | 1 + vendor/t_pay/.travis.yml | 1 + vendor/t_pay/Cargo.toml | 17 + vendor/t_pay/README.md | 112 +++++ vendor/t_pay/docs/BlikAlias.md | 13 + vendor/t_pay/docs/BlikAliasResponse.md | 12 + vendor/t_pay/docs/BlikFields.md | 15 + vendor/t_pay/docs/BlikResponse.md | 13 + vendor/t_pay/docs/CardsAPIApi.md | 296 +++++++++++ vendor/t_pay/docs/CardsErrCode.md | 10 + vendor/t_pay/docs/ChargebackStatus.md | 14 + vendor/t_pay/docs/CheckFields.md | 11 + vendor/t_pay/docs/CheckResponse.md | 12 + vendor/t_pay/docs/CreateFields.md | 32 ++ vendor/t_pay/docs/CreateResponse.md | 18 + vendor/t_pay/docs/DeregisterFields.md | 14 + vendor/t_pay/docs/GetFields.md | 12 + vendor/t_pay/docs/GetResponse.md | 29 ++ vendor/t_pay/docs/Language.md | 10 + .../t_pay/docs/MasspaymentAuthorizeFields.md | 12 + .../docs/MasspaymentAuthorizeResponse.md | 12 + vendor/t_pay/docs/MasspaymentCreateFields.md | 13 + .../t_pay/docs/MasspaymentCreateResponse.md | 17 + vendor/t_pay/docs/MasspaymentErrCode.md | 10 + vendor/t_pay/docs/MasspaymentErrDesc.md | 10 + vendor/t_pay/docs/MasspaymentPacksFields.md | 14 + vendor/t_pay/docs/MasspaymentPacksResponse.md | 13 + .../t_pay/docs/MasspaymentTransfersFields.md | 13 + .../docs/MasspaymentTransfersResponse.md | 13 + vendor/t_pay/docs/MasspaymentsApi.md | 136 +++++ vendor/t_pay/docs/Onetimer.md | 10 + vendor/t_pay/docs/PacksObject.md | 17 + vendor/t_pay/docs/PaymentAttempts.md | 12 + vendor/t_pay/docs/PresaleFields.md | 18 + vendor/t_pay/docs/RefundAnyFields.md | 13 + vendor/t_pay/docs/RefundAnyResponse.md | 12 + vendor/t_pay/docs/RefundFields.md | 18 + vendor/t_pay/docs/RefundResponse.md | 23 + vendor/t_pay/docs/RefundStatusResponse.md | 13 + vendor/t_pay/docs/RefundTransactionFields.md | 12 + vendor/t_pay/docs/RegisterSaleFields.md | 22 + vendor/t_pay/docs/RegisterSaleResponse.md | 15 + vendor/t_pay/docs/ReportFields.md | 13 + vendor/t_pay/docs/ReportResponse.md | 13 + vendor/t_pay/docs/Result.md | 10 + vendor/t_pay/docs/SaleFields.md | 14 + vendor/t_pay/docs/SaleResponse.md | 20 + vendor/t_pay/docs/SecuresaleFields.md | 24 + vendor/t_pay/docs/SecuresaleResponse.md | 24 + vendor/t_pay/docs/TransactionAPIApi.md | 232 +++++++++ vendor/t_pay/docs/TransactionErrorCodes.md | 10 + vendor/t_pay/docs/TransfersObject.md | 23 + vendor/t_pay/docs/VcFinishFields.md | 16 + vendor/t_pay/docs/VcPrepareFields.md | 14 + vendor/t_pay/docs/VcPrepareResponse.md | 12 + vendor/t_pay/git_push.sh | 58 +++ vendor/t_pay/src/apis/cards_api_api.rs | 473 ++++++++++++++++++ vendor/t_pay/src/apis/configuration.rs | 51 ++ vendor/t_pay/src/apis/masspayments_api.rs | 225 +++++++++ vendor/t_pay/src/apis/mod.rs | 68 +++ vendor/t_pay/src/apis/transaction_api_api.rs | 371 ++++++++++++++ vendor/t_pay/src/lib.rs | 10 + vendor/t_pay/src/models/blik_alias.rs | 39 ++ .../t_pay/src/models/blik_alias_response.rs | 31 ++ vendor/t_pay/src/models/blik_fields.rs | 40 ++ vendor/t_pay/src/models/blik_response.rs | 30 ++ vendor/t_pay/src/models/cards_err_code.rs | 77 +++ vendor/t_pay/src/models/chargeback_status.rs | 46 ++ vendor/t_pay/src/models/check_fields.rs | 22 + vendor/t_pay/src/models/check_response.rs | 26 + vendor/t_pay/src/models/create_fields.rs | 131 +++++ vendor/t_pay/src/models/create_response.rs | 50 ++ vendor/t_pay/src/models/deregister_fields.rs | 35 ++ vendor/t_pay/src/models/get_fields.rs | 28 ++ vendor/t_pay/src/models/get_response.rs | 126 +++++ vendor/t_pay/src/models/language.rs | 62 +++ .../models/masspayment_authorize_fields.rs | 28 ++ .../models/masspayment_authorize_response.rs | 26 + .../src/models/masspayment_create_fields.rs | 32 ++ .../src/models/masspayment_create_response.rs | 45 ++ .../t_pay/src/models/masspayment_err_code.rs | 96 ++++ .../t_pay/src/models/masspayment_err_desc.rs | 124 +++++ .../src/models/masspayment_packs_fields.rs | 36 ++ .../src/models/masspayment_packs_response.rs | 29 ++ .../models/masspayment_transfers_fields.rs | 32 ++ .../models/masspayment_transfers_response.rs | 29 ++ vendor/t_pay/src/models/mod.rs | 96 ++++ vendor/t_pay/src/models/onetimer.rs | 26 + vendor/t_pay/src/models/packs_object.rs | 60 +++ vendor/t_pay/src/models/payment_attempts.rs | 43 ++ vendor/t_pay/src/models/presale_fields.rs | 57 +++ vendor/t_pay/src/models/refund_any_fields.rs | 32 ++ .../t_pay/src/models/refund_any_response.rs | 24 + vendor/t_pay/src/models/refund_fields.rs | 50 ++ vendor/t_pay/src/models/refund_response.rs | 83 +++ .../src/models/refund_status_response.rs | 31 ++ .../src/models/refund_transaction_fields.rs | 28 ++ .../t_pay/src/models/register_sale_fields.rs | 73 +++ .../src/models/register_sale_response.rs | 41 ++ vendor/t_pay/src/models/report_fields.rs | 32 ++ vendor/t_pay/src/models/report_response.rs | 30 ++ vendor/t_pay/src/models/result.rs | 29 ++ vendor/t_pay/src/models/sale_fields.rs | 41 ++ vendor/t_pay/src/models/sale_response.rs | 76 +++ vendor/t_pay/src/models/securesale_fields.rs | 82 +++ .../t_pay/src/models/securesale_response.rs | 81 +++ .../src/models/transaction_error_codes.rs | 89 ++++ vendor/t_pay/src/models/transfers_object.rs | 88 ++++ vendor/t_pay/src/models/vc_finish_fields.rs | 48 ++ vendor/t_pay/src/models/vc_prepare_fields.rs | 35 ++ .../t_pay/src/models/vc_prepare_response.rs | 27 + 127 files changed, 5905 insertions(+), 64 deletions(-) create mode 100644 actors/payment_manager/src/pay_u_adapter/mod.rs create mode 100644 actors/payment_manager/src/t_pay_adapter/mod.rs create mode 100644 migrations/20220608131251_add_phone_to_order_address.sql create mode 100644 vendor/t_pay/.gitignore create mode 100644 vendor/t_pay/.openapi-generator-ignore create mode 100644 vendor/t_pay/.openapi-generator/FILES create mode 100644 vendor/t_pay/.openapi-generator/VERSION create mode 100644 vendor/t_pay/.travis.yml create mode 100644 vendor/t_pay/Cargo.toml create mode 100644 vendor/t_pay/README.md create mode 100644 vendor/t_pay/docs/BlikAlias.md create mode 100644 vendor/t_pay/docs/BlikAliasResponse.md create mode 100644 vendor/t_pay/docs/BlikFields.md create mode 100644 vendor/t_pay/docs/BlikResponse.md create mode 100644 vendor/t_pay/docs/CardsAPIApi.md create mode 100644 vendor/t_pay/docs/CardsErrCode.md create mode 100644 vendor/t_pay/docs/ChargebackStatus.md create mode 100644 vendor/t_pay/docs/CheckFields.md create mode 100644 vendor/t_pay/docs/CheckResponse.md create mode 100644 vendor/t_pay/docs/CreateFields.md create mode 100644 vendor/t_pay/docs/CreateResponse.md create mode 100644 vendor/t_pay/docs/DeregisterFields.md create mode 100644 vendor/t_pay/docs/GetFields.md create mode 100644 vendor/t_pay/docs/GetResponse.md create mode 100644 vendor/t_pay/docs/Language.md create mode 100644 vendor/t_pay/docs/MasspaymentAuthorizeFields.md create mode 100644 vendor/t_pay/docs/MasspaymentAuthorizeResponse.md create mode 100644 vendor/t_pay/docs/MasspaymentCreateFields.md create mode 100644 vendor/t_pay/docs/MasspaymentCreateResponse.md create mode 100644 vendor/t_pay/docs/MasspaymentErrCode.md create mode 100644 vendor/t_pay/docs/MasspaymentErrDesc.md create mode 100644 vendor/t_pay/docs/MasspaymentPacksFields.md create mode 100644 vendor/t_pay/docs/MasspaymentPacksResponse.md create mode 100644 vendor/t_pay/docs/MasspaymentTransfersFields.md create mode 100644 vendor/t_pay/docs/MasspaymentTransfersResponse.md create mode 100644 vendor/t_pay/docs/MasspaymentsApi.md create mode 100644 vendor/t_pay/docs/Onetimer.md create mode 100644 vendor/t_pay/docs/PacksObject.md create mode 100644 vendor/t_pay/docs/PaymentAttempts.md create mode 100644 vendor/t_pay/docs/PresaleFields.md create mode 100644 vendor/t_pay/docs/RefundAnyFields.md create mode 100644 vendor/t_pay/docs/RefundAnyResponse.md create mode 100644 vendor/t_pay/docs/RefundFields.md create mode 100644 vendor/t_pay/docs/RefundResponse.md create mode 100644 vendor/t_pay/docs/RefundStatusResponse.md create mode 100644 vendor/t_pay/docs/RefundTransactionFields.md create mode 100644 vendor/t_pay/docs/RegisterSaleFields.md create mode 100644 vendor/t_pay/docs/RegisterSaleResponse.md create mode 100644 vendor/t_pay/docs/ReportFields.md create mode 100644 vendor/t_pay/docs/ReportResponse.md create mode 100644 vendor/t_pay/docs/Result.md create mode 100644 vendor/t_pay/docs/SaleFields.md create mode 100644 vendor/t_pay/docs/SaleResponse.md create mode 100644 vendor/t_pay/docs/SecuresaleFields.md create mode 100644 vendor/t_pay/docs/SecuresaleResponse.md create mode 100644 vendor/t_pay/docs/TransactionAPIApi.md create mode 100644 vendor/t_pay/docs/TransactionErrorCodes.md create mode 100644 vendor/t_pay/docs/TransfersObject.md create mode 100644 vendor/t_pay/docs/VcFinishFields.md create mode 100644 vendor/t_pay/docs/VcPrepareFields.md create mode 100644 vendor/t_pay/docs/VcPrepareResponse.md create mode 100644 vendor/t_pay/git_push.sh create mode 100644 vendor/t_pay/src/apis/cards_api_api.rs create mode 100644 vendor/t_pay/src/apis/configuration.rs create mode 100644 vendor/t_pay/src/apis/masspayments_api.rs create mode 100644 vendor/t_pay/src/apis/mod.rs create mode 100644 vendor/t_pay/src/apis/transaction_api_api.rs create mode 100644 vendor/t_pay/src/lib.rs create mode 100644 vendor/t_pay/src/models/blik_alias.rs create mode 100644 vendor/t_pay/src/models/blik_alias_response.rs create mode 100644 vendor/t_pay/src/models/blik_fields.rs create mode 100644 vendor/t_pay/src/models/blik_response.rs create mode 100644 vendor/t_pay/src/models/cards_err_code.rs create mode 100644 vendor/t_pay/src/models/chargeback_status.rs create mode 100644 vendor/t_pay/src/models/check_fields.rs create mode 100644 vendor/t_pay/src/models/check_response.rs create mode 100644 vendor/t_pay/src/models/create_fields.rs create mode 100644 vendor/t_pay/src/models/create_response.rs create mode 100644 vendor/t_pay/src/models/deregister_fields.rs create mode 100644 vendor/t_pay/src/models/get_fields.rs create mode 100644 vendor/t_pay/src/models/get_response.rs create mode 100644 vendor/t_pay/src/models/language.rs create mode 100644 vendor/t_pay/src/models/masspayment_authorize_fields.rs create mode 100644 vendor/t_pay/src/models/masspayment_authorize_response.rs create mode 100644 vendor/t_pay/src/models/masspayment_create_fields.rs create mode 100644 vendor/t_pay/src/models/masspayment_create_response.rs create mode 100644 vendor/t_pay/src/models/masspayment_err_code.rs create mode 100644 vendor/t_pay/src/models/masspayment_err_desc.rs create mode 100644 vendor/t_pay/src/models/masspayment_packs_fields.rs create mode 100644 vendor/t_pay/src/models/masspayment_packs_response.rs create mode 100644 vendor/t_pay/src/models/masspayment_transfers_fields.rs create mode 100644 vendor/t_pay/src/models/masspayment_transfers_response.rs create mode 100644 vendor/t_pay/src/models/mod.rs create mode 100644 vendor/t_pay/src/models/onetimer.rs create mode 100644 vendor/t_pay/src/models/packs_object.rs create mode 100644 vendor/t_pay/src/models/payment_attempts.rs create mode 100644 vendor/t_pay/src/models/presale_fields.rs create mode 100644 vendor/t_pay/src/models/refund_any_fields.rs create mode 100644 vendor/t_pay/src/models/refund_any_response.rs create mode 100644 vendor/t_pay/src/models/refund_fields.rs create mode 100644 vendor/t_pay/src/models/refund_response.rs create mode 100644 vendor/t_pay/src/models/refund_status_response.rs create mode 100644 vendor/t_pay/src/models/refund_transaction_fields.rs create mode 100644 vendor/t_pay/src/models/register_sale_fields.rs create mode 100644 vendor/t_pay/src/models/register_sale_response.rs create mode 100644 vendor/t_pay/src/models/report_fields.rs create mode 100644 vendor/t_pay/src/models/report_response.rs create mode 100644 vendor/t_pay/src/models/result.rs create mode 100644 vendor/t_pay/src/models/sale_fields.rs create mode 100644 vendor/t_pay/src/models/sale_response.rs create mode 100644 vendor/t_pay/src/models/securesale_fields.rs create mode 100644 vendor/t_pay/src/models/securesale_response.rs create mode 100644 vendor/t_pay/src/models/transaction_error_codes.rs create mode 100644 vendor/t_pay/src/models/transfers_object.rs create mode 100644 vendor/t_pay/src/models/vc_finish_fields.rs create mode 100644 vendor/t_pay/src/models/vc_prepare_fields.rs create mode 100644 vendor/t_pay/src/models/vc_prepare_response.rs diff --git a/.env b/.env index 44de5d2..9bdab2b 100644 --- a/.env +++ b/.env @@ -17,6 +17,9 @@ PAYU_CLIENT_ID="145227" PAYU_CLIENT_SECRET="12f071174cb7eb79d4aac5bc2f07563f" PAYU_CLIENT_MERCHANT_ID=300746 +TPAY_TRANSACTION_API_KEY=75f86137a6635df826e3efe2e66f7c9a946fdde1 +TPAY_CARDS_API_KEY=bda5eda723bf1ae71a82e90a249803d3f852248d + #WEB_HOST=https://bazzar.ita-prog.pl WEB_HOST=0.0.0.0 diff --git a/Cargo.lock b/Cargo.lock index 1774808..dfdca3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2703,6 +2703,17 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "openapi" +version = "1.0.0" +dependencies = [ + "reqwest", + "serde", + "serde_derive", + "serde_json", + "url", +] + [[package]] name = "openssl" version = "0.10.40" @@ -3300,6 +3311,7 @@ dependencies = [ "lazy_static", "log", "mime", + "mime_guess", "native-tls", "percent-encoding", "pin-project-lite", diff --git a/Cargo.toml b/Cargo.toml index 2b51dec..8d6788f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,8 @@ members = [ "db-seed", "api", "web", + # vendor + "vendor/t_pay", ] [profile.release] diff --git a/actors/database_manager/src/order_addresses.rs b/actors/database_manager/src/order_addresses.rs index 67581dc..6e6008f 100644 --- a/actors/database_manager/src/order_addresses.rs +++ b/actors/database_manager/src/order_addresses.rs @@ -2,10 +2,12 @@ use crate::{db_async_handler, Result}; #[derive(Debug, Copy, Clone, PartialEq, serde::Serialize, thiserror::Error)] pub enum Error { - #[error("Can't load account addresses")] + #[error("Can't load order addresses")] OrderAddress, - #[error("Failed to save account address")] + #[error("Failed to save order address")] CreateOrderAddress, + #[error("Failed to change order address")] + UpdateOrderAddress, } #[derive(actix::Message)] @@ -35,6 +37,7 @@ SELECT order_addresses.city, order_addresses.country, order_addresses.zip + order_addresses.phone FROM order_addresses INNER JOIN orders ON orders.address_id = order_addresses.id WHERE orders.id = $1 @@ -55,6 +58,7 @@ pub struct CreateOrderAddress { pub city: model::City, pub country: model::Country, pub zip: model::Zip, + pub phone: model::Phone, } db_async_handler!( @@ -70,9 +74,9 @@ pub(crate) async fn create_order_address( ) -> Result { sqlx::query_as( r#" -INSERT INTO order_addresses ( name, email, street, city, country, zip ) -VALUES ($1, $2, $3, $4, $5, $6) -RETURNING id, name, email, street, city, country, zip +INSERT INTO order_addresses ( name, email, street, city, country, zip, phone ) +VALUES ($1, $2, $3, $4, $5, $6, $7) +RETURNING id, name, email, street, city, country, zip, phone "#, ) .bind(msg.name) @@ -81,9 +85,14 @@ RETURNING id, name, email, street, city, country, zip .bind(msg.city) .bind(msg.country) .bind(msg.zip) + .bind(msg.phone) .fetch_one(pool) .await - .map_err(|_| Error::CreateOrderAddress.into()) + .map_err(|e| { + tracing::error!("{}", e); + dbg!(e); + Error::CreateOrderAddress.into() + }) } #[derive(actix::Message)] @@ -96,25 +105,26 @@ pub struct UpdateOrderAddress { pub city: model::City, pub country: model::Country, pub zip: model::Zip, + pub phone: model::Phone, } db_async_handler!( UpdateOrderAddress, - update_account_address, + update_order_address, 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, pool: &mut sqlx::Transaction<'_, sqlx::Postgres>, ) -> Result { sqlx::query_as( r#" 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 -RETURNING id, name, email, street, city, country, zip +RETURNING id, name, email, street, city, country, zip, phone "#, ) .bind(msg.id) @@ -124,9 +134,14 @@ RETURNING id, name, email, street, city, country, zip .bind(msg.city) .bind(msg.country) .bind(msg.zip) + .bind(msg.phone) .fetch_one(pool) .await - .map_err(|_| Error::CreateOrderAddress.into()) + .map_err(|e| { + tracing::error!("{}", e); + dbg!(e); + Error::UpdateOrderAddress.into() + }) } #[cfg(test)] @@ -134,11 +149,92 @@ 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 { + 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); + } } diff --git a/actors/database_manager/src/order_items.rs b/actors/database_manager/src/order_items.rs index afa4b95..59a3bcf 100644 --- a/actors/database_manager/src/order_items.rs +++ b/actors/database_manager/src/order_items.rs @@ -1,7 +1,6 @@ #[cfg(feature = "dummy")] use fake::Fake; use model::*; -use sqlx::PgPool; use super::Result; use crate::db_async_handler; @@ -24,9 +23,17 @@ pub enum Error { #[rtype(result = "Result>")] pub struct AllOrderItems; -db_async_handler!(AllOrderItems, all_order_items, Vec); +db_async_handler!( + AllOrderItems, + all_order_items, + Vec, + inner_all_order_items +); -pub(crate) async fn all_order_items(_msg: AllOrderItems, pool: PgPool) -> Result> { +pub(crate) async fn all_order_items( + _msg: AllOrderItems, + t: &mut sqlx::Transaction<'_, sqlx::Postgres>, +) -> Result> { sqlx::query_as( r#" SELECT id, product_id, order_id, quantity, quantity_unit @@ -34,7 +41,7 @@ FROM order_items ORDER BY id DESC "#, ) - .fetch_all(&pool) + .fetch_all(t) .await .map_err(|e| { tracing::error!("{e:?}"); @@ -52,16 +59,17 @@ pub struct CreateOrderItem { 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 { - create_order_item(msg, &db).await -} - -pub(crate) async fn create_order_item<'e, E>(msg: CreateOrderItem, db: E) -> Result -where - E: sqlx::Executor<'e, Database = sqlx::Postgres>, -{ +pub(crate) async fn create_order_item( + msg: CreateOrderItem, + t: &mut sqlx::Transaction<'_, sqlx::Postgres>, +) -> Result { sqlx::query_as( r#" 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.quantity) .bind(msg.quantity_unit) - .fetch_one(db) + .fetch_one(t) .await .map_err(|e| { tracing::error!("{e:?}"); + dbg!(e); super::Error::OrderItem(Error::CantCreate) }) } @@ -87,9 +96,12 @@ pub struct FindOrderItem { 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 { +pub(crate) async fn find_order_item( + msg: FindOrderItem, + t: &mut sqlx::Transaction<'_, sqlx::Postgres>, +) -> Result { sqlx::query_as( r#" SELECT id, product_id, order_id, quantity, quantity_unit @@ -98,7 +110,7 @@ WHERE id = $1 "#, ) .bind(msg.id) - .fetch_one(&db) + .fetch_one(t) .await .map_err(|e| { tracing::error!("{e:?}"); @@ -112,9 +124,12 @@ pub struct OrderItems { pub order_id: OrderId, } -db_async_handler!(OrderItems, order_items, Vec); +db_async_handler!(OrderItems, order_items, Vec, inner_order_items); -pub(crate) async fn order_items(msg: OrderItems, pool: PgPool) -> Result> { +pub(crate) async fn order_items( + msg: OrderItems, + t: &mut sqlx::Transaction<'_, sqlx::Postgres>, +) -> Result> { sqlx::query_as( r#" SELECT id, product_id, order_id, quantity, quantity_unit @@ -124,10 +139,191 @@ ORDER BY id DESC "#, ) .bind(msg.order_id) - .fetch_all(&pool) + .fetch_all(t) .await .map_err(|e| { tracing::error!("{e:?}"); 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, + ) -> 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)); + } +} diff --git a/actors/database_manager/src/orders.rs b/actors/database_manager/src/orders.rs index b0781b5..14a47c7 100644 --- a/actors/database_manager/src/orders.rs +++ b/actors/database_manager/src/orders.rs @@ -188,7 +188,7 @@ pub(crate) async fn update_order_by_ext( r#" UPDATE orders 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 "#, ) @@ -198,6 +198,7 @@ RETURNING id, buyer_id, status, order_ext_id, service_order_id, checkout_notes, .await .map_err(|e| { tracing::error!("{e:?}"); + dbg!(e); super::Error::AccountOrder(Error::CantCreate) }) } @@ -295,6 +296,7 @@ mod tests { city: Default::default(), country: Default::default(), zip: Default::default(), + phone: Default::default(), }, t, ) @@ -305,7 +307,7 @@ mod tests { async fn test_product(t: &mut sqlx::Transaction<'_, sqlx::Postgres>) -> Product { create_product( CreateProduct { - name: ProductName::new(format!("{}", Uuid::new_v4())), + name: ProductName::new(format!("a{}", Uuid::new_v4())), short_description: ProductShortDesc::new(format!("{}", Uuid::new_v4())), long_description: ProductLongDesc::new(format!("{}", Uuid::new_v4())), category: None, @@ -328,17 +330,11 @@ mod tests { _ => test_account(&mut *t).await.id, }; - sqlx::query( - r#" -UPDATE shopping_carts -SET state = 'closed' -WHERE buyer_id = $1 - "#, - ) - .bind(buyer_id) - .execute(&mut *t) - .await - .unwrap(); + sqlx::query(r#" UPDATE shopping_carts SET state = 'closed' WHERE buyer_id = $1 "#) + .bind(buyer_id) + .execute(&mut *t) + .await + .unwrap(); let cart = create_shopping_cart( CreateShoppingCart { @@ -511,4 +507,38 @@ WHERE buyer_id = $1 .unwrap(); 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 + } + ); + } } diff --git a/actors/database_manager/src/products.rs b/actors/database_manager/src/products.rs index 93f6b0e..bc802ff 100644 --- a/actors/database_manager/src/products.rs +++ b/actors/database_manager/src/products.rs @@ -159,11 +159,11 @@ where sqlx::query_as( r#" UPDATE products -SET name = $2 AND - short_description = $3 AND - long_description = $4 AND - category = $5 AND - price = $6 AND +SET name = $2, + short_description = $3, + long_description = $4, + category = $5, + price = $6, deliver_days_flag = $7 WHERE id = $1 RETURNING id, @@ -186,6 +186,7 @@ RETURNING id, .await .map_err(|e| { tracing::error!("{e:?}"); + dbg!(e); crate::Error::Product(Error::Update) }) } @@ -276,7 +277,7 @@ ORDER BY products.id #[derive(Message)] #[rtype(result = "Result>")] pub struct FindProducts { - pub product_ids: Vec, + pub product_ids: Vec, } crate::db_async_handler!( @@ -289,7 +290,7 @@ crate::db_async_handler!( pub(crate) async fn find_products( msg: FindProducts, pool: &mut sqlx::Transaction<'_, sqlx::Postgres>, -) -> Result> { +) -> Result> { MultiLoad::new( pool, r#" @@ -358,7 +359,7 @@ mod tests { } #[actix::test] - async fn create_product() { + async fn create() { testx::db_t!(t); test_product(&mut t, None, None, None, None, None, None).await; @@ -397,4 +398,49 @@ mod tests { assert_eq!(product, p2); 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, + } + ); + } } diff --git a/actors/order_manager/src/lib.rs b/actors/order_manager/src/lib.rs index ceda3c6..f46d5fe 100644 --- a/actors/order_manager/src/lib.rs +++ b/actors/order_manager/src/lib.rs @@ -172,6 +172,7 @@ pub(crate) async fn create_account_order( city: address.city, country: address.country, zip: address.zip, + phone: address.phone, }, Error::InvalidOrderAddress ); diff --git a/actors/payment_manager/src/lib.rs b/actors/payment_manager/src/lib.rs index f5e2c8d..11f83a4 100644 --- a/actors/payment_manager/src/lib.rs +++ b/actors/payment_manager/src/lib.rs @@ -1,3 +1,6 @@ +mod pay_u_adapter; +mod t_pay_adapter; + use std::collections::HashMap; use std::sync::Arc; diff --git a/actors/payment_manager/src/pay_u_adapter/mod.rs b/actors/payment_manager/src/pay_u_adapter/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/actors/payment_manager/src/t_pay_adapter/mod.rs b/actors/payment_manager/src/t_pay_adapter/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/migrations/20220608131251_add_phone_to_order_address.sql b/migrations/20220608131251_add_phone_to_order_address.sql new file mode 100644 index 0000000..f5832ef --- /dev/null +++ b/migrations/20220608131251_add_phone_to_order_address.sql @@ -0,0 +1,2 @@ +ALTER TABLE order_addresses + ADD COLUMN phone TEXT NOT NULL; diff --git a/shared/model/src/lib.rs b/shared/model/src/lib.rs index 0c62dc6..2c11b2b 100644 --- a/shared/model/src/lib.rs +++ b/shared/model/src/lib.rs @@ -8,6 +8,7 @@ pub mod encrypt; use std::fmt::{Display, Formatter}; use std::ops; +use std::ops::BitOr; use std::str::FromStr; 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 = "db", derive(sqlx::Type))] #[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")] pub enum OrderStatus { #[display(fmt = "Potwierdzone")] @@ -540,7 +541,7 @@ impl<'de> serde::Deserialize<'de> for NonNegative { )] #[serde(rename_all = "lowercase")] pub enum Day { - Monday = 1 << 0, + Monday = 1, Tuesday = 1 << 1, Wednesday = 1 << 2, 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 for Day { type Error = TransformError; @@ -603,6 +612,15 @@ impl TryFrom for Day { #[serde(transparent)] pub struct Days(pub Vec); +impl BitOr for Days { + type Output = Self; + + fn bitor(mut self, rhs: Day) -> Self::Output { + self.0.push(rhs); + self + } +} + impl ops::Deref for Days { type Target = Vec; @@ -620,7 +638,7 @@ where &self, buf: &mut >::ArgumentBuffer, ) -> ::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); >::encode_by_ref(&value, buf) } @@ -883,27 +901,27 @@ pub struct Stock { #[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "db", derive(sqlx::Type))] #[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)] pub struct OrderAddressId(RecordId); #[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "db", derive(sqlx::Type))] #[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)] pub struct OrderId(RecordId); #[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "db", derive(sqlx::Type))] #[cfg_attr(feature = "db", sqlx(transparent))] -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Display, Deref)] +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Display, Deref)] #[serde(transparent)] pub struct ExtOrderId(String); #[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))] -#[derive(Serialize, Deserialize)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct Order { pub id: OrderId, pub buyer_id: AccountId, @@ -950,12 +968,12 @@ impl From for PublicOrder { #[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "db", derive(sqlx::Type))] #[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); #[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))] -#[derive(Serialize, Deserialize, Debug)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct OrderItem { pub id: OrderItemId, pub product_id: ProductId, @@ -1323,7 +1341,7 @@ pub struct AccountAddress { #[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[cfg_attr(feature = "db", derive(sqlx::FromRow))] -#[derive(Serialize, Deserialize, Debug)] +#[derive(Debug, PartialEq, Serialize, Deserialize)] pub struct OrderAddress { pub id: OrderAddressId, pub name: Name, @@ -1332,4 +1350,5 @@ pub struct OrderAddress { pub city: City, pub country: Country, pub zip: Zip, + pub phone: Phone, } diff --git a/vendor/t_pay/.gitignore b/vendor/t_pay/.gitignore new file mode 100644 index 0000000..6aa1064 --- /dev/null +++ b/vendor/t_pay/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/vendor/t_pay/.openapi-generator-ignore b/vendor/t_pay/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/vendor/t_pay/.openapi-generator-ignore @@ -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 diff --git a/vendor/t_pay/.openapi-generator/FILES b/vendor/t_pay/.openapi-generator/FILES new file mode 100644 index 0000000..58bab01 --- /dev/null +++ b/vendor/t_pay/.openapi-generator/FILES @@ -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 diff --git a/vendor/t_pay/.openapi-generator/VERSION b/vendor/t_pay/.openapi-generator/VERSION new file mode 100644 index 0000000..6555596 --- /dev/null +++ b/vendor/t_pay/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.2.0-SNAPSHOT \ No newline at end of file diff --git a/vendor/t_pay/.travis.yml b/vendor/t_pay/.travis.yml new file mode 100644 index 0000000..22761ba --- /dev/null +++ b/vendor/t_pay/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/vendor/t_pay/Cargo.toml b/vendor/t_pay/Cargo.toml new file mode 100644 index 0000000..6cf89e7 --- /dev/null +++ b/vendor/t_pay/Cargo.toml @@ -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] diff --git a/vendor/t_pay/README.md b/vendor/t_pay/README.md new file mode 100644 index 0000000..77a029e --- /dev/null +++ b/vendor/t_pay/README.md @@ -0,0 +1,112 @@ +# Rust API client for openapi + +

Demo transaction/masspayments api key:

Demo cards api key:

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.
+Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

+For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ +## 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 + diff --git a/vendor/t_pay/docs/BlikAlias.md b/vendor/t_pay/docs/BlikAlias.md new file mode 100644 index 0000000..ab7d29e --- /dev/null +++ b/vendor/t_pay/docs/BlikAlias.md @@ -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) + + diff --git a/vendor/t_pay/docs/BlikAliasResponse.md b/vendor/t_pay/docs/BlikAliasResponse.md new file mode 100644 index 0000000..88a1a09 --- /dev/null +++ b/vendor/t_pay/docs/BlikAliasResponse.md @@ -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) + + diff --git a/vendor/t_pay/docs/BlikFields.md b/vendor/t_pay/docs/BlikFields.md new file mode 100644 index 0000000..ab647b1 --- /dev/null +++ b/vendor/t_pay/docs/BlikFields.md @@ -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**](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) + + diff --git a/vendor/t_pay/docs/BlikResponse.md b/vendor/t_pay/docs/BlikResponse.md new file mode 100644 index 0000000..fd5d7f1 --- /dev/null +++ b/vendor/t_pay/docs/BlikResponse.md @@ -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**](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) + + diff --git a/vendor/t_pay/docs/CardsAPIApi.md b/vendor/t_pay/docs/CardsAPIApi.md new file mode 100644 index 0000000..561b264 --- /dev/null +++ b/vendor/t_pay/docs/CardsAPIApi.md @@ -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.
A client can also do it himself from the link in an email after payment.

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.

NOTICE: 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 client’s credit card or by API).

Additional information Please feel free to read detailed case study of Implementation of the recurrent payments + +### 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).

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.
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.

In test mode this method has 50% probability of success and the status parameter is picked randomly.
+ +### 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.

The parameter sale_auth can be used to redirect a client to payment transaction panel:
https://secure.tpay.com/cards/
with argument sale_auth passed with the POST or GET method.

Test mode notice!
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.
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.

Passed cli_auth has to match with cli_auth used while creating a sale in presale method.

Test mode notice! 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:

1. Generate webpage with your public RSA key in javascript
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.
3. In backend prepare parameters and send them with securesale method
4. Inform client about payment result

Card cypher is made from string

card number|expiry date(MM/YY or MM/YYYY)|cvv or cvc|host

eg. \"1234567891234567|05/17|123|https://merchantwebsite.com\"

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.
In production mode, this generated hash works only once and should always be generated even for the same card data.

There are two ways for performing payment

a) Pay by card without 3D- Secure.
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

b) Pay by card with 3D-Secure.
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.

An example 3ds URL is presented below

https://secure.tpay.com/cards/?sale_auth=2587bf3a98dfa699ef9d01eba38359b7

• 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 Merchant’s Site. Return URL is set in Merchant’s Panel or sent dynamically.

• Do not use an inline frame to implement the 3D-Secure authentication on Merchant’s Site. In this case, some banks can block 3DS authorisation.

The parameters are sent with POST method. Merchant system has to respond to the notification by printing array in JSON format.
See Card's notifications section.

Test mode notice!
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.

Additional information Please feel free to read detailed case study of Implementation of the card payment gateway at the store's website + +### 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.

Summary_data has format compliant with Visa Checkout Summary Payment Data. Its structure is described in Visa Checkout documentation at
extracting-consumer-data

The example table with this format can be found at Link

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.
Other fields if not changed don’t have to be sent.
The response format is the same as in SecureSale method - see the method for more details.

NOTICE: 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.

NOTICE: 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) + diff --git a/vendor/t_pay/docs/CardsErrCode.md b/vendor/t_pay/docs/CardsErrCode.md new file mode 100644 index 0000000..1913168 --- /dev/null +++ b/vendor/t_pay/docs/CardsErrCode.md @@ -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) + + diff --git a/vendor/t_pay/docs/ChargebackStatus.md b/vendor/t_pay/docs/ChargebackStatus.md new file mode 100644 index 0000000..acefc4c --- /dev/null +++ b/vendor/t_pay/docs/ChargebackStatus.md @@ -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) + + diff --git a/vendor/t_pay/docs/CheckFields.md b/vendor/t_pay/docs/CheckFields.md new file mode 100644 index 0000000..203e5df --- /dev/null +++ b/vendor/t_pay/docs/CheckFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/CheckResponse.md b/vendor/t_pay/docs/CheckResponse.md new file mode 100644 index 0000000..62137ec --- /dev/null +++ b/vendor/t_pay/docs/CheckResponse.md @@ -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) + + diff --git a/vendor/t_pay/docs/CreateFields.md b/vendor/t_pay/docs/CreateFields.md new file mode 100644 index 0000000..46519ac --- /dev/null +++ b/vendor/t_pay/docs/CreateFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/CreateResponse.md b/vendor/t_pay/docs/CreateResponse.md new file mode 100644 index 0000000..bc3f8b3 --- /dev/null +++ b/vendor/t_pay/docs/CreateResponse.md @@ -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) + + diff --git a/vendor/t_pay/docs/DeregisterFields.md b/vendor/t_pay/docs/DeregisterFields.md new file mode 100644 index 0000000..410a6d8 --- /dev/null +++ b/vendor/t_pay/docs/DeregisterFields.md @@ -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 Merchant’s 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) + + diff --git a/vendor/t_pay/docs/GetFields.md b/vendor/t_pay/docs/GetFields.md new file mode 100644 index 0000000..a763e34 --- /dev/null +++ b/vendor/t_pay/docs/GetFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/GetResponse.md b/vendor/t_pay/docs/GetResponse.md new file mode 100644 index 0000000..c90aa8b --- /dev/null +++ b/vendor/t_pay/docs/GetResponse.md @@ -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**](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) + + diff --git a/vendor/t_pay/docs/Language.md b/vendor/t_pay/docs/Language.md new file mode 100644 index 0000000..9dcec5f --- /dev/null +++ b/vendor/t_pay/docs/Language.md @@ -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) + + diff --git a/vendor/t_pay/docs/MasspaymentAuthorizeFields.md b/vendor/t_pay/docs/MasspaymentAuthorizeFields.md new file mode 100644 index 0000000..5ab9274 --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentAuthorizeFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/MasspaymentAuthorizeResponse.md b/vendor/t_pay/docs/MasspaymentAuthorizeResponse.md new file mode 100644 index 0000000..de3b30b --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentAuthorizeResponse.md @@ -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) + + diff --git a/vendor/t_pay/docs/MasspaymentCreateFields.md b/vendor/t_pay/docs/MasspaymentCreateFields.md new file mode 100644 index 0000000..471b114 --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentCreateFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/MasspaymentCreateResponse.md b/vendor/t_pay/docs/MasspaymentCreateResponse.md new file mode 100644 index 0000000..9f3af1a --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentCreateResponse.md @@ -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) + + diff --git a/vendor/t_pay/docs/MasspaymentErrCode.md b/vendor/t_pay/docs/MasspaymentErrCode.md new file mode 100644 index 0000000..5f48394 --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentErrCode.md @@ -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) + + diff --git a/vendor/t_pay/docs/MasspaymentErrDesc.md b/vendor/t_pay/docs/MasspaymentErrDesc.md new file mode 100644 index 0000000..e588079 --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentErrDesc.md @@ -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) + + diff --git a/vendor/t_pay/docs/MasspaymentPacksFields.md b/vendor/t_pay/docs/MasspaymentPacksFields.md new file mode 100644 index 0000000..bac70f7 --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentPacksFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/MasspaymentPacksResponse.md b/vendor/t_pay/docs/MasspaymentPacksResponse.md new file mode 100644 index 0000000..eeaefee --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentPacksResponse.md @@ -0,0 +1,13 @@ +# MasspaymentPacksResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | Option<[**crate::models::Result**](result.md)> | | [optional] +**packs** | Option<[**Vec**](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) + + diff --git a/vendor/t_pay/docs/MasspaymentTransfersFields.md b/vendor/t_pay/docs/MasspaymentTransfersFields.md new file mode 100644 index 0000000..a0e57fe --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentTransfersFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/MasspaymentTransfersResponse.md b/vendor/t_pay/docs/MasspaymentTransfersResponse.md new file mode 100644 index 0000000..464c216 --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentTransfersResponse.md @@ -0,0 +1,13 @@ +# MasspaymentTransfersResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | Option<[**crate::models::Result**](result.md)> | | [optional] +**transfers** | Option<[**Vec**](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) + + diff --git a/vendor/t_pay/docs/MasspaymentsApi.md b/vendor/t_pay/docs/MasspaymentsApi.md new file mode 100644 index 0000000..6b2c209 --- /dev/null +++ b/vendor/t_pay/docs/MasspaymentsApi.md @@ -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 Merchant’s ID in tpay.com system.

Example CSV file
Each line contains one transfer formatted as in the example below. Columns are separated by a semicolon.
The file does not have a header.

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

Place transfer receiver name in 1-4 receiver fields. Each field can be maximum 35 characters long.
If receiver name is for example 40 characters long, you should put 35 in receiver 1 field, and 5 characters in receiver 2 field.
The same rule is valid for title field. The transaction ID field is not required, whithout this field, the file format looks like this:

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

Example CSV file can be downloaded from:
Download + +### 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 Merchant’s 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) + diff --git a/vendor/t_pay/docs/Onetimer.md b/vendor/t_pay/docs/Onetimer.md new file mode 100644 index 0000000..1428b21 --- /dev/null +++ b/vendor/t_pay/docs/Onetimer.md @@ -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) + + diff --git a/vendor/t_pay/docs/PacksObject.md b/vendor/t_pay/docs/PacksObject.md new file mode 100644 index 0000000..ea0fe86 --- /dev/null +++ b/vendor/t_pay/docs/PacksObject.md @@ -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) + + diff --git a/vendor/t_pay/docs/PaymentAttempts.md b/vendor/t_pay/docs/PaymentAttempts.md new file mode 100644 index 0000000..c2db904 --- /dev/null +++ b/vendor/t_pay/docs/PaymentAttempts.md @@ -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) + + diff --git a/vendor/t_pay/docs/PresaleFields.md b/vendor/t_pay/docs/PresaleFields.md new file mode 100644 index 0000000..ceefddb --- /dev/null +++ b/vendor/t_pay/docs/PresaleFields.md @@ -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 Merchant’s Panel (default SHA-1): hash_alg (method + cli_auth + desc + amount + currency + order_id + language + verification code) where + means concatenation with ampersand symbol. ie. amount + currency = 10.99&985 | +**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) + + diff --git a/vendor/t_pay/docs/RefundAnyFields.md b/vendor/t_pay/docs/RefundAnyFields.md new file mode 100644 index 0000000..673ca65 --- /dev/null +++ b/vendor/t_pay/docs/RefundAnyFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/RefundAnyResponse.md b/vendor/t_pay/docs/RefundAnyResponse.md new file mode 100644 index 0000000..73dee62 --- /dev/null +++ b/vendor/t_pay/docs/RefundAnyResponse.md @@ -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) + + diff --git a/vendor/t_pay/docs/RefundFields.md b/vendor/t_pay/docs/RefundFields.md new file mode 100644 index 0000000..18ef703 --- /dev/null +++ b/vendor/t_pay/docs/RefundFields.md @@ -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 Merchant’s 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) + + diff --git a/vendor/t_pay/docs/RefundResponse.md b/vendor/t_pay/docs/RefundResponse.md new file mode 100644 index 0000000..9ecdd86 --- /dev/null +++ b/vendor/t_pay/docs/RefundResponse.md @@ -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) + + diff --git a/vendor/t_pay/docs/RefundStatusResponse.md b/vendor/t_pay/docs/RefundStatusResponse.md new file mode 100644 index 0000000..c0377db --- /dev/null +++ b/vendor/t_pay/docs/RefundStatusResponse.md @@ -0,0 +1,13 @@ +# RefundStatusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **i32** | Request result (digit; 1 – correct, 0 - incorrect) | +**chargebacks** | Option<[**Vec**](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) + + diff --git a/vendor/t_pay/docs/RefundTransactionFields.md b/vendor/t_pay/docs/RefundTransactionFields.md new file mode 100644 index 0000000..1b9931a --- /dev/null +++ b/vendor/t_pay/docs/RefundTransactionFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/RegisterSaleFields.md b/vendor/t_pay/docs/RegisterSaleFields.md new file mode 100644 index 0000000..947a827 --- /dev/null +++ b/vendor/t_pay/docs/RegisterSaleFields.md @@ -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 Merchant’s 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) + + diff --git a/vendor/t_pay/docs/RegisterSaleResponse.md b/vendor/t_pay/docs/RegisterSaleResponse.md new file mode 100644 index 0000000..414715c --- /dev/null +++ b/vendor/t_pay/docs/RegisterSaleResponse.md @@ -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 Merchant’s 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) + + diff --git a/vendor/t_pay/docs/ReportFields.md b/vendor/t_pay/docs/ReportFields.md new file mode 100644 index 0000000..d39dc68 --- /dev/null +++ b/vendor/t_pay/docs/ReportFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/ReportResponse.md b/vendor/t_pay/docs/ReportResponse.md new file mode 100644 index 0000000..14fc858 --- /dev/null +++ b/vendor/t_pay/docs/ReportResponse.md @@ -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:
(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
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))
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) + + diff --git a/vendor/t_pay/docs/Result.md b/vendor/t_pay/docs/Result.md new file mode 100644 index 0000000..24775b4 --- /dev/null +++ b/vendor/t_pay/docs/Result.md @@ -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) + + diff --git a/vendor/t_pay/docs/SaleFields.md b/vendor/t_pay/docs/SaleFields.md new file mode 100644 index 0000000..1a11c46 --- /dev/null +++ b/vendor/t_pay/docs/SaleFields.md @@ -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 Merchant’s 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) + + diff --git a/vendor/t_pay/docs/SaleResponse.md b/vendor/t_pay/docs/SaleResponse.md new file mode 100644 index 0000000..c7b88f3 --- /dev/null +++ b/vendor/t_pay/docs/SaleResponse.md @@ -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) + + diff --git a/vendor/t_pay/docs/SecuresaleFields.md b/vendor/t_pay/docs/SecuresaleFields.md new file mode 100644 index 0000000..480cc67 --- /dev/null +++ b/vendor/t_pay/docs/SecuresaleFields.md @@ -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) + + diff --git a/vendor/t_pay/docs/SecuresaleResponse.md b/vendor/t_pay/docs/SecuresaleResponse.md new file mode 100644 index 0000000..e584418 --- /dev/null +++ b/vendor/t_pay/docs/SecuresaleResponse.md @@ -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) + + diff --git a/vendor/t_pay/docs/TransactionAPIApi.md b/vendor/t_pay/docs/TransactionAPIApi.md new file mode 100644 index 0000000..8c55fc3 --- /dev/null +++ b/vendor/t_pay/docs/TransactionAPIApi.md @@ -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.

NOTICE: This method works only in production mode!
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.
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.

NOTICE: This method works only in production mode!
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.)

NOTICE: to test this method, you need to create the transaction with 'create' method and replace title parameter value with the returned title.
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.
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 script 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) + diff --git a/vendor/t_pay/docs/TransactionErrorCodes.md b/vendor/t_pay/docs/TransactionErrorCodes.md new file mode 100644 index 0000000..525393d --- /dev/null +++ b/vendor/t_pay/docs/TransactionErrorCodes.md @@ -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) + + diff --git a/vendor/t_pay/docs/TransfersObject.md b/vendor/t_pay/docs/TransfersObject.md new file mode 100644 index 0000000..54d9ea1 --- /dev/null +++ b/vendor/t_pay/docs/TransfersObject.md @@ -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) + + diff --git a/vendor/t_pay/docs/VcFinishFields.md b/vendor/t_pay/docs/VcFinishFields.md new file mode 100644 index 0000000..ca13af9 --- /dev/null +++ b/vendor/t_pay/docs/VcFinishFields.md @@ -0,0 +1,16 @@ +# VcFinishFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**api_password** | **String** | API password. | +**summary_data** | Option<[**Vec**](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 Merchant’s 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) + + diff --git a/vendor/t_pay/docs/VcPrepareFields.md b/vendor/t_pay/docs/VcPrepareFields.md new file mode 100644 index 0000000..a5821de --- /dev/null +++ b/vendor/t_pay/docs/VcPrepareFields.md @@ -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 Merchant’s 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) + + diff --git a/vendor/t_pay/docs/VcPrepareResponse.md b/vendor/t_pay/docs/VcPrepareResponse.md new file mode 100644 index 0000000..78a5b9f --- /dev/null +++ b/vendor/t_pay/docs/VcPrepareResponse.md @@ -0,0 +1,12 @@ +# VcPrepareResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | Option<[**crate::models::Result**](result.md)> | | [optional] +**summary_data** | Option<[**Vec**](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) + + diff --git a/vendor/t_pay/git_push.sh b/vendor/t_pay/git_push.sh new file mode 100644 index 0000000..19ce5b5 --- /dev/null +++ b/vendor/t_pay/git_push.sh @@ -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' + diff --git a/vendor/t_pay/src/apis/cards_api_api.rs b/vendor/t_pay/src/apis/cards_api_api.rs new file mode 100644 index 0000000..4e86caf --- /dev/null +++ b/vendor/t_pay/src/apis/cards_api_api.rs @@ -0,0 +1,473 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, +) -> Result> { + 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 = + 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.
A client can also do it himself from the link in an email after payment.

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.

NOTICE: 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, +) -> Result> { + 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 = + 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 client’s credit card or by API).

Additional information Please feel free to read detailed case study of Implementation of the recurrent payments +pub async fn api_cards_api_key_presale_post( + configuration: &configuration::Configuration, + api_key: &str, + basic_data: Option, +) -> Result> { + 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 = + 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).

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.
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.

In test mode this method has 50% probability of success and the status parameter is picked randomly.
+pub async fn api_cards_api_key_refund_post( + configuration: &configuration::Configuration, + api_key: &str, + basic_data: Option, +) -> Result> { + 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 = + 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.

The parameter sale_auth can be used to redirect a client to payment transaction panel:
https://secure.tpay.com/cards/
with argument sale_auth passed with the POST or GET method.

Test mode notice!
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.
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, +) -> Result> { + 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 = + 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.

Passed cli_auth has to match with cli_auth used while creating a sale in presale method.

Test mode notice! 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, +) -> Result> { + 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 = + 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:

1. Generate webpage with your public RSA key in javascript
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.
3. In backend prepare parameters and send them with securesale method
4. Inform client about payment result

Card cypher is made from string

card number|expiry date(MM/YY or MM/YYYY)|cvv or cvc|host

eg. \"1234567891234567|05/17|123|https://merchantwebsite.com\"

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.
In production mode, this generated hash works only once and should always be generated even for the same card data.

There are two ways for performing payment

a) Pay by card without 3D- Secure.
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

b) Pay by card with 3D-Secure.
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.

An example 3ds URL is presented below

https://secure.tpay.com/cards/?sale_auth=2587bf3a98dfa699ef9d01eba38359b7

• 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 Merchant’s Site. Return URL is set in Merchant’s Panel or sent dynamically.

• Do not use an inline frame to implement the 3D-Secure authentication on Merchant’s Site. In this case, some banks can block 3DS authorisation.

The parameters are sent with POST method. Merchant system has to respond to the notification by printing array in JSON format.
See Card's notifications section.

Test mode notice!
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.

Additional information Please feel free to read detailed case study of Implementation of the card payment gateway at the store's website +pub async fn api_cards_api_key_securesale_post( + configuration: &configuration::Configuration, + api_key: &str, + basic_data: Option, +) -> Result> { + 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 = + 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.

Summary_data has format compliant with Visa Checkout Summary Payment Data. Its structure is described in Visa Checkout documentation at
extracting-consumer-data

The example table with this format can be found at Link

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.
Other fields if not changed don’t have to be sent.
The response format is the same as in SecureSale method - see the method for more details.

NOTICE: 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, +) -> Result> { + 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 = + 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.

NOTICE: 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, +) -> Result> { + 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 = + 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)) + } +} diff --git a/vendor/t_pay/src/apis/configuration.rs b/vendor/t_pay/src/apis/configuration.rs new file mode 100644 index 0000000..2ac130d --- /dev/null +++ b/vendor/t_pay/src/apis/configuration.rs @@ -0,0 +1,51 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + 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, + } + } +} diff --git a/vendor/t_pay/src/apis/masspayments_api.rs b/vendor/t_pay/src/apis/masspayments_api.rs new file mode 100644 index 0000000..a177fc5 --- /dev/null +++ b/vendor/t_pay/src/apis/masspayments_api.rs @@ -0,0 +1,225 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, +) -> Result< + crate::models::MasspaymentAuthorizeResponse, + Error, +> { + 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 = + 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 Merchant’s ID in tpay.com system.

Example CSV file
Each line contains one transfer formatted as in the example below. Columns are separated by a semicolon.
The file does not have a header.

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

Place transfer receiver name in 1-4 receiver fields. Each field can be maximum 35 characters long.
If receiver name is for example 40 characters long, you should put 35 in receiver 1 field, and 5 characters in receiver 2 field.
The same rule is valid for title field. The transaction ID field is not required, whithout this field, the file format looks like this:

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

Example CSV file can be downloaded from:
Download +pub async fn api_gw_api_key_masspayment_create_post( + configuration: &configuration::Configuration, + api_key: &str, + basic_data: Option, +) -> Result> +{ + 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 = + 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 Merchant’s 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, +) -> Result> { + 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 = + 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, +) -> Result< + crate::models::MasspaymentTransfersResponse, + Error, +> { + 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 = + 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)) + } +} diff --git a/vendor/t_pay/src/apis/mod.rs b/vendor/t_pay/src/apis/mod.rs new file mode 100644 index 0000000..7b4edf4 --- /dev/null +++ b/vendor/t_pay/src/apis/mod.rs @@ -0,0 +1,68 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + 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 error::Error for Error { + 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 From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(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; diff --git a/vendor/t_pay/src/apis/transaction_api_api.rs b/vendor/t_pay/src/apis/transaction_api_api.rs new file mode 100644 index 0000000..210b1e9 --- /dev/null +++ b/vendor/t_pay/src/apis/transaction_api_api.rs @@ -0,0 +1,371 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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.

NOTICE: This method works only in production mode!
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, +) -> Result> { + 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 = + 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.
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, +) -> Result> { + 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 = + 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.

NOTICE: This method works only in production mode!
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, +) -> Result> { + 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 = + 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.)

NOTICE: to test this method, you need to create the transaction with 'create' method and replace title parameter value with the returned title.
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, +) -> Result> { + 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 = + 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.
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, +) -> Result> { + 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 = + 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, +) -> Result> { + 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 = + 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 script from Tpay PHP library. +pub async fn api_gw_api_key_transaction_report_post( + configuration: &configuration::Configuration, + api_key: &str, + report_data: Option, +) -> Result> { + 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 = + 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)) + } +} diff --git a/vendor/t_pay/src/lib.rs b/vendor/t_pay/src/lib.rs new file mode 100644 index 0000000..fc22e4e --- /dev/null +++ b/vendor/t_pay/src/lib.rs @@ -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; diff --git a/vendor/t_pay/src/models/blik_alias.rs b/vendor/t_pay/src/models/blik_alias.rs new file mode 100644 index 0000000..9689723 --- /dev/null +++ b/vendor/t_pay/src/models/blik_alias.rs @@ -0,0 +1,39 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + /// Alias type + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub _type: Option, + /// 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, +} + +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, +} diff --git a/vendor/t_pay/src/models/blik_alias_response.rs b/vendor/t_pay/src/models/blik_alias_response.rs new file mode 100644 index 0000000..583a882 --- /dev/null +++ b/vendor/t_pay/src/models/blik_alias_response.rs @@ -0,0 +1,31 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + /// 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, +} + +impl BlikAliasResponse { + /// Array containing list of banks associated with this alias + pub fn new() -> BlikAliasResponse { + BlikAliasResponse { + application_name: None, + application_code: None, + } + } +} diff --git a/vendor/t_pay/src/models/blik_fields.rs b/vendor/t_pay/src/models/blik_fields.rs new file mode 100644 index 0000000..8b47f18 --- /dev/null +++ b/vendor/t_pay/src/models/blik_fields.rs @@ -0,0 +1,40 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + /// 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>, + /// 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, +} + +impl BlikFields { + pub fn new(title: String, api_password: String) -> BlikFields { + BlikFields { + title, + code: None, + api_password, + alias: None, + _type: None, + } + } +} diff --git a/vendor/t_pay/src/models/blik_response.rs b/vendor/t_pay/src/models/blik_response.rs new file mode 100644 index 0000000..b5f4476 --- /dev/null +++ b/vendor/t_pay/src/models/blik_response.rs @@ -0,0 +1,30 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + #[serde(rename = "availableUserApps", skip_serializing_if = "Option::is_none")] + pub available_user_apps: Option>, + #[serde(rename = "err", skip_serializing_if = "Option::is_none")] + pub err: Option, +} + +impl BlikResponse { + pub fn new() -> BlikResponse { + BlikResponse { + result: None, + available_user_apps: None, + err: None, + } + } +} diff --git a/vendor/t_pay/src/models/cards_err_code.rs b/vendor/t_pay/src/models/cards_err_code.rs new file mode 100644 index 0000000..03b9747 --- /dev/null +++ b/vendor/t_pay/src/models/cards_err_code.rs @@ -0,0 +1,77 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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"), + } + } +} diff --git a/vendor/t_pay/src/models/chargeback_status.rs b/vendor/t_pay/src/models/chargeback_status.rs new file mode 100644 index 0000000..e0a2dcf --- /dev/null +++ b/vendor/t_pay/src/models/chargeback_status.rs @@ -0,0 +1,46 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + /// Chargeback creation time + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, + /// Refunded amount + #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, +} + +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, +} diff --git a/vendor/t_pay/src/models/check_fields.rs b/vendor/t_pay/src/models/check_fields.rs new file mode 100644 index 0000000..ab9efbd --- /dev/null +++ b/vendor/t_pay/src/models/check_fields.rs @@ -0,0 +1,22 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, +} + +impl CheckFields { + pub fn new() -> CheckFields { + CheckFields { api_password: None } + } +} diff --git a/vendor/t_pay/src/models/check_response.rs b/vendor/t_pay/src/models/check_response.rs new file mode 100644 index 0000000..eb0fd48 --- /dev/null +++ b/vendor/t_pay/src/models/check_response.rs @@ -0,0 +1,26 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, +} + +impl CheckResponse { + pub fn new() -> CheckResponse { + CheckResponse { + result: None, + content: None, + } + } +} diff --git a/vendor/t_pay/src/models/create_fields.rs b/vendor/t_pay/src/models/create_fields.rs new file mode 100644 index 0000000..4e219ad --- /dev/null +++ b/vendor/t_pay/src/models/create_fields.rs @@ -0,0 +1,131 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + /// 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, + /// 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, + /// 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, + /// 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, + /// url to redirect customer in case of payment success + #[serde(rename = "return_url", skip_serializing_if = "Option::is_none")] + pub return_url: Option, + /// 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, + /// Customer language + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, + /// 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, + /// 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, + /// 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, + /// Two letters - see ISO 3166-1 document + #[serde(rename = "country", skip_serializing_if = "Option::is_none")] + pub country: Option, + /// 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, + /// 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, + /// 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, +} diff --git a/vendor/t_pay/src/models/create_response.rs b/vendor/t_pay/src/models/create_response.rs new file mode 100644 index 0000000..a500040 --- /dev/null +++ b/vendor/t_pay/src/models/create_response.rs @@ -0,0 +1,50 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + /// Transaction title + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + /// transaction amount casted to float + #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// bank account number (only for manual bank transfers) + #[serde(rename = "account_number", skip_serializing_if = "Option::is_none")] + pub account_number: Option, + /// Booking payments online indicator + #[serde(rename = "online", skip_serializing_if = "Option::is_none")] + pub online: Option, + /// Link to transaction (for redirecting to payment) + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + /// optional field, contains names of invalid fields. + #[serde(rename = "desc", skip_serializing_if = "Option::is_none")] + pub desc: Option, +} + +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, + } + } +} diff --git a/vendor/t_pay/src/models/deregister_fields.rs b/vendor/t_pay/src/models/deregister_fields.rs new file mode 100644 index 0000000..cbeb0cb --- /dev/null +++ b/vendor/t_pay/src/models/deregister_fields.rs @@ -0,0 +1,35 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, + /// Sign is calculated from cryptographic hash function set in Merchant’s Panel (default SHA-1): hash_alg (method + cli_auth + 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, + } + } +} diff --git a/vendor/t_pay/src/models/get_fields.rs b/vendor/t_pay/src/models/get_fields.rs new file mode 100644 index 0000000..4909f3a --- /dev/null +++ b/vendor/t_pay/src/models/get_fields.rs @@ -0,0 +1,28 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + } + } +} diff --git a/vendor/t_pay/src/models/get_response.rs b/vendor/t_pay/src/models/get_response.rs new file mode 100644 index 0000000..a7947eb --- /dev/null +++ b/vendor/t_pay/src/models/get_response.rs @@ -0,0 +1,126 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// 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, + /// Transaction creation time + #[serde(rename = "start_time", skip_serializing_if = "Option::is_none")] + pub start_time: Option, + /// Date of payment or empty for pending transactions + #[serde(rename = "payment_time", skip_serializing_if = "Option::is_none")] + pub payment_time: Option, + /// Date of payment refund or empty for not refunded transactions + #[serde(rename = "chargeback_time", skip_serializing_if = "Option::is_none")] + pub chargeback_time: Option, + /// Payment channel ID can be recognised in merchant panel (your offer section) + #[serde(rename = "channel", skip_serializing_if = "Option::is_none")] + pub channel: Option, + /// Returns 1 if transaction was in test mode + #[serde(rename = "test_mode", skip_serializing_if = "Option::is_none")] + pub test_mode: Option, + /// transaction amount casted to float + #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The amount paid by customer + #[serde(rename = "amount_paid", skip_serializing_if = "Option::is_none")] + pub amount_paid: Option, + /// customer name + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// customer email + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// 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, + /// 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, + /// 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, + /// 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, + /// Two letters - see ISO 3166-1 document + #[serde(rename = "country", skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(rename = "err", skip_serializing_if = "Option::is_none")] + pub err: Option, + /// 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>, +} + +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, +} diff --git a/vendor/t_pay/src/models/language.rs b/vendor/t_pay/src/models/language.rs new file mode 100644 index 0000000..9ded539 --- /dev/null +++ b/vendor/t_pay/src/models/language.rs @@ -0,0 +1,62 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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"), + } + } +} diff --git a/vendor/t_pay/src/models/masspayment_authorize_fields.rs b/vendor/t_pay/src/models/masspayment_authorize_fields.rs new file mode 100644 index 0000000..6fbbe2d --- /dev/null +++ b/vendor/t_pay/src/models/masspayment_authorize_fields.rs @@ -0,0 +1,28 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + } + } +} diff --git a/vendor/t_pay/src/models/masspayment_authorize_response.rs b/vendor/t_pay/src/models/masspayment_authorize_response.rs new file mode 100644 index 0000000..a62a821 --- /dev/null +++ b/vendor/t_pay/src/models/masspayment_authorize_response.rs @@ -0,0 +1,26 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl MasspaymentAuthorizeResponse { + pub fn new() -> MasspaymentAuthorizeResponse { + MasspaymentAuthorizeResponse { + result: None, + error: None, + } + } +} diff --git a/vendor/t_pay/src/models/masspayment_create_fields.rs b/vendor/t_pay/src/models/masspayment_create_fields.rs new file mode 100644 index 0000000..183b23b --- /dev/null +++ b/vendor/t_pay/src/models/masspayment_create_fields.rs @@ -0,0 +1,32 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + } + } +} diff --git a/vendor/t_pay/src/models/masspayment_create_response.rs b/vendor/t_pay/src/models/masspayment_create_response.rs new file mode 100644 index 0000000..0d6587f --- /dev/null +++ b/vendor/t_pay/src/models/masspayment_create_response.rs @@ -0,0 +1,45 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + /// Sum of transfers in the package + #[serde(rename = "sum", skip_serializing_if = "Option::is_none")] + pub sum: Option, + /// Number of transfers defined in CSV file + #[serde(rename = "count", skip_serializing_if = "Option::is_none")] + pub count: Option, + /// ID of created pack using method create. + #[serde(rename = "pack_id", skip_serializing_if = "Option::is_none")] + pub pack_id: Option, + /// 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, + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, + #[serde(rename = "desc", skip_serializing_if = "Option::is_none")] + pub desc: Option, +} + +impl MasspaymentCreateResponse { + pub fn new() -> MasspaymentCreateResponse { + MasspaymentCreateResponse { + result: None, + sum: None, + count: None, + pack_id: None, + referers: None, + error: None, + desc: None, + } + } +} diff --git a/vendor/t_pay/src/models/masspayment_err_code.rs b/vendor/t_pay/src/models/masspayment_err_code.rs new file mode 100644 index 0000000..bea2696 --- /dev/null +++ b/vendor/t_pay/src/models/masspayment_err_code.rs @@ -0,0 +1,96 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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"), + } + } +} diff --git a/vendor/t_pay/src/models/masspayment_err_desc.rs b/vendor/t_pay/src/models/masspayment_err_desc.rs new file mode 100644 index 0000000..6689ad5 --- /dev/null +++ b/vendor/t_pay/src/models/masspayment_err_desc.rs @@ -0,0 +1,124 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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)") + } + } + } +} diff --git a/vendor/t_pay/src/models/masspayment_packs_fields.rs b/vendor/t_pay/src/models/masspayment_packs_fields.rs new file mode 100644 index 0000000..f15f399 --- /dev/null +++ b/vendor/t_pay/src/models/masspayment_packs_fields.rs @@ -0,0 +1,36 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + /// Creation date of pack created with method create. + #[serde(rename = "from_date", skip_serializing_if = "Option::is_none")] + pub from_date: Option, + /// Ending date of pack created with method create. + #[serde(rename = "to_date", skip_serializing_if = "Option::is_none")] + pub to_date: Option, + /// 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, + } + } +} diff --git a/vendor/t_pay/src/models/masspayment_packs_response.rs b/vendor/t_pay/src/models/masspayment_packs_response.rs new file mode 100644 index 0000000..b99cfc0 --- /dev/null +++ b/vendor/t_pay/src/models/masspayment_packs_response.rs @@ -0,0 +1,29 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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, + #[serde(rename = "packs", skip_serializing_if = "Option::is_none")] + pub packs: Option>, + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl MasspaymentPacksResponse { + pub fn new() -> MasspaymentPacksResponse { + MasspaymentPacksResponse { + result: None, + packs: None, + error: None, + } + } +} diff --git a/vendor/t_pay/src/models/masspayment_transfers_fields.rs b/vendor/t_pay/src/models/masspayment_transfers_fields.rs new file mode 100644 index 0000000..e6a5bff --- /dev/null +++ b/vendor/t_pay/src/models/masspayment_transfers_fields.rs @@ -0,0 +1,32 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 MasspaymentTransfersFields { + /// ID of created pack using method create. + #[serde(rename = "pack_id", skip_serializing_if = "Option::is_none")] + pub pack_id: Option, + /// Transfer ID in tpay.com system (see method create) + #[serde(rename = "tr_id", skip_serializing_if = "Option::is_none")] + pub tr_id: Option, + /// API password. + #[serde(rename = "api_password", skip_serializing_if = "Option::is_none")] + pub api_password: Option, +} + +impl MasspaymentTransfersFields { + pub fn new() -> MasspaymentTransfersFields { + MasspaymentTransfersFields { + pack_id: None, + tr_id: None, + api_password: None, + } + } +} diff --git a/vendor/t_pay/src/models/masspayment_transfers_response.rs b/vendor/t_pay/src/models/masspayment_transfers_response.rs new file mode 100644 index 0000000..734f17b --- /dev/null +++ b/vendor/t_pay/src/models/masspayment_transfers_response.rs @@ -0,0 +1,29 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 MasspaymentTransfersResponse { + #[serde(rename = "result", skip_serializing_if = "Option::is_none")] + pub result: Option, + #[serde(rename = "transfers", skip_serializing_if = "Option::is_none")] + pub transfers: Option>, + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, +} + +impl MasspaymentTransfersResponse { + pub fn new() -> MasspaymentTransfersResponse { + MasspaymentTransfersResponse { + result: None, + transfers: None, + error: None, + } + } +} diff --git a/vendor/t_pay/src/models/mod.rs b/vendor/t_pay/src/models/mod.rs new file mode 100644 index 0000000..cfe4950 --- /dev/null +++ b/vendor/t_pay/src/models/mod.rs @@ -0,0 +1,96 @@ +pub mod blik_alias; +pub use self::blik_alias::BlikAlias; +pub mod blik_alias_response; +pub use self::blik_alias_response::BlikAliasResponse; +pub mod blik_fields; +pub use self::blik_fields::BlikFields; +pub mod blik_response; +pub use self::blik_response::BlikResponse; +pub mod cards_err_code; +pub use self::cards_err_code::CardsErrCode; +pub mod chargeback_status; +pub use self::chargeback_status::ChargebackStatus; +pub mod check_fields; +pub use self::check_fields::CheckFields; +pub mod check_response; +pub use self::check_response::CheckResponse; +pub mod create_fields; +pub use self::create_fields::CreateFields; +pub mod create_response; +pub use self::create_response::CreateResponse; +pub mod deregister_fields; +pub use self::deregister_fields::DeregisterFields; +pub mod get_fields; +pub use self::get_fields::GetFields; +pub mod get_response; +pub use self::get_response::GetResponse; +pub mod language; +pub use self::language::Language; +pub mod masspayment_authorize_fields; +pub use self::masspayment_authorize_fields::MasspaymentAuthorizeFields; +pub mod masspayment_authorize_response; +pub use self::masspayment_authorize_response::MasspaymentAuthorizeResponse; +pub mod masspayment_create_fields; +pub use self::masspayment_create_fields::MasspaymentCreateFields; +pub mod masspayment_create_response; +pub use self::masspayment_create_response::MasspaymentCreateResponse; +pub mod masspayment_err_code; +pub use self::masspayment_err_code::MasspaymentErrCode; +pub mod masspayment_err_desc; +pub use self::masspayment_err_desc::MasspaymentErrDesc; +pub mod masspayment_packs_fields; +pub use self::masspayment_packs_fields::MasspaymentPacksFields; +pub mod masspayment_packs_response; +pub use self::masspayment_packs_response::MasspaymentPacksResponse; +pub mod masspayment_transfers_fields; +pub use self::masspayment_transfers_fields::MasspaymentTransfersFields; +pub mod masspayment_transfers_response; +pub use self::masspayment_transfers_response::MasspaymentTransfersResponse; +pub mod onetimer; +pub use self::onetimer::Onetimer; +pub mod packs_object; +pub use self::packs_object::PacksObject; +pub mod payment_attempts; +pub use self::payment_attempts::PaymentAttempts; +pub mod presale_fields; +pub use self::presale_fields::PresaleFields; +pub mod refund_any_fields; +pub use self::refund_any_fields::RefundAnyFields; +pub mod refund_any_response; +pub use self::refund_any_response::RefundAnyResponse; +pub mod refund_fields; +pub use self::refund_fields::RefundFields; +pub mod refund_response; +pub use self::refund_response::RefundResponse; +pub mod refund_status_response; +pub use self::refund_status_response::RefundStatusResponse; +pub mod refund_transaction_fields; +pub use self::refund_transaction_fields::RefundTransactionFields; +pub mod register_sale_fields; +pub use self::register_sale_fields::RegisterSaleFields; +pub mod register_sale_response; +pub use self::register_sale_response::RegisterSaleResponse; +pub mod report_fields; +pub use self::report_fields::ReportFields; +pub mod report_response; +pub use self::report_response::ReportResponse; +pub mod result; +pub use self::result::Result; +pub mod sale_fields; +pub use self::sale_fields::SaleFields; +pub mod sale_response; +pub use self::sale_response::SaleResponse; +pub mod securesale_fields; +pub use self::securesale_fields::SecuresaleFields; +pub mod securesale_response; +pub use self::securesale_response::SecuresaleResponse; +pub mod transaction_error_codes; +pub use self::transaction_error_codes::TransactionErrorCodes; +pub mod transfers_object; +pub use self::transfers_object::TransfersObject; +pub mod vc_finish_fields; +pub use self::vc_finish_fields::VcFinishFields; +pub mod vc_prepare_fields; +pub use self::vc_prepare_fields::VcPrepareFields; +pub mod vc_prepare_response; +pub use self::vc_prepare_response::VcPrepareResponse; diff --git a/vendor/t_pay/src/models/onetimer.rs b/vendor/t_pay/src/models/onetimer.rs new file mode 100644 index 0000000..88cffc4 --- /dev/null +++ b/vendor/t_pay/src/models/onetimer.rs @@ -0,0 +1,26 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * The version of the OpenAPI document: 1.2.1 + * Contact: pt@tpay.com + * Generated by: https://openapi-generator.tech + */ + +/// Onetimer : Defines if customer wants to save his card for future use. If this parameter is sent, there will be no cli_auth parameter sent in system notificaion (see presale method) + +/// Defines if customer wants to save his card for future use. If this parameter is sent, there will be no cli_auth parameter sent in system notificaion (see presale method) +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Onetimer { + #[serde(rename = "1")] + _1, +} + +impl ToString for Onetimer { + fn to_string(&self) -> String { + match self { + Self::_1 => String::from("1"), + } + } +} diff --git a/vendor/t_pay/src/models/packs_object.rs b/vendor/t_pay/src/models/packs_object.rs new file mode 100644 index 0000000..ef6e862 --- /dev/null +++ b/vendor/t_pay/src/models/packs_object.rs @@ -0,0 +1,60 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * The version of the OpenAPI document: 1.2.1 + * Contact: pt@tpay.com + * Generated by: https://openapi-generator.tech + */ + +/// PacksObject : Each pack object represents one created pack contents + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PacksObject { + /// ID of created pack using method create. + #[serde(rename = "pack_id", skip_serializing_if = "Option::is_none")] + pub pack_id: Option, + /// Date of package creation + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, + /// Date of package authorization (method authorize) + #[serde(rename = "auth_date", skip_serializing_if = "Option::is_none")] + pub auth_date: Option, + /// Package status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Number of transfers in the package + #[serde(rename = "count", skip_serializing_if = "Option::is_none")] + pub count: Option, + /// Sum of transfers in the package + #[serde(rename = "sum", skip_serializing_if = "Option::is_none")] + pub sum: Option, + /// Additional cost of processing transfers in the package + #[serde(rename = "cost", skip_serializing_if = "Option::is_none")] + pub cost: Option, +} + +impl PacksObject { + /// Each pack object represents one created pack contents + pub fn new() -> PacksObject { + PacksObject { + pack_id: None, + date: None, + auth_date: None, + status: None, + count: None, + sum: None, + cost: None, + } + } +} + +/// Package status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "auth")] + Auth, +} diff --git a/vendor/t_pay/src/models/payment_attempts.rs b/vendor/t_pay/src/models/payment_attempts.rs new file mode 100644 index 0000000..f5a5cda --- /dev/null +++ b/vendor/t_pay/src/models/payment_attempts.rs @@ -0,0 +1,43 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 PaymentAttempts { + /// Time of payment attempt + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, + /// Error code if any occurred. Null if payment was successful. See Transaction API error codes for more details. + #[serde(rename = "paymentErrorCode", skip_serializing_if = "Option::is_none")] + pub payment_error_code: Option, +} + +impl PaymentAttempts { + pub fn new() -> PaymentAttempts { + PaymentAttempts { + date: None, + payment_error_code: None, + } + } +} + +/// Error code if any occurred. Null if payment was successful. See Transaction API error codes for more details. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum PaymentErrorCode { + #[serde(rename = "ERR100")] + ERR100, + #[serde(rename = "ERR101")] + ERR101, + #[serde(rename = "ERR102")] + ERR102, + #[serde(rename = "ERR103")] + ERR103, + #[serde(rename = "ERR104")] + ERR104, +} diff --git a/vendor/t_pay/src/models/presale_fields.rs b/vendor/t_pay/src/models/presale_fields.rs new file mode 100644 index 0000000..a134d1b --- /dev/null +++ b/vendor/t_pay/src/models/presale_fields.rs @@ -0,0 +1,57 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * The version of the OpenAPI document: 1.2.1 + * Contact: pt@tpay.com + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PresaleFields { + /// transaction description + #[serde(rename = "desc")] + pub desc: String, + /// Client token + #[serde(rename = "cli_auth")] + pub cli_auth: String, + /// transaction amount casted to float + #[serde(rename = "amount")] + pub amount: f32, + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, + /// Sign is calculated from cryptographic hash function set in Merchant’s Panel (default SHA-1): hash_alg (method + cli_auth + desc + amount + currency + order_id + language + verification code) where + means concatenation with ampersand symbol. ie. amount + currency = 10.99&985 + #[serde(rename = "sign")] + pub sign: String, + /// transaction currency in ISO numeric format + #[serde(rename = "currency", skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// merchant order ID used to recognise payment + #[serde(rename = "order_id", skip_serializing_if = "Option::is_none")] + pub order_id: Option, + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, +} + +impl PresaleFields { + pub fn new( + desc: String, + cli_auth: String, + amount: f32, + api_password: String, + sign: String, + ) -> PresaleFields { + PresaleFields { + desc, + cli_auth, + amount, + api_password, + sign, + currency: None, + order_id: None, + language: None, + } + } +} diff --git a/vendor/t_pay/src/models/refund_any_fields.rs b/vendor/t_pay/src/models/refund_any_fields.rs new file mode 100644 index 0000000..6a293d9 --- /dev/null +++ b/vendor/t_pay/src/models/refund_any_fields.rs @@ -0,0 +1,32 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 RefundAnyFields { + /// Transaction title + #[serde(rename = "title")] + pub title: String, + /// refund amount (can not be greater than transaction amount) + #[serde(rename = "chargeback_amount")] + pub chargeback_amount: f64, + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, +} + +impl RefundAnyFields { + pub fn new(title: String, chargeback_amount: f64, api_password: String) -> RefundAnyFields { + RefundAnyFields { + title, + chargeback_amount, + api_password, + } + } +} diff --git a/vendor/t_pay/src/models/refund_any_response.rs b/vendor/t_pay/src/models/refund_any_response.rs new file mode 100644 index 0000000..dc6f75d --- /dev/null +++ b/vendor/t_pay/src/models/refund_any_response.rs @@ -0,0 +1,24 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 RefundAnyResponse { + /// Request result (digit; 1 – correct, 0 - incorrect) + #[serde(rename = "result")] + pub result: i32, + #[serde(rename = "err", skip_serializing_if = "Option::is_none")] + pub err: Option, +} + +impl RefundAnyResponse { + pub fn new(result: i32) -> RefundAnyResponse { + RefundAnyResponse { result, err: None } + } +} diff --git a/vendor/t_pay/src/models/refund_fields.rs b/vendor/t_pay/src/models/refund_fields.rs new file mode 100644 index 0000000..f3cd399 --- /dev/null +++ b/vendor/t_pay/src/models/refund_fields.rs @@ -0,0 +1,50 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 RefundFields { + /// Client token + #[serde(rename = "cli_auth", skip_serializing_if = "Option::is_none")] + pub cli_auth: Option, + /// Transaction id in tpay.com system + #[serde(rename = "sale_auth", skip_serializing_if = "Option::is_none")] + pub sale_auth: Option, + #[serde(rename = "desc")] + pub desc: String, + /// transaction currency in ISO numeric format + #[serde(rename = "currency", skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// transaction amount casted to float + #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, + /// Sign is calculated from cryptographic hash function set in Merchant’s Panel (default SHA-1): hash_alg (method + cli_auth + sale_auth + desc + amount + currency + language + verification code); where + means concatenation with ampersand symbol. ie. currency + language = 985&pl + #[serde(rename = "sign")] + pub sign: String, +} + +impl RefundFields { + pub fn new(desc: String, api_password: String, sign: String) -> RefundFields { + RefundFields { + cli_auth: None, + sale_auth: None, + desc, + currency: None, + amount: None, + language: None, + api_password, + sign, + } + } +} diff --git a/vendor/t_pay/src/models/refund_response.rs b/vendor/t_pay/src/models/refund_response.rs new file mode 100644 index 0000000..d46a9b7 --- /dev/null +++ b/vendor/t_pay/src/models/refund_response.rs @@ -0,0 +1,83 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 RefundResponse { + #[serde(rename = "result")] + pub result: crate::models::Result, + /// This parameter is present in response and included in sign calculation only when the merchant account is in test mode. + #[serde(rename = "test_mode", skip_serializing_if = "Option::is_none")] + pub test_mode: Option, + /// Transaction id in tpay.com system + #[serde(rename = "sale_auth")] + pub sale_auth: String, + #[serde(rename = "sale_ref", skip_serializing_if = "Option::is_none")] + pub sale_ref: Option, + /// transaction currency in ISO numeric format + #[serde(rename = "currency")] + pub currency: i32, + /// transaction amount casted to float + #[serde(rename = "amount")] + pub amount: f32, + /// Date of payment + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, + #[serde(rename = "status")] + pub status: Status, + /// Acquirer (Elavon / eService) rejection code - see \"Card Payments Rejection Codes\" for more details + #[serde(rename = "reason", skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Response sign = hash_alg(test_mode + sale_auth + sale_ref + order_id + cli_auth + card + currency + amount + date + status + reason + verification code). + #[serde(rename = "sign")] + pub sign: String, + #[serde(rename = "card", skip_serializing_if = "Option::is_none")] + pub card: Option, + /// Client token + #[serde(rename = "cli_auth", skip_serializing_if = "Option::is_none")] + pub cli_auth: Option, + #[serde(rename = "err_code", skip_serializing_if = "Option::is_none")] + pub err_code: Option, +} + +impl RefundResponse { + pub fn new( + result: crate::models::Result, + sale_auth: String, + currency: i32, + amount: f32, + status: Status, + sign: String, + ) -> RefundResponse { + RefundResponse { + result, + test_mode: None, + sale_auth, + sale_ref: None, + currency, + amount, + date: None, + status, + reason: None, + sign, + card: None, + cli_auth: None, + err_code: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "correct")] + Correct, + #[serde(rename = "declined")] + Declined, +} diff --git a/vendor/t_pay/src/models/refund_status_response.rs b/vendor/t_pay/src/models/refund_status_response.rs new file mode 100644 index 0000000..83e41e6 --- /dev/null +++ b/vendor/t_pay/src/models/refund_status_response.rs @@ -0,0 +1,31 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 RefundStatusResponse { + /// Request result (digit; 1 – correct, 0 - incorrect) + #[serde(rename = "result")] + pub result: i32, + /// Chargebacks associated to transaction + #[serde(rename = "chargebacks", skip_serializing_if = "Option::is_none")] + pub chargebacks: Option>, + #[serde(rename = "err", skip_serializing_if = "Option::is_none")] + pub err: Option, +} + +impl RefundStatusResponse { + pub fn new(result: i32) -> RefundStatusResponse { + RefundStatusResponse { + result, + chargebacks: None, + err: None, + } + } +} diff --git a/vendor/t_pay/src/models/refund_transaction_fields.rs b/vendor/t_pay/src/models/refund_transaction_fields.rs new file mode 100644 index 0000000..4a35892 --- /dev/null +++ b/vendor/t_pay/src/models/refund_transaction_fields.rs @@ -0,0 +1,28 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 RefundTransactionFields { + /// Transaction title + #[serde(rename = "title")] + pub title: String, + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, +} + +impl RefundTransactionFields { + pub fn new(title: String, api_password: String) -> RefundTransactionFields { + RefundTransactionFields { + title, + api_password, + } + } +} diff --git a/vendor/t_pay/src/models/register_sale_fields.rs b/vendor/t_pay/src/models/register_sale_fields.rs new file mode 100644 index 0000000..ae28dba --- /dev/null +++ b/vendor/t_pay/src/models/register_sale_fields.rs @@ -0,0 +1,73 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 RegisterSaleFields { + /// customer name + #[serde(rename = "name")] + pub name: String, + /// customer email + #[serde(rename = "email")] + pub email: String, + /// transaction description + #[serde(rename = "desc")] + pub desc: String, + /// transaction amount casted to float + #[serde(rename = "amount")] + pub amount: f32, + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, + /// Sign is calculated from cryptographic hash function set in Merchant’s Panel (default SHA-1): 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 + #[serde(rename = "sign")] + pub sign: String, + /// transaction currency in ISO numeric format + #[serde(rename = "currency", skip_serializing_if = "Option::is_none")] + pub currency: Option, + #[serde(rename = "onetimer", skip_serializing_if = "Option::is_none")] + pub onetimer: Option, + /// url to redirect customer in case of payment success + #[serde(rename = "pow_url", skip_serializing_if = "Option::is_none")] + pub pow_url: Option, + /// url to redirect customer in case of payment failure + #[serde(rename = "pow_url_blad", skip_serializing_if = "Option::is_none")] + pub pow_url_blad: Option, + /// merchant order ID used to recognise payment + #[serde(rename = "order_id", skip_serializing_if = "Option::is_none")] + pub order_id: Option, + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, +} + +impl RegisterSaleFields { + pub fn new( + name: String, + email: String, + desc: String, + amount: f32, + api_password: String, + sign: String, + ) -> RegisterSaleFields { + RegisterSaleFields { + name, + email, + desc, + amount, + api_password, + sign, + currency: None, + onetimer: None, + pow_url: None, + pow_url_blad: None, + order_id: None, + language: None, + } + } +} diff --git a/vendor/t_pay/src/models/register_sale_response.rs b/vendor/t_pay/src/models/register_sale_response.rs new file mode 100644 index 0000000..6fa64d5 --- /dev/null +++ b/vendor/t_pay/src/models/register_sale_response.rs @@ -0,0 +1,41 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * The version of the OpenAPI document: 1.2.1 + * Contact: pt@tpay.com + * Generated by: https://openapi-generator.tech + */ + +/// RegisterSaleResponse : Successful response schema + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RegisterSaleResponse { + #[serde(rename = "result", skip_serializing_if = "Option::is_none")] + pub result: Option, + /// Transaction id in tpay.com system + #[serde(rename = "sale_auth", skip_serializing_if = "Option::is_none")] + pub sale_auth: Option, + /// Sign is calculated from cryptographic hash function set in Merchant’s Panel (default SHA-1): sha1(sale_auth + verification code) where + means concatenation. + #[serde(rename = "sign", skip_serializing_if = "Option::is_none")] + pub sign: Option, + #[serde(rename = "err_code", skip_serializing_if = "Option::is_none")] + pub err_code: Option, + /// Error code description if an error occurs or not present in response. - see \"Card Payments Rejection Codes\" for more details + #[serde(rename = "err_desc", skip_serializing_if = "Option::is_none")] + pub err_desc: Option, +} + +impl RegisterSaleResponse { + /// Successful response schema + pub fn new() -> RegisterSaleResponse { + RegisterSaleResponse { + result: None, + sale_auth: None, + sign: None, + err_code: None, + err_desc: None, + } + } +} diff --git a/vendor/t_pay/src/models/report_fields.rs b/vendor/t_pay/src/models/report_fields.rs new file mode 100644 index 0000000..d3d123d --- /dev/null +++ b/vendor/t_pay/src/models/report_fields.rs @@ -0,0 +1,32 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 ReportFields { + /// start range of generated report + #[serde(rename = "from_date")] + pub from_date: String, + /// end range of generated report + #[serde(rename = "to_date")] + pub to_date: String, + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, +} + +impl ReportFields { + pub fn new(from_date: String, to_date: String, api_password: String) -> ReportFields { + ReportFields { + from_date, + to_date, + api_password, + } + } +} diff --git a/vendor/t_pay/src/models/report_response.rs b/vendor/t_pay/src/models/report_response.rs new file mode 100644 index 0000000..bd8b235 --- /dev/null +++ b/vendor/t_pay/src/models/report_response.rs @@ -0,0 +1,30 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 ReportResponse { + #[serde(rename = "result", skip_serializing_if = "Option::is_none")] + pub result: Option, + /// Report content encoded in base64. Characters encoding is UTF8. After decoding the report you will get:
(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
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))
Columns are separated by ; (semicolon). + #[serde(rename = "report", skip_serializing_if = "Option::is_none")] + pub report: Option, + #[serde(rename = "err", skip_serializing_if = "Option::is_none")] + pub err: Option, +} + +impl ReportResponse { + pub fn new() -> ReportResponse { + ReportResponse { + result: None, + report: None, + err: None, + } + } +} diff --git a/vendor/t_pay/src/models/result.rs b/vendor/t_pay/src/models/result.rs new file mode 100644 index 0000000..c6f9b3a --- /dev/null +++ b/vendor/t_pay/src/models/result.rs @@ -0,0 +1,29 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * The version of the OpenAPI document: 1.2.1 + * Contact: pt@tpay.com + * Generated by: https://openapi-generator.tech + */ + +/// Result : api call result + +/// api call result +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Result { + #[serde(rename = "0")] + _0, + #[serde(rename = "1")] + _1, +} + +impl ToString for Result { + fn to_string(&self) -> String { + match self { + Self::_0 => String::from("0"), + Self::_1 => String::from("1"), + } + } +} diff --git a/vendor/t_pay/src/models/sale_fields.rs b/vendor/t_pay/src/models/sale_fields.rs new file mode 100644 index 0000000..d6aa08f --- /dev/null +++ b/vendor/t_pay/src/models/sale_fields.rs @@ -0,0 +1,41 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 SaleFields { + /// Client token + #[serde(rename = "cli_auth")] + pub cli_auth: String, + /// Transaction id in tpay.com system + #[serde(rename = "sale_auth")] + pub sale_auth: String, + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, + /// Request sign is calculated from cryptographic hash function set in Merchant’s 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. + #[serde(rename = "sign")] + pub sign: String, +} + +impl SaleFields { + pub fn new( + cli_auth: String, + sale_auth: String, + api_password: String, + sign: String, + ) -> SaleFields { + SaleFields { + cli_auth, + sale_auth, + api_password, + sign, + } + } +} diff --git a/vendor/t_pay/src/models/sale_response.rs b/vendor/t_pay/src/models/sale_response.rs new file mode 100644 index 0000000..eaffa3e --- /dev/null +++ b/vendor/t_pay/src/models/sale_response.rs @@ -0,0 +1,76 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 SaleResponse { + #[serde(rename = "result")] + pub result: crate::models::Result, + /// This parameter is present in response and included in sign calculation only when the merchant account is in test mode. + #[serde(rename = "test_mode", skip_serializing_if = "Option::is_none")] + pub test_mode: Option, + /// Transaction id in tpay.com system + #[serde(rename = "sale_auth")] + pub sale_auth: String, + /// Client token + #[serde(rename = "cli_auth", skip_serializing_if = "Option::is_none")] + pub cli_auth: Option, + /// transaction currency in ISO numeric format + #[serde(rename = "currency")] + pub currency: i32, + /// transaction amount casted to float + #[serde(rename = "amount")] + pub amount: f32, + /// Date of payment + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, + #[serde(rename = "status")] + pub status: Status, + /// Acquirer (Elavon / eService) rejection code - see \"Card Payments Rejection Codes\" for more details + #[serde(rename = "reason", skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Response sign = hash_alg(test_mode + sale_auth + cli_auth + currency + amount + date + status + reason + verification code) + #[serde(rename = "sign")] + pub sign: String, +} + +impl SaleResponse { + pub fn new( + result: crate::models::Result, + sale_auth: String, + currency: i32, + amount: f32, + status: Status, + sign: String, + ) -> SaleResponse { + SaleResponse { + result, + test_mode: None, + sale_auth, + cli_auth: None, + currency, + amount, + date: None, + status, + reason: None, + sign, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "correct")] + Correct, + #[serde(rename = "declined")] + Declined, + #[serde(rename = "done")] + Done, +} diff --git a/vendor/t_pay/src/models/securesale_fields.rs b/vendor/t_pay/src/models/securesale_fields.rs new file mode 100644 index 0000000..f2dc4fe --- /dev/null +++ b/vendor/t_pay/src/models/securesale_fields.rs @@ -0,0 +1,82 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 SecuresaleFields { + /// customer name + #[serde(rename = "name")] + pub name: String, + /// customer email + #[serde(rename = "email")] + pub email: String, + /// transaction description + #[serde(rename = "desc")] + pub desc: String, + /// transaction amount casted to float + #[serde(rename = "amount")] + pub amount: f32, + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, + /// Sign is calculated from cryptographic hash function set in Merchant 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 + #[serde(rename = "sign")] + pub sign: String, + /// transaction currency in ISO numeric format + #[serde(rename = "currency")] + pub currency: i32, + #[serde(rename = "onetimer", skip_serializing_if = "Option::is_none")] + pub onetimer: Option, + /// url to redirect customer in case of payment success + #[serde(rename = "pow_url", skip_serializing_if = "Option::is_none")] + pub pow_url: Option, + /// url to redirect customer in case of payment failure + #[serde(rename = "pow_url_blad", skip_serializing_if = "Option::is_none")] + pub pow_url_blad: Option, + /// merchant order ID used to recognise payment + #[serde(rename = "order_id", skip_serializing_if = "Option::is_none")] + pub order_id: Option, + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, + #[serde(rename = "enable_pow_url", skip_serializing_if = "Option::is_none")] + pub enable_pow_url: Option, + /// Card hash calculated by schema described in method description + #[serde(rename = "card")] + pub card: String, +} + +impl SecuresaleFields { + pub fn new( + name: String, + email: String, + desc: String, + amount: f32, + api_password: String, + sign: String, + currency: i32, + card: String, + ) -> SecuresaleFields { + SecuresaleFields { + name, + email, + desc, + amount, + api_password, + sign, + currency, + onetimer: None, + pow_url: None, + pow_url_blad: None, + order_id: None, + language: None, + enable_pow_url: None, + card, + } + } +} diff --git a/vendor/t_pay/src/models/securesale_response.rs b/vendor/t_pay/src/models/securesale_response.rs new file mode 100644 index 0000000..8936ac1 --- /dev/null +++ b/vendor/t_pay/src/models/securesale_response.rs @@ -0,0 +1,81 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 SecuresaleResponse { + #[serde(rename = "3ds_url", skip_serializing_if = "Option::is_none")] + pub var_3ds_url: Option, + #[serde(rename = "result", skip_serializing_if = "Option::is_none")] + pub result: Option, + /// This parameter is present in response and included in sign calculation only when the merchant account is in test mode. + #[serde(rename = "test_mode", skip_serializing_if = "Option::is_none")] + pub test_mode: Option, + /// Transaction id in tpay.com system + #[serde(rename = "sale_auth", skip_serializing_if = "Option::is_none")] + pub sale_auth: Option, + /// Client token + #[serde(rename = "cli_auth", skip_serializing_if = "Option::is_none")] + pub cli_auth: Option, + /// transaction currency in ISO numeric format + #[serde(rename = "currency", skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// transaction amount casted to float + #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Date of payment + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Acquirer (Elavon / eService) rejection code - see \"Card Payments Rejection Codes\" for more details + #[serde(rename = "reason", skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Card number last 4 digits - for example ****1234 + #[serde(rename = "card", skip_serializing_if = "Option::is_none")] + pub card: Option, + /// 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) + #[serde(rename = "sign", skip_serializing_if = "Option::is_none")] + pub sign: Option, + #[serde(rename = "err_code", skip_serializing_if = "Option::is_none")] + pub err_code: Option, + /// Error code description if an error occurs or not present in response. - see \"Card Payments Rejection Codes\" for more details + #[serde(rename = "err_desc", skip_serializing_if = "Option::is_none")] + pub err_desc: Option, +} + +impl SecuresaleResponse { + pub fn new() -> SecuresaleResponse { + SecuresaleResponse { + var_3ds_url: None, + result: None, + test_mode: None, + sale_auth: None, + cli_auth: None, + currency: None, + amount: None, + date: None, + status: None, + reason: None, + card: None, + sign: None, + err_code: None, + err_desc: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "correct")] + Correct, + #[serde(rename = "declined")] + Declined, +} diff --git a/vendor/t_pay/src/models/transaction_error_codes.rs b/vendor/t_pay/src/models/transaction_error_codes.rs new file mode 100644 index 0000000..e3ef5aa --- /dev/null +++ b/vendor/t_pay/src/models/transaction_error_codes.rs @@ -0,0 +1,89 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * The version of the OpenAPI document: 1.2.1 + * Contact: pt@tpay.com + * Generated by: https://openapi-generator.tech + */ + +/// TransactionErrorCodes : error code (see transaction errors description table) + +/// error code (see transaction errors description table) +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum TransactionErrorCodes { + #[serde(rename = "ERR99")] + ERR99, + #[serde(rename = "ERR98")] + ERR98, + #[serde(rename = "ERR97")] + ERR97, + #[serde(rename = "ERR96")] + ERR96, + #[serde(rename = "ERR85")] + ERR85, + #[serde(rename = "ERR84")] + ERR84, + #[serde(rename = "ERR82")] + ERR82, + #[serde(rename = "ERR63")] + ERR63, + #[serde(rename = "ERR62")] + ERR62, + #[serde(rename = "ERR61")] + ERR61, + #[serde(rename = "ERR55")] + ERR55, + #[serde(rename = "ERR54")] + ERR54, + #[serde(rename = "ERR53")] + ERR53, + #[serde(rename = "ERR52")] + ERR52, + #[serde(rename = "ERR51")] + ERR51, + #[serde(rename = "ERR45")] + ERR45, + #[serde(rename = "ERR44")] + ERR44, + #[serde(rename = "ERR43")] + ERR43, + #[serde(rename = "ERR42")] + ERR42, + #[serde(rename = "ERR41")] + ERR41, + #[serde(rename = "ERR32")] + ERR32, + #[serde(rename = "ERR31")] + ERR31, +} + +impl ToString for TransactionErrorCodes { + fn to_string(&self) -> String { + match self { + Self::ERR99 => String::from("ERR99"), + Self::ERR98 => String::from("ERR98"), + Self::ERR97 => String::from("ERR97"), + Self::ERR96 => String::from("ERR96"), + Self::ERR85 => String::from("ERR85"), + Self::ERR84 => String::from("ERR84"), + Self::ERR82 => String::from("ERR82"), + Self::ERR63 => String::from("ERR63"), + Self::ERR62 => String::from("ERR62"), + Self::ERR61 => String::from("ERR61"), + Self::ERR55 => String::from("ERR55"), + Self::ERR54 => String::from("ERR54"), + Self::ERR53 => String::from("ERR53"), + Self::ERR52 => String::from("ERR52"), + Self::ERR51 => String::from("ERR51"), + Self::ERR45 => String::from("ERR45"), + Self::ERR44 => String::from("ERR44"), + Self::ERR43 => String::from("ERR43"), + Self::ERR42 => String::from("ERR42"), + Self::ERR41 => String::from("ERR41"), + Self::ERR32 => String::from("ERR32"), + Self::ERR31 => String::from("ERR31"), + } + } +} diff --git a/vendor/t_pay/src/models/transfers_object.rs b/vendor/t_pay/src/models/transfers_object.rs new file mode 100644 index 0000000..8abd7c6 --- /dev/null +++ b/vendor/t_pay/src/models/transfers_object.rs @@ -0,0 +1,88 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * The version of the OpenAPI document: 1.2.1 + * Contact: pt@tpay.com + * Generated by: https://openapi-generator.tech + */ + +/// TransfersObject : Each transfer object represents one transfer within specific transfers pack. + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TransfersObject { + /// Date of creating payment + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, + /// Date of payment authorization (method authorize). Field can be empty. + #[serde(rename = "auth_date", skip_serializing_if = "Option::is_none")] + pub auth_date: Option, + /// Date of posting payment + #[serde(rename = "acc_date", skip_serializing_if = "Option::is_none")] + pub acc_date: Option, + /// Payment status + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Bank account number (format IBAN, 26 digits) + #[serde(rename = "accnum", skip_serializing_if = "Option::is_none")] + pub accnum: Option, + /// Receiver name (first part) + #[serde(rename = "rcv1", skip_serializing_if = "Option::is_none")] + pub rcv1: Option, + /// Receiver name (second part) + #[serde(rename = "rcv2", skip_serializing_if = "Option::is_none")] + pub rcv2: Option, + /// Receiver name (third part) + #[serde(rename = "rcv3", skip_serializing_if = "Option::is_none")] + pub rcv3: Option, + /// Receiver name (fourth part) + #[serde(rename = "rcv4", skip_serializing_if = "Option::is_none")] + pub rcv4: Option, + /// transaction amount casted to float + #[serde(rename = "amount", skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Payment title (first part) + #[serde(rename = "title1", skip_serializing_if = "Option::is_none")] + pub title1: Option, + /// Payment title (second part) + #[serde(rename = "title2", skip_serializing_if = "Option::is_none")] + pub title2: Option, + /// Payment ID in tpay.com system + #[serde(rename = "tr_id", skip_serializing_if = "Option::is_none")] + pub tr_id: Option, +} + +impl TransfersObject { + /// Each transfer object represents one transfer within specific transfers pack. + pub fn new() -> TransfersObject { + TransfersObject { + date: None, + auth_date: None, + acc_date: None, + status: None, + accnum: None, + rcv1: None, + rcv2: None, + rcv3: None, + rcv4: None, + amount: None, + title1: None, + title2: None, + tr_id: None, + } + } +} + +/// Payment status +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "pending")] + Pending, + #[serde(rename = "auth")] + Auth, + #[serde(rename = "processed")] + Processed, + #[serde(rename = "done")] + Done, +} diff --git a/vendor/t_pay/src/models/vc_finish_fields.rs b/vendor/t_pay/src/models/vc_finish_fields.rs new file mode 100644 index 0000000..6e2c973 --- /dev/null +++ b/vendor/t_pay/src/models/vc_finish_fields.rs @@ -0,0 +1,48 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 VcFinishFields { + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, + /// Modified summary_data parameter received from visacheckout_prepare. Can + /// be used, when the total amount or other parameters change in the order + /// process. + #[serde(rename = "summary_data", skip_serializing_if = "Option::is_none")] + pub summary_data: Option>, + /// Visa Checkout Call Id + #[serde(rename = "call_id")] + pub call_id: String, + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, + /// Sign is calculated from cryptographic hash function set in Merchant’s + /// Panel (default SHA-1): hash_alg (method + call_id + language + + /// enable_pow_url + verification code) where + means concatenation. + #[serde(rename = "sign")] + pub sign: String, + /// If parameter was sent, system will redirect a customer to the merchant + /// site after payment. 1 – redirect Address is set in Merchant Panel. + #[serde(rename = "enable_pow_url", skip_serializing_if = "Option::is_none")] + pub enable_pow_url: Option, +} + +impl VcFinishFields { + pub fn new(api_password: String, call_id: String, sign: String) -> VcFinishFields { + VcFinishFields { + api_password, + summary_data: None, + call_id, + language: None, + sign, + enable_pow_url: None, + } + } +} diff --git a/vendor/t_pay/src/models/vc_prepare_fields.rs b/vendor/t_pay/src/models/vc_prepare_fields.rs new file mode 100644 index 0000000..98c6cf8 --- /dev/null +++ b/vendor/t_pay/src/models/vc_prepare_fields.rs @@ -0,0 +1,35 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 VcPrepareFields { + /// API password. + #[serde(rename = "api_password")] + pub api_password: String, + /// Visa Checkout Call Id + #[serde(rename = "call_id")] + pub call_id: String, + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, + /// Sign is calculated from cryptographic hash function set in Merchant’s Panel (default SHA-1): hash_alg (method + call_id + language + verification code) where + means concatenation. + #[serde(rename = "sign")] + pub sign: String, +} + +impl VcPrepareFields { + pub fn new(api_password: String, call_id: String, sign: String) -> VcPrepareFields { + VcPrepareFields { + api_password, + call_id, + language: None, + sign, + } + } +} diff --git a/vendor/t_pay/src/models/vc_prepare_response.rs b/vendor/t_pay/src/models/vc_prepare_response.rs new file mode 100644 index 0000000..f6edcf3 --- /dev/null +++ b/vendor/t_pay/src/models/vc_prepare_response.rs @@ -0,0 +1,27 @@ +/* + * Tpay.com Technical Documentation + * + *

Demo transaction/masspayments api key:

Demo cards api key:

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.
Whenever term merchant panel is used it refers to the part of tpay.com website located at secure.tpay.com/panel.

For sandbox purposes use merchant demo account

ID - 1010, Password - demo

Remember that this is a shared account, so all data passed through will be publicly visible.

+ * + * 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 VcPrepareResponse { + #[serde(rename = "result", skip_serializing_if = "Option::is_none")] + pub result: Option, + /// summary Visa Checkout data connected with passed Call Id + #[serde(rename = "summary_data", skip_serializing_if = "Option::is_none")] + pub summary_data: Option>, +} + +impl VcPrepareResponse { + pub fn new() -> VcPrepareResponse { + VcPrepareResponse { + result: None, + summary_data: None, + } + } +}