syntax = "proto3";

package types;

option go_package = "github.com/juspay/connector-service/crates/types-traits/grpc-api-types/proto;proto";

// ============================================================================
// COMMON MESSAGES
// ============================================================================

// Card network types for card payments
enum CardNetwork {
  CARD_NETWORK_UNSPECIFIED = 0;
  VISA = 1;
  MASTERCARD = 2;
  AMEX = 3;
  DISCOVER = 4;
  JCB = 5;
  DINERS = 6;
  UNIONPAY = 7;
  MAESTRO = 8;
  CARTES_BANCAIRES = 9;
  RUPAY = 10;
  INTERAC_CARD = 11;
  STAR = 12;
  PULSE = 13;
  ACCEL = 14;
  NYCE = 15;
  PROP = 16;
  PRIVATE_LABEL = 17;
  DINACARD = 18;
}

// Paysafecard - Prepaid payment method
message PaySafeCard {
  // Fields will be added as needed for Paysafecard integration
}

// ============================================================================
// COMPOSITE MESSAGES
// ============================================================================

// PaymentMethod represents a payment instrument used to process a payment
// It contains a oneof field with all possible payment method 
message PaymentMethod {
  oneof payment_method {
    // CARD METHODS (1-9) - Direct variants
    CardDetails card = 3;                               // Generic card payment
    CardRedirect card_redirect = 4;                     // Card redirect flow
    CardDetailsWithNoCvc card_with_no_cvc = 5;          // Card payment where CVC is not required
    ProxyCardDetails card_proxy = 7;                         // Generic card proxy payment
    TokenPaymentMethodType token = 8;                   // Payment tokens
    
    // ============================================================================
    // DIGITAL WALLETS (10-178)
    // ============================================================================
    
    // --- SDK-BASED WALLETS ---
    // Native wallet SDK integrations with encrypted token exchange
    AppleWallet apple_pay_sdk = 10;                          // Apple Pay
    GoogleWallet google_pay_sdk = 11;                        // Google Pay
    PaypalSdkWallet paypal_sdk = 12;                     // PayPal SDK
    PazeWallet paze_sdk = 13;                                // Paze
    SamsungWallet samsung_pay_sdk = 14;                      // Samsung Pay
    
    // --- THIRD PARTY SDK WALLETS ---
    // Third-party SDK integrations providing tokenized payment data
    ApplePayThirdPartySdkWallet apple_pay_third_party_sdk = 15;   // Apple Pay Third Party SDK
    GooglePayThirdPartySdkWallet google_pay_third_party_sdk = 16;  // Google Pay Third Party SDK
    
    // --- REDIRECT WALLETS ---
    // User redirects to wallet provider to authorize payment
    AmazonPayRedirectWallet amazon_pay_redirect = 17;    // Amazon Pay
    PaypalRedirectWallet paypal_redirect = 18;           // PayPal
    AliPayRedirectWallet ali_pay_redirect = 19;          // AliPay
    RevolutPayRedirectWallet revolut_pay_redirect = 20;  // Revolut Pay
    MifinityRedirectWallet mifinity_redirect = 21;       // Mifinity
    BluecodeRedirectWallet bluecode_redirect = 22;       // Bluecode
    SatispayRedirectWallet satispay_redirect = 23;       // Satispay
    WeroRedirectWallet wero_redirect = 24;               // Wero
    LazyPayRedirectWallet lazypay_redirect = 25;         // LazyPay
    PhonePeRedirectWallet phonepe_redirect = 26;         // PhonePe
    BillDeskRedirectWallet billdesk_redirect = 27;       // BillDesk
    CashfreeRedirectWallet cashfree_redirect = 28;       // Cashfree
    PayURedirectWallet payu_redirect = 29;               // PayU
    EaseBuzzRedirectWallet easebuzz_redirect = 159;      // EaseBuzz
    KakaoPayRedirectWallet kakao_pay_redirect = 160;     // KakaoPay
    MbWayRedirectWallet mb_way_redirect = 161;           // MB WAY Redirect
    MomoRedirectWallet momo_redirect = 162;              // MoMo
    TouchNGoRedirectWallet touch_n_go_redirect = 163;    // Touch 'n Go
    TwintRedirectWallet twint_redirect = 164;            // TWINT
    VippsRedirectWallet vipps_redirect = 165;            // Vipps
    WeChatPayRedirectWallet we_chat_pay_redirect = 167;  // WeChat Pay
    AliPayHKRedirectWallet ali_pay_hk_redirect = 168;    // AliPay HK
    DanaRedirectWallet dana_redirect = 169;              // Dana
    GcashRedirectWallet gcash_redirect = 170;            // GCash
    GoPayRedirectWallet go_pay_redirect = 171;           // GoPay
    MobilePayRedirectWallet mobile_pay_redirect = 172;   // MobilePay
    VenmoRedirectWallet venmo_redirect = 173;            // Venmo
    SkrillRedirectWallet skrill_redirect = 174;          // Skrill
    PayseraRedirectWallet paysera_redirect = 175;        // Paysera
    PaymayaRedirectWallet paymaya_redirect = 186;      // Paymaya Redirect

    // --- DIRECT WALLETS --- (server-to-server; wallet id rides on the payment_method itself)
    QwikcilverDirectWallet qwikcilver_wallet_direct = 185; // Qwikcilver / Pine Labs stored-value wallet

    // --- DEPRECATED REDIRECT WALLETS ---
    RevolutPayWallet revolut_pay = 181;                   // Revolut Pay
    MBWay mb_way = 182;                                   // MB WAY
    Satispay satispay = 183;                              // Satispay
    Wero wero = 184;                                      // Wero
    
    // --- QR CODE WALLETS ---
    // User scans QR code with wallet app to complete payment
    CashappQrWallet cashapp_qr = 178;                     // Cash App
    WeChatPayQrWallet we_chat_pay_qr = 179;               // WeChat Pay QR
    SwishQrWallet swish_qr = 180;                         // Swish QR

    // UPI METHODS (30-39) - Direct variants
    UpiCollect upi_collect = 30;                        // UPI Collect
    UpiIntent upi_intent = 31;                          // UPI Intent
    UpiQr upi_qr = 32;                                  // UPI QR
    
    // ONLINE BANKING (40-59) - Direct variants
    OnlineBankingThailand online_banking_thailand = 40;
    OnlineBankingCzechRepublic online_banking_czech_republic = 41;
    OnlineBankingFinland online_banking_finland = 42;
    OnlineBankingFPX online_banking_fpx = 43;
    OnlineBankingPoland online_banking_poland = 44;
    OnlineBankingSlovakia online_banking_slovakia = 45;
    OpenBankingUK open_banking_uk = 46;
    OpenBankingPIS open_banking_pis = 47;
    LocalBankRedirect local_bank_redirect = 48;
    Ideal ideal = 49;
    Sofort sofort = 50;
    Trustly trustly = 51;
    Giropay giropay = 52;
    Eps eps = 53;
    Przelewy24 przelewy24 = 54;
    Pse pse = 55;
    BancontactCard bancontact_card = 56;
    Blik blik = 57;
    OpenBanking open_banking = 58;
    Interac interac = 59;                                     // Interac - Canadian bank redirect payment method
    Bizum bizum = 156;
    EftBankRedirect eft_bank_redirect = 157;
    
    // MOBILE PAYMENTS (60-69) - Direct variants
    DuitNow duit_now = 60;
    
    // CRYPTOCURRENCY (70-79) - Direct variant
    CryptoCurrency crypto = 70;
    
    // REWARDS (80-89) - Flattened direct variants
    ClassicReward classic_reward = 80;                  // Classic reward points
    EVoucher e_voucher = 81;                           // Electronic voucher (e-voucher)

    // BANK TRANSFER (90-99)
    InstantBankTransfer instant_bank_transfer = 90;            // Generic instant bank transfer
    AchBankTransfer ach_bank_transfer = 91;                    // Automated Clearing House - US bank transfer system
    SepaBankTransfer sepa_bank_transfer = 92;                  // SEPA credit transfer
    BacsBankTransfer bacs_bank_transfer = 93;                  // Bankers' Automated Clearing Services - UK bank transfer
    MultibancoBankTransfer multibanco_bank_transfer = 94;      // Multibanco - Portuguese payment method
    InstantBankTransferFinland instant_bank_transfer_finland = 95;         // Finland's instant bank transfer
    InstantBankTransferPoland instant_bank_transfer_poland = 96;           // Poland's instant bank transfer
    PixPayment pix = 97;                                       // PIX - Brazilian instant payment
    PermataBankTransfer permata_bank_transfer = 130;           // Permata Bank transfer in Indonesia
    BCABankTransfer bca_bank_transfer = 131;                   // BCA Bank transfer in Indonesia
    BNIVaBankTransfer bni_va_bank_transfer = 132;              // BNI VA Bank transfer in Indonesia
    BRIVaBankTransfer bri_va_bank_transfer = 133;              // BRI VA Bank transfer in Indonesia
    CIMBVaBankTransfer cimb_va_bank_transfer = 134;            // CIMB VA Bank transfer in Indonesia
    DanamonVaBankTransfer danamon_va_bank_transfer = 135;      // Danamon VA Bank transfer in Indonesia
    MandiriVaBankTransfer mandiri_va_bank_transfer = 136;      // Mandiri VA Bank transfer in Indonesia
    LocalBankTransfer local_bank_transfer = 154;              // Generic local bank transfer
    IndonesianBankTransfer indonesian_bank_transfer = 155;     // Indonesian bank transfer method

    // DIRECT DEBIT (100-109)
    Ach ach = 100;                                              // Ach - Automated Clearing House
    Sepa sepa = 101;                                            // Sepa - Single Euro Payments Area direct debit
    Bacs bacs = 102;                                            // Bacs - Bankers' Automated Clearing Services
    Becs becs = 103;                                            // Becs - Bulk Electronic Clearing System - Australian direct debit
    SepaGuaranteedDebit sepa_guaranteed_debit = 104;            // SEPA Guaranteed Direct Debit - bank debit with payment guarantee
    Eft eft = 105;                                              // Eft - Electronic Funds Transfer

    // BUY NOW, PAY LATER (110-119)
    Affirm affirm = 110;                                       // Affirm - US BNPL service
    AfterpayClearpay afterpay_clearpay = 111;                  // Afterpay/Clearpay - BNPL service
    Klarna klarna = 112;                                       // Klarna - Swedish BNPL service
    Alma alma = 113;                                           // Alma - French BNPL service
    TamaraRedirect tamara_redirect = 114;                                       // Tamara - Middle Eastern BNPL service
    Atome atome = 115;                                         // Atome - Asian BNPL service

    // NETWORK TRANSACTION METHODS (120-129) - For recurring payments with network transaction IDs
    CardDetailsForNetworkTransactionId card_details_for_network_transaction_id = 120; // Card details with network transaction ID
    NetworkTokenData network_token = 121; // Network token data
    DecryptedWalletTokenDetailsForNetworkTransactionId decrypted_wallet_token_details_for_network_transaction_id = 122; // Network Transaction ID and Decrypted Wallet Token Details
    
    // GIFT CARDS (130-139)
    Givex givex = 137;                                         // Givex gift card
    PaySafeCard pay_safe_card = 138;                           // Paysafecard - Prepaid payment method

    // VOUCHER METHODS (140-149) - Cash and voucher payment methods
    Boleto boleto = 140;                                       // Boleto - Brazilian payment method
    Efecty efecty = 141;                                      // Efecty - Colombian cash payment network
    PagoEfectivo pago_efectivo = 142;                         // PagoEfectivo - Peruvian cash payment method
    RedCompra red_compra = 143;                               // RedCompra - Chilean debit card network
    RedPagos red_pagos = 144;                                  // RedPagos - Uruguayan payment network
    Alfamart alfamart = 145;                                   // Alfamart - Indonesian convenience store payment
    Indomaret indomaret = 146;                           // Indomaret - Indonesian convenience store payment
    Oxxo oxxo = 147;                                     // Oxxo - Mexican convenience store payment
    SevenEleven seven_eleven = 148;                            // 7-Eleven - Convenience store payment
    Lawson lawson = 149;                                      // Lawson - Japanese convenience store payment
    MiniStop mini_stop = 150;                                  // Ministop - Japanese convenience store payment
    FamilyMart family_mart = 151;                             // FamilyMart - Japanese convenience store payment
    Seicomart seicomart = 152;                                // Seicomart - Japanese convenience store payment
    PayEasy pay_easy = 153;                                    // Pay-easy - Japanese bill payment service

    // NETBANKING - Indian net banking (bank redirect)
    NetbankingPayment netbanking = 158;                          // Netbanking - Indian online banking (bank redirect)
  }
}

// ============================================================================
// PAYMENT METHOD CATEGORIES
// ============================================================================

// Note: Payment method categories have been flattened to direct variants in PaymentMethod oneof

// Note: OnlineBankingPaymentMethodType wrapper removed - all banking methods are direct variants

// Note: BNPL payment methods are defined as direct variants in PaymentMethod oneof

// Note: MobilePaymentMethodType wrapper removed - mobile payment methods are direct variants

// Note: CryptoCurrencyPaymentMethodType wrapper removed - CryptoCurrency is a direct variant

// Note: Cash and voucher payment methods are defined as direct variants in PaymentMethod oneof

// Note: Direct debit payment methods are defined as direct variants in PaymentMethod oneof

// Note: Other payment methods are defined as direct variants in PaymentMethod oneof

// ============================================================================
// PAYMENT METHOD DETAILS
// ============================================================================

// Payment method token details.
message TokenPaymentMethodType {
  // The token string representing a payment method.
  SecretString token = 1;
}

// Details of a payment card where CVC is not required for the selected connector flow.
message CardDetailsWithNoCvc {
  // Card Identification
  CardNumberType card_number = 1;
  SecretString card_exp_month = 2;
  SecretString card_exp_year = 3;

  // Cardholder Information
  optional SecretString card_holder_name = 4;

  // Card Metadata
  optional string card_issuer = 5;
  optional CardNetwork card_network = 6;
  optional string card_type = 7;
  optional string card_issuing_country_alpha2 = 8;
  optional string bank_code = 9;
  optional string nick_name = 10;
}

// Details of a payment card.
message CardDetails {
  // Card Identification
  CardNumberType card_number = 1;
  SecretString card_exp_month = 2;
  SecretString card_exp_year = 3;
  SecretString card_cvc = 4;
  
  // Cardholder Information
  optional SecretString card_holder_name = 5;
  
  // Card Metadata
  optional string card_issuer = 6;
  optional CardNetwork card_network = 7;
  optional string card_type = 8;
  optional string card_issuing_country_alpha2 = 9;
  optional string bank_code = 10;
  optional string nick_name = 11;
}

// Details of a payment card.
message ProxyCardDetails {
  // Card Identification
  SecretString card_number = 1;
  SecretString card_exp_month = 2;
  SecretString card_exp_year = 3;
  SecretString card_cvc = 4;
  
  // Cardholder Information
  optional SecretString card_holder_name = 5;
  
  // Card Metadata
  optional string card_issuer = 6;
  optional CardNetwork card_network = 7;
  optional string card_type = 8;
  optional string card_issuing_country_alpha2 = 9;
  optional string bank_code = 10;
  optional string nick_name = 11;
}

message CardNumberType {
  string value = 1;
}

message NetworkTokenType {
  string value = 1;
}

// Card redirect payment method
// Used for card payments that require a redirect to a 3DS page or issuer site
message CardRedirect {
  enum CardRedirectType {
    CARD_REDIRECT_TYPE_UNSPECIFIED = 0;
    KNET = 1;
    BENEFIT = 2;
    MOMO_ATM = 3;
    CARD_REDIRECT = 4;
  }
  CardRedirectType type = 1;
}

// ============================================================================
// WALLET PAYMENT METHODS
// ============================================================================

// Apple Pay - Apple's mobile payment and digital wallet service
message AppleWallet {
  // Apple Pay payment data - can be encrypted string or decrypted data
  message PaymentData{
    oneof payment_data {
      string encrypted_data = 1;     // Encrypted Apple Pay payment data as string
      ApplePayDecryptedData decrypted_data = 2;  // Decrypted Apple Pay payment data
    }
  }
  PaymentData payment_data = 1;
  
  // Payment method details
  message PaymentMethod {
    string display_name = 1;
    string network = 2;
    string type = 3;
  }
  PaymentMethod payment_method = 2;
  
  // Transaction identifier
  string transaction_identifier = 3;
}

// Apple Pay decrypted data structure
message ApplePayDecryptedData {
  // The primary account number
  CardNumberType application_primary_account_number = 1;
  
  // The application expiration date (PAN expiry month)
  SecretString application_expiration_month = 2;
  
  // The application expiration date (PAN expiry year)
  SecretString application_expiration_year = 3;
  
  // Cryptogram data for Apple Pay transactions
  ApplePayCryptogramData payment_data = 4;
}

// Apple Pay cryptogram data structure
message ApplePayCryptogramData {
  // The online payment cryptogram
  SecretString online_payment_cryptogram = 1;
  
  // The ECI (Electronic Commerce Indicator) value
  optional string eci_indicator = 2;
}

// Google Pay - Google's mobile payment platform
message GoogleWallet {
  // Type of payment method
  string type = 1;
  
  // User-facing description of the payment method
  string description = 2;
  
  // Payment method information
  message PaymentMethodInfo {
    // Card network name
    string card_network = 1;
    
    // Card details (usually last 4 digits)
    string card_details = 2;
    
    // Assurance details
    message AssuranceDetails {
      // Indicates that cardholder possession validation has been performed
      bool card_holder_authenticated = 1;
      
      // Indicates that identification and verification was performed
      bool account_verified = 2;
    }
    optional AssuranceDetails assurance_details = 3;
  }

  // Tokenization data - can be either encrypted or decrypted
  message TokenizationData {
    oneof tokenization_data {
      GooglePayDecryptedData decrypted_data = 1;     // Decrypted Google Pay payment data
      GooglePayEncryptedTokenizationData encrypted_data = 2;  // Encrypted Google Pay payment data
    }
  }

  PaymentMethodInfo info = 3;
  TokenizationData tokenization_data = 4;
}

message GooglePayDecryptedData {
  // The card's expiry month
  SecretString card_exp_month = 1;
  
  // The card's expiry year
  SecretString card_exp_year = 2;
  
  // The Primary Account Number (PAN) of the card
  CardNumberType application_primary_account_number = 3;
  
  // Cryptogram generated by the Network
  optional SecretString cryptogram = 4;
  
  // Electronic Commerce Indicator
  optional string eci_indicator = 5;
}

// Google Pay encrypted tokenization data structure
message GooglePayEncryptedTokenizationData {
  // The type of the token
  string token_type = 1;
  
  // Token generated for the wallet
  string token = 2;
}

// Samsung Pay - Samsung's mobile payment service
message SamsungWallet {
  message PaymentCredential {
    // Method type
    optional string method = 1;
    
    // Whether this is a recurring payment
    optional bool recurring_payment = 2;
    
    CardNetwork card_brand = 3;
    
    // Last four digits of DPAN (Device Primary Account Number)
    optional SecretString dpan_last_four_digits = 4;
    
    // Last four digits of card
    SecretString card_last_four_digits = 5;
    
    // 3DS token data
    message TokenData {  
      // 3DS type
      optional string type = 1;
      
      // 3DS version
      string version = 2;
      
      // Token data
      SecretString data = 3;
    }
    TokenData token_data = 6;
  }
  PaymentCredential payment_credential = 1;
}

// Alipay - Chinese digital wallet platform by Ant Group
message AliPayWallet {
  // Fields will be added as needed for Alipay integration
}

// Alipay Hong Kong - Hong Kong version of Alipay
message AliPayHKRedirectWallet {
  // Fields will be added as needed for Alipay HK integration
}

// WeChat Pay - Chinese digital wallet service by Tencent
message WeChatPayWallet {
  // Fields will be added as needed for WeChat Pay integration
}

// Venmo - US mobile payment service owned by PayPal
message VenmoRedirectWallet {
  // Fields will be added as needed for Venmo integration
}

// Amazon Pay - Online payment service by Amazon
message AmazonPayRedirectWallet {
  // Fields will be added as needed for Amazon Pay integration
}

// Qwikcilver / Pine Labs stored-value wallet.
message QwikcilverDirectWallet {
  SecretString wallet_number = 1;
}

// TODO: Should we keep both Paze options, or just one?
// Paze - Digital wallet payment service
message PazeWallet {
  oneof paze_data {
    // Backward-compatible raw payload.
    SecretString complete_response = 1;
    // Structured decrypted Paze payload.
    PazeDecryptedData decrypted_data = 2;
  }
}

message PazeToken {
  NetworkTokenType payment_token = 1;
  SecretString token_expiration_month = 2;
  SecretString token_expiration_year = 3;
  SecretString payment_account_reference = 4;
}

message PazeDynamicData {
  optional SecretString dynamic_data_value = 1;
  optional string dynamic_data_type = 2;
  optional string dynamic_data_expiration = 3;
}

message PazePhoneNumber {
  SecretString country_code = 1;
  SecretString phone_number = 2;
}

message PazeConsumer {
  optional SecretString first_name = 1;
  optional SecretString last_name = 2;
  SecretString full_name = 3;
  SecretString email_address = 4;
  optional PazePhoneNumber mobile_number = 5;
  optional CountryAlpha2 country_code = 6;
  optional string language_code = 7;
}

message PazeAddress {
  optional SecretString name = 1;
  optional SecretString line1 = 2;
  optional SecretString line2 = 3;
  optional SecretString line3 = 4;
  optional SecretString city = 5;
  optional SecretString state = 6;
  optional SecretString zip = 7;
  optional CountryAlpha2 country_code = 8;
}

message PazeDecryptedData {
  SecretString client_id = 1;
  string profile_id = 2;
  PazeToken token = 3;
  CardNetwork payment_card_network = 4;
  repeated PazeDynamicData dynamic_data = 5;
  PazeAddress billing_address = 6;
  PazeConsumer consumer = 7;
  optional string eci = 8;
}
// Mifinity - Online payment service by Mifinity
message MifinityRedirectWallet {
  // Date of birth from Mifinity
  SecretString date_of_birth = 1;
  // Language preference
  optional string language_preference = 2;
}

// PayPal Redirect - PayPal redirect payment service
message PaypalRedirectWallet {
  // PayPal's email address
  optional SecretString email = 1;
}

// WeChat Pay QR - WeChat Pay QR code payment
message WeChatPayQrWallet {
  // Fields will be added as needed for WeChat Pay QR integration
}

// WeChat Pay Redirect - WeChat Pay redirect payment service
message WeChatPayRedirectWallet {
  // Fields will be added as needed for WeChat Pay redirect integration
}

// Alipay Redirect - Alipay redirect payment service
message AliPayRedirectWallet {
  // Fields will be added as needed for Alipay redirect integration
}

// Cash App - Mobile payment service by Block, Inc.
message CashappQrWallet {
  // Fields will be added as needed for Cash App QR integration
}

// Revolut Pay - Revolut digital wallet payment service
message RevolutPayWallet {
}

message BluecodeRedirectWallet {
}

// MB WAY - Portuguese mobile payment solution
message MBWay {
  // Fields will be added as needed for MB WAY integration
}

// Satispay - Italian mobile payment solution
message Satispay {
  // Fields will be added as needed for Satispay integration
}

// Wero - European digital wallet payment solution
message Wero {
  // Fields will be added as needed for Wero integration
}

// Revolut Pay Redirect - Revolut digital wallet payment service
message RevolutPayRedirectWallet {
}

// Satispay Redirect - Italian mobile payment solution
message SatispayRedirectWallet {
  // Fields will be added as needed for Satispay Redirect integration
}

// Wero Redirect - European digital wallet payment solution
message WeroRedirectWallet {
  // Fields will be added as needed for Wero Redirect integration
}

// LazyPay - Indian BNPL/wallet service
message LazyPayRedirectWallet {}

// PhonePe - Indian digital payments platform
message PhonePeRedirectWallet {}

// BillDesk - Indian payment gateway with wallet support
message BillDeskRedirectWallet {}

// Cashfree - Indian payment gateway with wallet support
message CashfreeRedirectWallet {}

// PayU - Indian payment gateway with wallet support
message PayURedirectWallet {}

// EaseBuzz - Indian payment gateway with wallet support
message EaseBuzzRedirectWallet {}

// Dana Redirect - Indonesian digital wallet Dana redirect payment
message DanaRedirectWallet {
  // Fields will be added as needed for Dana redirect integration
}

// GCash Redirect - Filipino mobile wallet GCash redirect payment
message GcashRedirectWallet {
  // Fields will be added as needed for GCash redirect integration
}

// GoPay Redirect - Indonesian digital wallet GoPay redirect payment
message GoPayRedirectWallet {
  // Fields will be added as needed for GoPay redirect integration
}

// KakaoPay Redirect - South Korean mobile payment KakaoPay redirect
message KakaoPayRedirectWallet {
  // Fields will be added as needed for KakaoPay redirect integration
}

// MB Way Redirect - Portuguese mobile payment MB WAY redirect
message MbWayRedirectWallet {
  // Fields will be added as needed for MB WAY redirect integration
}

// MoMo Redirect - Vietnamese digital wallet MoMo redirect payment
message MomoRedirectWallet {
  // Fields will be added as needed for MoMo redirect integration
}

// Touch n Go Redirect - Malaysian e-wallet Touch 'n Go redirect payment
message TouchNGoRedirectWallet {
  // Fields will be added as needed for Touch 'n Go redirect integration
}

// Twint Redirect - Swiss mobile payment TWINT redirect
message TwintRedirectWallet {
  // Fields will be added as needed for TWINT redirect integration
}

// Vipps Redirect - Norwegian mobile payment Vipps redirect
message VippsRedirectWallet {
  // Fields will be added as needed for Vipps redirect integration
}

// Swish QR - Swedish mobile payment Swish QR code payment
message SwishQrWallet {
  // Fields will be added as needed for Swish QR integration
}

// MobilePay Redirect - Danish mobile payment MobilePay redirect
message MobilePayRedirectWallet {
  // Fields will be added as needed for MobilePay redirect integration
}

// Skrill Redirect - Digital wallet for online payments
message SkrillRedirectWallet {
  // Fields will be added as needed for Skrill Redirect integration
}

// Paysera Redirect - European digital wallet and payment service
message PayseraRedirectWallet {
  // Fields will be added as needed for Paysera Redirect integration
}

// Paymaya Redirect - Philippine digital wallet Paymaya redirect
message PaymayaRedirectWallet {
  // Fields will be added as needed for Paymaya redirect integration
}

// Apple Pay Third Party SDK - Apple Pay with token from third-party SDK
message ApplePayThirdPartySdkWallet {
  // Payment token from third-party SDK
  optional SecretString token = 1;
}

// Google Pay Third Party SDK - Google Pay with token from third-party SDK  
message GooglePayThirdPartySdkWallet {
  // Payment token from third-party SDK
  optional SecretString token = 1;
}

// PayPal SDK - PayPal payment with SDK token
message PaypalSdkWallet {
  // Payment token from PayPal SDK
  optional SecretString token = 1;
}

// ============================================================================
// REAL-TIME PAYMENT METHODS
// ============================================================================

// UPI Source types for UPI payments
enum UpiSource {
  UPI_CC = 0;    // UPI Credit Card (RuPay credit on UPI)
  UPI_CL = 1;    // UPI Credit Line
  UPI_ACCOUNT = 2; // UPI Bank Account (Savings)
  UPI_CC_CL = 3; // UPI Credit Card + Credit Line
  UPI_PPI = 4;   // UPI Prepaid Payment Instrument
  UPI_VOUCHER = 5; // UPI Voucher
}

// UPI (Unified Payments Interface) - Indian instant real-time payment system
message UpiCollect {
  // Virtual Payment Address
  optional SecretString vpa_id = 1;
  // UPI source type
  optional UpiSource upi_source = 2;
}

message UpiIntent {
  // App name for UPI Intent
  optional string app_name = 1;
  // UPI source type
  optional UpiSource upi_source = 2;
}

message UpiQr {
  // UPI source type
  optional UpiSource upi_source = 1;
}

// Additional payment method data for UPI payments
// Note: This struct uses `upi_mode` (not `upi_source`) to represent the final
// payment instrument selected by the customer at the connector end.
//
// - `upi_source` in UpiCollect/UpiIntent/UpiQr: The intended UPI source type
//   requested by the merchant (e.g., customer wants to pay via UPI_CC).

message UpiConnectorResponse {
  optional UpiSource upi_mode = 1; // Final UPI source detected from connector response
}

// Netbanking - Indian online banking payment method (bank redirect)
message NetbankingPayment {
  // Bank selection for Indian netbanking
  BankNames issuer = 1;
}

// PIX - Brazilian instant payment ecosystem
message PixPayment {
  // Unique key for PIX transfer
  optional SecretString pix_key = 1;
  
  // CPF (Brazilian tax identification number)
  optional SecretString cpf = 2;
  
  // CNPJ (Brazilian company tax identification number)
  optional SecretString cnpj = 3;
  
  // Source bank account ID
  optional string source_bank_account_id = 4;
  
  // Destination bank account ID
  optional string destination_bank_account_id = 5;
  
  // Session expiry date for Pix QR code (ISO 8601 format, max 5 days from now for Adyen)
  optional string expiry_date = 6;
}

// PromptPay - Thai QR code payment system
message PromptPay {
  // Fields will be added as needed for PromptPay integration
}

// VietQR - Vietnamese QR code payment system
message VietQR {
  // Fields will be added as needed for VietQR integration
}

// ============================================================================
// BANK TRANSFER PAYMENT METHODS
// ============================================================================

// AchBankTransfer (Automated Clearing House) - US electronic funds transfer system
message AchBankTransfer {

}

// BacsBankTransfer (Bankers' Automated Clearing Services) - UK bank transfer system
message BacsBankTransfer {

}

// SEPA Bank Transfer - Credit transfer within the SEPA network
message SepaBankTransfer {

}

// Multibanco - Portuguese payment method
message MultibancoBankTransfer {

}

// Eft Bank Redirect (Electronic Funds Transfer) - Generic electronic transfer of funds
message EftBankRedirect {
  // Identifier for the specific Eft provider/service to be used  
  // Examples: "ozow", "paystack", "instant_eft"
  string provider = 1;
}

/*
// FPS (Faster Payments Service) - UK real-time payments
message FPS {
  // Fields will be added as needed for FPS integration
}
*/

// Local Bank Transfer - Generic local bank transfer method
message LocalBankTransfer {
  // The bank code for local bank transfer
  optional string bank_code = 1;
}

// Indonesian Bank Transfer - Indonesian bank transfer method
message IndonesianBankTransfer {
  // The bank name for bank transfer
  optional BankNames bank_name = 1;
}

// Instant Bank Transfer - Generic instant bank transfer method
message InstantBankTransfer {
  // Fields will be added as needed for instant bank transfers
}

// Instant Bank Transfer Finland - Finland's instant bank transfer method
message InstantBankTransferFinland {
  // Fields will be added as needed for instant bank transfers finland
}

// Instant Bank Transfer Poland - Poland's instant bank transfer method
message InstantBankTransferPoland {
  // Fields will be added as needed for instant bank transfers poland
}

// ============================================================================
// INDONESIAN BANK TRANSFERS (Doku Integration)
// ============================================================================

// BCA Bank Transfer - Bank Central Asia transfer in Indonesia
message BCABankTransfer {
  // Fields will be added as needed for BCA Bank Transfer integration
}

// Permata Bank Transfer - Permata Bank transfer in Indonesia
message PermataBankTransfer {
  // Fields will be added as needed for Permata Bank Transfer integration
}

// BNI VA Bank Transfer - BNI Virtual Account transfer in Indonesia
message BNIVaBankTransfer {
  // Fields will be added as needed for BNI VA Bank Transfer integration
}

// BRI VA Bank Transfer - BRI Virtual Account transfer in Indonesia
message BRIVaBankTransfer {
  // Fields will be added as needed for BRI VA Bank Transfer integration
}

// CIMB VA Bank Transfer - CIMB Virtual Account transfer in Indonesia
message CIMBVaBankTransfer {
  // Fields will be added as needed for CIMB VA Bank Transfer integration
}

// Danamon VA Bank Transfer - Danamon Virtual Account transfer in Indonesia
message DanamonVaBankTransfer {
  // Fields will be added as needed for Danamon VA Bank Transfer integration
}

// Mandiri VA Bank Transfer - Mandiri Virtual Account transfer in Indonesia
message MandiriVaBankTransfer {
  // Fields will be added as needed for Mandiri VA Bank Transfer integration
}

// ============================================================================
// ONLINE BANKING PAYMENT METHODS
// ============================================================================

// Thai online banking systems
message OnlineBankingThailand {
  // Bank issuer for Thailand Online Banking
  BankNames issuer = 1;
}

// Czech Republic online banking systems
message OnlineBankingCzechRepublic {
  // Bank issuer for Czech Republic Online Banking
  BankNames issuer = 1;
}

// Finnish online banking systems
message OnlineBankingFinland {
  // Email address for finland's online banking
  optional SecretString email = 1;
}

// FPX (Financial Process Exchange) - Malaysian online banking
message OnlineBankingFPX {
  BankNames issuer = 1;
}

// Polish online banking systems
message OnlineBankingPoland {
  // Bank issuer for Poland Online Banking
  BankNames issuer = 1;
}

// Slovak online banking systems
message OnlineBankingSlovakia {
  // Bank issuer for Slovakia Online Banking
  BankNames issuer = 1;
}

// UK Open Banking - Open Banking implementation in the UK
message OpenBankingUK {
  // Country code for UK Open Banking
  optional string country = 1;
  // Bank issuer for UK Open Banking
  optional string issuer = 2;
}

// Open Banking - Open Banking implementation
message OpenBanking {
  // Fields will be added as needed for Open Banking integration
}

// Open Banking Payment Initiation Service
message OpenBankingPIS {
  // Fields will be added as needed for Open Banking PIS integration
}

// Generic local bank redirect payment
message LocalBankRedirect {
  // Fields will be added as needed for local bank redirect payments
}

// iDEAL - Dutch online banking payment method
message Ideal {
  // The bank name for ideal
  optional BankNames bank_name = 2;
}

// Sofort - German online banking payment method
message Sofort {
    // The country for bank payment
    optional CountryAlpha2 country = 1;
    
    // Preferred language for bank payment
    optional string preferred_language = 2;
}

// Trustly - European online banking payment method
message Trustly {
  // The customer's country code (required by Trustly)
  optional CountryAlpha2 country = 1;
}

// Giropay - German bank transfer payment method
message Giropay {
  // Bank account bic code
  optional SecretString bank_account_bic = 2;
  
  // Bank account iban
  optional SecretString bank_account_iban = 3;
  
  // The country for bank payment
  optional CountryAlpha2 country = 4;
}

// EPS (Electronic Payment Standard) - Austrian bank transfer system
message Eps {
  // The bank name for eps
  optional BankNames bank_name = 2;
  
  // The country for bank payment
  optional CountryAlpha2 country = 3;
}

// Przelewy24 - Polish payment system
message Przelewy24 {
  // Issuer banks
  optional BankNames bank_name = 1;
}

// Blik - Polish mobile payment system
message Blik {
  optional string blik_code = 1;
}

// Interac - Canadian bank redirect payment method (Interac e-Transfer)
message Interac {
  // The country for the Interac payment (typically CA for Canada)
  optional CountryAlpha2 country = 1;
  
  // The email address for the Interac e-Transfer notification
  optional SecretString email = 2;
}

// PSE (Pagos Seguros en Línea) - Colombian online banking
message Pse {
  // Fields will be added as needed for PSE integration
}

// Bancontact - Belgian debit card scheme
message BancontactCard {
  // The card number
  CardNumberType card_number = 1;
  
  // The card's expiry month
  SecretString card_exp_month = 2;
  
  // The card's expiry year
  SecretString card_exp_year = 3;
  
  // The card holder's name
  SecretString card_holder_name = 4;
}

// ============================================================================
// BUY NOW, PAY LATER PAYMENT METHODS - TODO: Not yet supported
// ============================================================================

// Affirm - US BNPL service
message Affirm {
  // Fields will be added as needed for Affirm integration
}

// Afterpay/Clearpay - BNPL service (Afterpay in US/AU, Clearpay in UK/EU)
message AfterpayClearpay {
  // Fields will be added as needed for Afterpay/Clearpay integration
}

// Klarna - Swedish BNPL service
message Klarna {
  // Fields will be added as needed for Klarna integration
}

// Alma - French BNPL service
message Alma {
  // Fields will be added as needed for Alma integration
}

// Tamara - Middle Eastern BNPL service (redirect-based)
message TamaraRedirect {
  // Fields will be added as needed for tamara integration
}

// Atome - Asian BNPL service
message Atome {
  // Fields will be added as needed for Atome integration
}

/*

// PayBright - Canadian BNPL service
message PayBright {
  // Fields will be added as needed for PayBright integration
}

// Walley - Nordic BNPL service
message Walley {
  // Fields will be added as needed for Walley integration
}
*/

// ============================================================================
// MOBILE PAYMENT METHODS
// ============================================================================

// Bizum - Spanish mobile payment solution
message Bizum {
  // Fields will be added as needed for Bizum integration
}

// DuitNow - Malaysian real-time payment platform
message DuitNow {
  // Fields will be added as needed for DuitNow integration
}

// ============================================================================
// CRYPTOCURRENCY PAYMENT METHODS
// ============================================================================

// Generic cryptocurrency payment
message CryptoCurrency {
  // Currency to pay with
  optional string pay_currency = 1;
  
  // Blockchain network
  optional string network = 2;
}

// ============================================================================
// CASH/VOUCHER PAYMENT METHODS
// ============================================================================

// Alfamart - Indonesian convenience store payment
message Alfamart {
  // Fields will be added as needed for Alfamart integration
}

// Boleto - Brazilian payment method
message Boleto {
  // The shopper's social security number
  optional string social_security_number = 1;

  // Merchant-controlled boleto due date (ISO 8601)
  // use this when provided and otherwise fall back to a connector default.
  optional string expiration_date = 2;
}

// Efecty - Colombian cash payment network
message Efecty {
  // Fields will be added as needed for Efecty integration
}

// Indomaret - Indonesian convenience store payment
message Indomaret {
  // Fields will be added as needed for Indomaret integration
}

// OXXO - Mexican convenience store payment
message Oxxo {
  // Fields will be added as needed for OXXO integration
}

// PagoEfectivo - Peruvian cash payment method
message PagoEfectivo {
  // Fields will be added as needed for PagoEfectivo integration
}

// RedCompra - Chilean debit card network
message RedCompra {
  // Fields will be added as needed for RedCompra integration
}

// RedPagos - Uruguayan payment network
message RedPagos {
  // Fields will be added as needed for RedPagos integration
}

// 7-Eleven - Convenience store payment
message SevenEleven {
  // Fields will be added as needed for 7-Eleven integration
}

// Lawson - Japanese convenience store payment
message Lawson {
  // Fields will be added as needed for Lawson integration
}

// Ministop - Japanese convenience store payment
message MiniStop {
  // Fields will be added as needed for Ministop integration
}

// FamilyMart - Japanese convenience store payment
message FamilyMart {
  // Fields will be added as needed for FamilyMart integration
}

// Seicomart - Japanese convenience store payment
message Seicomart {
  // Fields will be added as needed for Seicomart integration
}

// Pay-easy - Japanese bill payment service
message PayEasy {
  // Fields will be added as needed for Pay-easy integration
}

// JCSVoucher - Japanese convenience store voucher (shared by Lawson, MiniStop, FamilyMart, Seicomart, PayEasy)
message JCSVoucher {
  // Fields will be added as needed for JCS Voucher integration
}



// ============================================================================
// DIRECT DEBIT PAYMENT METHODS - TODO: Not yet supported
// ============================================================================

// Becs - Bulk Electronic Clearing System - Australian direct debit
message Becs {
  // Account number for Becs payment method
  SecretString account_number = 1;
  
  // Bank-State-Branch (bsb) number
  SecretString bsb_number = 2;

  // Owner name for bank debit
  optional SecretString bank_account_holder_name = 3;
}

// Ach - Automated Clearing House
message Ach {
  // Account number for ach bank debit payment
  SecretString account_number = 1;
  
  // Routing number for ach bank debit payment
  SecretString routing_number = 2;
  
  // Card holder name
  SecretString card_holder_name = 3;
  
  // Bank account holder name
  SecretString bank_account_holder_name = 4;
  
  // Bank name
  BankNames bank_name = 5;
  
  // Bank type
  BankType bank_type = 6;
  
  // Bank holder type
  BankHolderType bank_holder_type = 7;
}

// Eft - Electronic Funds Transfer
message Eft {
  // Account number for eft bank debit payment
  SecretString account_number = 1;
  
  // Branch code for eft bank debit payment
  SecretString branch_code = 2;
  
  // Bank account holder name
  SecretString bank_account_holder_name = 3;
  
  // Bank name
  BankNames bank_name = 4;
  
  // Bank type
  BankType bank_type = 5;
}

// Sepa - Single Euro Payments Area direct debit
message Sepa {
  // International bank account number (iban) for SEPA
  SecretString iban = 1;
  
  // Owner name for bank debit
  optional SecretString bank_account_holder_name = 2;
}

// Bacs - Bankers' Automated Clearing Services
message  Bacs {
  // Account number for Bacs payment method
  SecretString account_number = 1;
  
  // Sort code for Bacs payment method
  SecretString sort_code = 2;
  
  // Holder name for bank debit
  optional SecretString bank_account_holder_name = 3;
}

// SEPA Guaranteed Direct Debit - bank debit with payment guarantee
message SepaGuaranteedDebit {
  // International bank account number (iban)
  SecretString iban = 1;

  // Owner name for bank debit
  optional SecretString bank_account_holder_name = 2;
}

// ============================================================================
// OTHER PAYMENT METHODS - TODO: Not yet supported
// ============================================================================

// Note: ClassicReward, RedCompra, RedPagos are defined as active messages below

// Flattened reward payment methods - extensible message types
message ClassicReward {
  // Future fields
}

message EVoucher {
  // Future fields
}

message SecretString {
  string value = 1;
}

// ============================================================================
// GIFT CARDS
// ============================================================================

// Givex - Gift card and loyalty program provider
message Givex {
  // The gift card number
  SecretString number = 1;

  // The card verification code
  SecretString cvc = 2;
}

enum BankNames {
  BANK_NAMES_UNSPECIFIED = 0; // Default value must be first
  AmericanExpress = 1;
  AffinBank = 2;
  AgroBank = 3;
  AllianceBank = 4;
  AmBank = 5;
  BankOfAmerica = 6;
  BankOfChina = 7;
  BankIslam = 8;
  BankMuamalat = 9;
  BankRakyat = 10;
  BankSimpananNasional = 11;
  Barclays = 12;
  BlikPSP = 13;
  CapitalOne = 14;
  Chase = 15;
  Citi = 16;
  CimbBank = 17;
  Discover = 18;
  NavyFederalCreditUnion = 19;
  PentagonFederalCreditUnion = 20;
  SynchronyBank = 21;
  WellsFargo = 22;
  AbnAmro = 23;
  AsnBank = 24;
  Bunq = 25;
  Handelsbanken = 26;
  HongLeongBank = 27;
  HsbcBank = 28;
  Ing = 29;
  Knab = 30;
  KuwaitFinanceHouse = 31;
  Moneyou = 32;
  Rabobank = 33;
  Regiobank = 34;
  Revolut = 35;
  SnsBank = 36;
  TriodosBank = 37;
  VanLanschot = 38;
  ArzteUndApothekerBank = 39;
  AustrianAnadiBankAg = 40;
  BankAustria = 41;
  Bank99Ag = 42;
  BankhausCarlSpangler = 43;
  BankhausSchelhammerUndSchatteraAg = 44;
  BankMillennium = 45;
  reserved 46;  // Reserved for backward compatibility
  BawagPskAg = 47;
  BksBankAg = 48;
  BrullKallmusBankAg = 49;
  BtvVierLanderBank = 50;
  CapitalBankGraweGruppeAg = 51;
  CeskaSporitelna = 52;
  Dolomitenbank = 53;
  EasybankAg = 54;
  EPlatbyVUB = 55;
  ErsteBankUndSparkassen = 56;
  FrieslandBank = 57;
  HypoAlpeadriabankInternationalAg = 58;
  HypoNoeLbFurNiederosterreichUWien = 59;
  HypoOberosterreichSalzburgSteiermark = 60;
  HypoTirolBankAg = 61;
  HypoVorarlbergBankAg = 62;
  HypoBankBurgenlandAktiengesellschaft = 63;
  KomercniBanka = 64;
  MBank = 65;
  MarchfelderBank = 66;
  Maybank = 67;
  OberbankAg = 68;
  OsterreichischeArzteUndApothekerbank = 69;
  OcbcBank = 70;
  PayWithING = 71;
  PlaceZIPKO = 72;
  PlatnoscOnlineKartaPlatnicza = 73;
  PosojilnicaBankEGen = 74;
  PostovaBanka = 75;
  PublicBank = 76;
  RaiffeisenBankengruppeOsterreich = 77;
  RhbBank = 78;
  SchelhammerCapitalBankAg = 79;
  StandardCharteredBank = 80;
  SchoellerbankAg = 81;
  SpardaBankWien = 82;
  SporoPay = 83;
  SantanderPrzelew24 = 84;
  TatraPay = 85;
  Viamo = 86;
  VolksbankGruppe = 87;
  VolkskreditbankAg = 88;
  VrBankBraunau = 89;
  UobBank = 90;
  PayWithAliorBank = 91;
  BankiSpoldzielcze = 92;
  PayWithInteligo = 93;
  BNPParibasPoland = 94;
  BankNowySA = 95;
  CreditAgricole = 96;
  PayWithBOS = 97;
  PayWithCitiHandlowy = 98;
  PayWithPlusBank = 99;
  ToyotaBank = 100;
  VeloBank = 101;
  ETransferPocztowy24 = 102;
  PlusBank = 103;
  BankiSpbdzielcze = 105;
  BankNowyBfgSa = 106;
  GetinBank = 107;
  BlikPoland = 108;
  NoblePay = 109;
  IdeaBank = 110;
  EnveloBank = 111;
  NestPrzelew = 112;
  MbankMtransfer = 113;
  Inteligo = 114;
  PbacZIpko = 115;
  BnpParibas = 116;
  BankPekaoSa = 117;
  VolkswagenBank = 118;
  AliorBank = 119;
  Boz = 120;
  BangkokBank = 121;
  KrungsriBank = 122;
  KrungThaiBank = 123;
  TheSiamCommercialBank = 124;
  KasikornBank = 125;
  OpenBankSuccess = 126;
  OpenBankFailure = 127;
  OpenBankCancelled = 128;
  Aib = 129;
  BankOfScotland = 130;
  DanskeBank = 131;
  FirstDirect = 132;
  FirstTrust = 133;
  Halifax = 134;
  Lloyds = 135;
  Monzo = 136;
  NatWest = 137;
  NationwideBank = 138;
  RoyalBankOfScotland = 139;
  Starling = 140;
  TsbBank = 141;
  TescoBank = 142;
  UlsterBank = 143;
  Yoursafe = 144;
  N26 = 145;
  NationaleNederlanden = 146;
  // Indian banks (Netbanking)
  StateBank = 147;
  HdfcBank = 148;
  IciciBank = 149;
  AxisBank = 150;
  KotakMahindraBank = 151;
  PunjabNationalBank = 152;
  BankOfBaroda = 153;
  UnionBankOfIndia = 154;
  CanaraBank = 155;
  IndusIndBank = 156;
  YesBank = 157;
  IdbiBank = 158;
  FederalBank = 159;
  IndianOverseasBank = 160;
  CentralBankOfIndia = 161;
  Absa = 162;
  AccessBank = 163;
  Albaraka = 164;
  ChinaConstructionBank = 165;
  Discovery = 166;
  EnlBank = 167;
  FirstNationalBank = 168;
  GotymeBank = 169;
  HabibOverseas = 170;
  HbzBank = 171;
  Investec = 172;
  JpMorganChase = 173;
  MtnBanking = 174;
  Olympus = 175;
  OldMutual = 176;
  PermanentBank = 177;
  SocieteGenerale = 178;
  StandardBank = 179;
  StateBankOfIndia = 180;
  Ubank = 181;
  VbsMutualBank = 182;
  BankZero = 183;
  BidvestBank = 184;
  BidvestBankAlliances = 185;
  FbcFidelityBank = 186;
  FinbondEpe = 187;
  FinbondMutualBank = 188;
  Ithala = 189;
  PeoplesBankPepBank = 190;
  PeoplesBank = 191;
  PostBank = 192;
  Nedbank = 193;
  Capitec = 194;
  CapitecBusiness = 195;
  AfricanBank = 196;
  AfricanBankBusiness = 197;
  // Indonesian banks (Airwallex bank_transfer). CimbNiaga is the Indonesian CIMB
  // Niaga, distinct from the Malaysian CimbBank = 17.
  BankMandiri = 198;
  BankDanamon = 199;
  BankNegaraIndonesia = 200;
  BankRakyatIndonesia = 201;
  CimbNiaga = 202;
  PermataBank = 203;
}

// ============================================================================
// NETWORK TRANSACTION PAYMENT METHODS
// ============================================================================

// Card details with network transaction ID for recurring payments
message CardDetailsForNetworkTransactionId {
    CardNumberType card_number = 1;
    SecretString card_exp_month = 2;
    SecretString card_exp_year = 3;
    optional string card_issuer = 4;
    optional CardNetwork card_network = 5;
    optional string card_type = 6;
    optional string card_issuing_country = 7;
    optional string bank_code = 8;
    optional SecretString nick_name = 9;
    optional SecretString card_holder_name = 10;
}

// Decrypted wallet token details with network transaction ID for recurring payments
message DecryptedWalletTokenDetailsForNetworkTransactionId {
    NetworkTokenType decrypted_token = 1;
    SecretString token_exp_month = 2;
    SecretString token_exp_year = 3;
    optional SecretString card_holder_name = 4;
    optional string eci = 5;
    optional TokenSource token_source = 6;
}

/// Source of the token
enum TokenSource {
  TOKEN_SOURCE_UNSPECIFIED = 0;
  GOOGLEPAY = 1;
  APPLEPAY = 2;
}

// Network token data for recurring payments
message NetworkTokenData {
    NetworkTokenType token_number = 1;
    SecretString token_exp_month = 2;
    SecretString token_exp_year = 3;
    optional SecretString token_cryptogram = 4;
    optional string card_issuer = 5;
    optional CardNetwork card_network = 6;
    optional string card_type = 7;
    optional string card_issuing_country = 8;
    optional string bank_code = 9;
    optional SecretString nick_name = 11;
    optional string eci = 12;
}

// Country Alpha-2 code enumeration.
enum CountryAlpha2 {
  COUNTRY_ALPHA2_UNSPECIFIED = 0; // Default value must be first
  US = 1;
  AF = 2;
  AX = 3;
  AL = 4;
  DZ = 5;
  AS = 6;
  AD = 7;
  AO = 8;
  AI = 9;
  AQ = 10;
  AG = 11;
  AR = 12;
  AM = 13;
  AW = 14;
  AU = 15;
  AT = 16;
  AZ = 17;
  BS = 18;
  BH = 19;
  BD = 20;
  BB = 21;
  BY = 22;
  BE = 23;
  BZ = 24;
  BJ = 25;
  BM = 26;
  BT = 27;
  BO = 28;
  BQ = 29;
  BA = 30;
  BW = 31;
  BV = 32;
  BR = 33;
  IO = 34;
  BN = 35;
  BG = 36;
  BF = 37;
  BI = 38;
  KH = 39;
  CM = 40;
  CA = 41;
  CV = 42;
  KY = 43;
  CF = 44;
  TD = 45;
  CL = 46;
  CN = 47;
  CX = 48;
  CC = 49;
  CO = 50;
  KM = 51;
  CG = 52;
  CD = 53;
  CK = 54;
  CR = 55;
  CI = 56;
  HR = 57;
  CU = 58;
  CW = 59;
  CY = 60;
  CZ = 61;
  DK = 62;
  DJ = 63;
  DM = 64;
  DO = 65;
  EC = 66;
  EG = 67;
  SV = 68;
  GQ = 69;
  ER = 70;
  EE = 71;
  ET = 72;
  FK = 73;
  FO = 74;
  FJ = 75;
  FI = 76;
  FR = 77;
  GF = 78;
  PF = 79;
  TF = 80;
  GA = 81;
  GM = 82;
  GE = 83;
  DE = 84;
  GH = 85;
  GI = 86;
  GR = 87;
  GL = 88;
  GD = 89;
  GP = 90;
  GU = 91;
  GT = 92;
  GG = 93;
  GN = 94;
  GW = 95;
  GY = 96;
  HT = 97;
  HM = 98;
  VA = 99;
  HN = 100;
  HK = 101;
  HU = 102;
  IS = 103;
  IN = 104;
  ID = 105;
  IR = 106;
  IQ = 107;
  IE = 108;
  IM = 109;
  IL = 110;
  IT = 111;
  JM = 112;
  JP = 113;
  JE = 114;
  JO = 115;
  KZ = 116;
  KE = 117;
  KI = 118;
  KP = 119;
  KR = 120;
  KW = 121;
  KG = 122;
  LA = 123;
  LV = 124;
  LB = 125;
  LS = 126;
  LR = 127;
  LY = 128;
  LI = 129;
  LT = 130;
  LU = 131;
  MO = 132;
  MK = 133;
  MG = 134;
  MW = 135;
  MY = 136;
  MV = 137;
  ML = 138;
  MT = 139;
  MH = 140;
  MQ = 141;
  MR = 142;
  MU = 143;
  YT = 144;
  MX = 145;
  FM = 146;
  MD = 147;
  MC = 148;
  MN = 149;
  ME = 150;
  MS = 151;
  MA = 152;
  MZ = 153;
  MM = 154;
  NA = 155;
  NR = 156;
  NP = 157;
  NL = 158;
  NC = 159;
  NZ = 160;
  NI = 161;
  NE = 162;
  NG = 163;
  NU = 164;
  NF = 165;
  MP = 166;
  NO = 167;
  OM = 168;
  PK = 169;
  PW = 170;
  PS = 171;
  PA = 172;
  PG = 173;
  PY = 174;
  PE = 175;
  PH = 176;
  PN = 177;
  PL = 178;
  PT = 179;
  PR = 180;
  QA = 181;
  RE = 182;
  RO = 183;
  RU = 184;
  RW = 185;
  BL = 186;
  SH = 187;
  KN = 188;
  LC = 189;
  MF = 190;
  PM = 191;
  VC = 192;
  WS = 193;
  SM = 194;
  ST = 195;
  SA = 196;
  SN = 197;
  RS = 198;
  SC = 199;
  SL = 200;
  SG = 201;
  SX = 202;
  SK = 203;
  SI = 204;
  SB = 205;
  SO = 206;
  ZA = 207;
  GS = 208;
  SS = 209;
  ES = 210;
  LK = 211;
  SD = 212;
  SR = 213;
  SJ = 214;
  SZ = 215;
  SE = 216;
  CH = 217;
  SY = 218;
  TW = 219;
  TJ = 220;
  TZ = 221;
  TH = 222;
  TL = 223;
  TG = 224;
  TK = 225;
  TO = 226;
  TT = 227;
  TN = 228;
  TR = 229;
  TM = 230;
  TC = 231;
  TV = 232;
  UG = 233;
  UA = 234;
  AE = 235;
  GB = 236;
  UM = 237;
  UY = 238;
  UZ = 239;
  VU = 240;
  VE = 241;
  VN = 242;
  VG = 243;
  VI = 244;
  WF = 245;
  EH = 246;
  YE = 247;
  ZM = 248;
  ZW = 249;
}

// The type of bank account
enum BankType {
  BANK_TYPE_UNSPECIFIED = 0;
  BANK_TYPE_CHECKING = 1;
  BANK_TYPE_SAVINGS = 2;
  BANK_TYPE_TRANSMISSION = 3;
  BANK_TYPE_CURRENT = 4;
  BANK_TYPE_BOND = 5;
  BANK_TYPE_SUBSCRIPTION_SHARE = 6;
  BANK_TYPE_SALARY = 7;
  BANK_TYPE_PAYMENT = 8;
}

// The type of entity holding the bank account
enum BankHolderType {
  BANK_HOLDER_TYPE_UNSPECIFIED = 0;
  BANK_HOLDER_TYPE_PERSONAL = 1;
  BANK_HOLDER_TYPE_BUSINESS = 2;
}
