common.providerspecific.polishapi

io.token.proto.common.providerspecific.polishapi common/src/main/proto/provider/polishapi.proto


syntax = "proto3";
package io.token.proto.common.providerspecific.polishapi;
option java_outer_classname = "PolishApi";
option csharp_namespace = "Tokenio.Proto.Common.ProviderSpecific.PolishApi";
option objc_class_prefix = "POLISHAPI";

import "extensions/field.proto";
import "extensions/message.proto";

message PolishApiAccountDetails {
  NameAddress name_address = 1;
  AccountHolderType account_holder_type = 2;
  string account_name_client = 3 [(io.token.proto.extensions.field.redact) = true];
  string currency = 4;
  BankAccountInfo bank = 5;
  repeated AccountPsuRelation psu_relations = 6;
  map<string, string> auxData = 7 [(io.token.proto.extensions.field.redact) = true];
}

message PolishApiTransactionDetails {
  string transaction_type = 1;
  string mcc = 2;
  map<string, string> auxData = 3 [(io.token.proto.extensions.field.redact) = true];
  NameAddress initiator = 4;
  SenderRecipient sender = 5;
  SenderRecipient recipient = 6;
  string trade_date = 7;
  string post_transaction_balance = 8;
  string rejection_date = 9;
  string rejection_reason = 10;

  // from Polish API getTransactionDetail endpoint
  TransactionInfoZus zus_info = 11;
  TransactionInfoTax tax_info = 12;
  TransactionInfoCard card_info = 13;
  string currency_date = 14;
  repeated CurrencyRate transaction_rate = 15;
  string base_currency = 16;
  string account_base_currency = 17;
  string used_payment_instrument_id = 18;
  string tpp_transaction_id = 19;
  string tpp_name = 20;
  string hold_expiration_date = 21;
}

message PolishApiTransferMetadata {
  DeliveryMode delivery_mode = 1;
  bool hold = 2; // indicates that the funds should be reserved until the payment is executable (e.g. for Bank holidays)
}

message PolishApiStandingOrderMetadata {
  DeliveryMode delivery_mode = 1;
  bool hold = 2; // indicates that the funds should be reserved until the payment is executable (e.g. for Bank holidays)
}

enum DeliveryMode {
  INVALID_DELIVERY_MODE = 0;
  STANDARD_D2 = 1; // only applies to non-EEA destinations
  STANDARD_D1 = 2; // only applies to EEA destinations
  URGENT_D1 = 3; // only applies to non-EEA destinations
  EXPRESS_D0 = 4; // applies to all destinations
}

message SenderRecipient {
  option (io.token.proto.extensions.message.redact) = true;
  string account_number = 1;
  string account_mass_payment = 2;
  Bank bank = 3;
  NameAddress name_address = 4;
}

message AccountPsuRelation {
  TypeOfRelation type_of_relation = 1;
  TypeOfProxy type_of_proxy = 2;
  int32 stake = 3;
}

enum TypeOfRelation {
  INVALID_TYPE_OF_RELATION = 0;
  OWNER = 1;
  BORROWER = 2;
  GUARANTOR = 3;
  PROXY_OWNER = 4;
  BENEFICIARY = 5;
  TRUSTEE = 6;
}

enum TypeOfProxy {
  INVALID_TYPE_OF_PROXY = 0;
  GENERAL = 1;
  SPECIAL = 2;
  ADMINISTRATOR = 3;
  USER = 4;
}

message NameAddress {
  option (io.token.proto.extensions.message.redact) = true;
  repeated string value = 1;
}

enum AccountHolderType {
  INVALID_ACCOUNT_HOLDER_TYPE = 0;
  INDIVIDUAL = 1;
  CORPORATION = 2;
}

message BankAccountInfo {
  option (io.token.proto.extensions.message.redact) = true;
  string bic_or_swift = 1 [deprecated = true]; // use AccountDetails.bic field instead
  string name = 2;
  repeated string address = 3;
}

message Bank {
  string bic_or_swift = 1;
  string name = 2;
  string code = 3;
  string country_code = 4;
  repeated string address = 5;
}

message TransactionInfoZus {
  SocialSecurityPayer payer_info = 1;
  string contribution_type = 2;
  string contribution_id = 3;
  string contribution_period = 4;
  string payment_type_id = 5;
  string obligation_id = 6;
}

message TransactionInfoTax {
  Payer payer_info = 1;
  string form_code = 2;
  string period_id = 3;
  string period_type = 4;
  int32 year = 5;
  string obligation_id = 6;
}

message TransactionInfoCard {
  option (io.token.proto.extensions.message.redact) = true;
  string card_holder = 1;
  string card_number = 2;
}

message SocialSecurityPayer {
  option (io.token.proto.extensions.message.redact) = true;
  string nip = 1;
  string additional_payer_id = 2;
  string additional_payer_id_type = 3;
}

message Payer {
  string payer_id = 1;
  string payer_id_type = 2;
}

message CurrencyRate {
  double rate = 1;
  string from_currency = 2;
  string to_currency = 3;
}