common.providerspecific.cma9

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


syntax = "proto3";
package io.token.proto.common.providerspecific.cma9;
option java_outer_classname = "Cma9";
option csharp_namespace = "Tokenio.Proto.Common.ProviderSpecific.Cma9";

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

message Cma9AccountDetails {
  option (io.token.proto.extensions.message.redact) = true;
  string party_id = 1;
  string party_number = 2;
  PartyType party_type = 3;
  string name = 4;
  string email_address = 5;
  string phone = 6;
  string mobile = 7;
  repeated Cma9Address address = 8;
  AccountType account_type = 9;
  AccountSubtype account_subtype = 10;
  string description = 11;

  message Cma9Address {
    AddressType address_type = 1;
    io.token.proto.common.address.Address address = 2;
  }

  enum PartyType {
    INVALID_PARTY_TYPE = 0;
    DELEGATE = 1;
    JOINT = 2;
    SOLE = 3;
  }

  enum AddressType {
    INVALID_ADDRESS_TYPE = 0;
    BUSINESS = 1;
    CORRESPONDENCE = 2;
    DELIVERYTO = 3;
    MAILTO = 4;
    POBOX = 5;
    POSTAL = 6;
    RESIDENTIAL = 7;
    STATEMENT = 8;
  }

  enum AccountType {
    INVALID_ACCOUNT_TYPE = 0;
    BUSINESS_ACCOUNT = 1;
    PERSONAL_ACCOUNT = 2;
  }

  enum AccountSubtype {
    INVALID_ACCOUNT_SUBTYPE = 0;
    CHARGE_CARD = 1;
    CREDIT_CARD = 2;
    CURRENT_ACCOUNT = 3;
    EMONEY = 4;
    LOAN = 5;
    MORTGAGE = 6;
    PREPAID_CARD = 7;
    SAVINGS = 8;
  }
}

// See field definitions at https://openbanking.atlassian.net/wiki/spaces/DZ/pages/641959800/Standing+Orders+v3.0.
message Cma9StandingOrderDetails {
  option (io.token.proto.extensions.message.redact) = true;
  string frequency = 1;
  io.token.proto.common.money.Money first_payment = 2;
  string first_payment_date_time = 3;
  io.token.proto.common.money.Money next_payment = 4;
  string next_payment_date_time = 5;
  io.token.proto.common.money.Money final_payment = 6;
  string final_payment_date_time = 7;
  CashAccount creditor_account = 8;
}

message CashAccount {
  string scheme_name = 1;
  string identification = 2;
  string name = 3;
}

message Cma9TransferMetadata {
  string instruction_identification = 1;
  string end_to_end_identification = 2;
  Risk risk = 3;
  RemittanceInformation remittance_information = 4 [deprecated = true];
}

// See field definitions at https://openbanking.atlassian.net/wiki/spaces/DZ/pages/1077806077/Domestic+Standing+Orders+v3.1.2.
message Cma9StandingOrderMetadata {
  string frequency = 1;
  io.token.proto.common.money.Money first_payment_amount = 2;
  string first_payment_date_time = 3;
  io.token.proto.common.money.Money recurring_payment_amount = 4;
  string recurring_payment_date_time = 5;
  io.token.proto.common.money.Money final_payment_amount = 6;
  string final_payment_date_time = 7;
  int32 number_of_payments = 8;
  RemittanceInformation remittance_information = 9 [deprecated = true];
  Risk risk = 10;
}

message RemittanceInformation {
  option deprecated = true;
  string reference = 1 [(io.token.proto.extensions.field.hash) = true];
  string reference_hash = 2;
}

message Risk {
  PaymentContextCode payment_context_code = 1;
  string merchant_category_code = 2; // Category code conform to ISO 18245
  string merchant_customer_identification = 3;
  DeliveryAddress delivery_address = 4;
}

enum PaymentContextCode {
  INVALID_PAYMENT_CONTEXT_CODE = 0;
  BILL_PAYMENT = 1;
  ECOMMERCE_GOODS = 2;
  ECOMMERCE_SERVICES = 3;
  OTHER = 4;
  PARTY_TO_PARTY = 5;
}

message DeliveryAddress {
  repeated string address_line = 1;
  string street_name = 2;
  string building_number = 3;
  string post_code = 4;
  string town_name = 5;
  repeated string country_sub_division = 6;
  string country = 7;
}