1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.paymentgateway.issuerswitch.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/type/latlng.proto"; 21import "google/type/money.proto"; 22 23option csharp_namespace = "Google.Cloud.PaymentGateway.IssuerSwitch.V1"; 24option go_package = "cloud.google.com/go/paymentgateway/issuerswitch/apiv1/issuerswitchpb;issuerswitchpb"; 25option java_multiple_files = true; 26option java_outer_classname = "CommonFieldsProto"; 27option java_package = "com.google.cloud.paymentgateway.issuerswitch.v1"; 28option php_namespace = "Google\\Cloud\\PaymentGateway\\IssuerSwitch\\V1"; 29option ruby_package = "Google::Cloud::PaymentGateway::IssuerSwitch::V1"; 30 31// A reference to uniquely identify an account according to India's UPI 32// standards. 33message AccountReference { 34 // IFSC of the account's bank branch. 35 string ifsc = 1; 36 37 // Output only. Type of account. Examples include SAVINGS, CURRENT, etc. 38 string account_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 39 40 // Unique number for an account in a bank and branch. 41 string account_number = 3; 42} 43 44// A participant in a payment settlement transaction processed by the issuer 45// switch. The participant could either be the payer or the payee in the 46// transaction. 47message SettlementParticipant { 48 // Details about a payment settlement. 49 message SettlementDetails { 50 // Output only. The id for the settlement in the bank's backend system. In 51 // UPI, this maps to the approval reference number. This value will be 52 // present only if this API transaction's state is SUCCEEDED. 53 string backend_settlement_id = 1 54 [(google.api.field_behavior) = OUTPUT_ONLY]; 55 56 // Output only. A code indicating additional details about the settlement. 57 // In UPI, this maps to the response code. 58 string code = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 59 60 // Output only. A code indicating additional details about the reversal of a 61 // settlement. In UPI, this maps to the reversal response code. 62 string reversal_code = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 63 64 // Output only. The amount settled as part of this API transaction. If the 65 // settlement had failed, then this value will be 0.00. 66 google.type.Money settled_amount = 4 67 [(google.api.field_behavior) = OUTPUT_ONLY]; 68 } 69 70 // The participant information. 71 Participant participant = 1; 72 73 // Information about a merchant who is a participant in the payment. This 74 // field will be specified only if the participant is a merchant. 75 MerchantInfo merchant_info = 2; 76 77 // Output only. The mobile number of the participant. 78 string mobile = 3 79 [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; 80 81 // Output only. Additional details about the payment settlement. Values will 82 // be populated depending on whether the settlement transaction succeeded or 83 // failed. 84 SettlementDetails details = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; 85} 86 87// A participant's device tags 88message DeviceDetails { 89 // The payment application on the device. 90 string payment_app = 1; 91 92 // The capability of the device. 93 string capability = 2; 94 95 // The geo-code of the device. 96 google.type.LatLng geo_code = 3; 97 98 // The device's ID. 99 string id = 4; 100 101 // The device's IP address. 102 string ip_address = 5; 103 104 // The coarse location of the device. 105 string location = 6; 106 107 // The operating system on the device. 108 string operating_system = 7; 109 110 // The device's telecom provider. 111 string telecom_provider = 8; 112 113 // The type of device. 114 string type = 9; 115} 116 117// A participant in a transaction processed by the issuer switch. 118message Participant { 119 // The type of the participant. 120 enum Persona { 121 // Unspecified persona. 122 PERSONA_UNSPECIFIED = 0; 123 124 // Participant is an entity. 125 ENTITY = 1; 126 127 // Participant is a person. 128 PERSON = 2; 129 } 130 131 // The payment address of the participant. In the UPI system, this will be the 132 // virtual payment address (VPA) of the participant. 133 string payment_address = 1; 134 135 // The persona of the participant. 136 Persona persona = 2; 137 138 // The name of the participant. 139 string user = 3; 140 141 // Output only. Unique identification of an account according to India's UPI 142 // standards. 143 AccountReference account = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; 144 145 // Output only. The device info of the participant. 146 DeviceDetails device_details = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 147 148 // Output only. The mobile number of the participant. 149 string mobile_number = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 150} 151 152// A merchant entity participating in a payment settlement transaction. 153message MerchantInfo { 154 // A unique identifier for the merchant. 155 string id = 1; 156 157 // The name of the merchant who is a party in the payment. Includes multiple 158 // possible names for the merchant. 159 MerchantName merchant = 2; 160 161 // Additional information about the merchant. 162 MerchantAdditionalInfo additional_info = 3; 163} 164 165// The name of a merchant who is a participant in a payment settlement 166// transaction. Includes multiple possible names for the merchant. 167message MerchantName { 168 // The brand name of the merchant. 169 string brand = 1; 170 171 // The merchant's legal name. 172 string legal = 2; 173 174 // The franchise name under which the merchant operates. 175 string franchise = 3; 176} 177 178// Additional merchant information specific to India's UPI requirements. 179message MerchantAdditionalInfo { 180 // Indicates the merchant's type as a small or large merchant. 181 enum Type { 182 // Unspecified merchant type. 183 TYPE_UNSPECIFIED = 0; 184 185 // Large merchant. 186 LARGE = 1; 187 188 // Small merchant. 189 SMALL = 2; 190 } 191 192 // Indicates whether the merchant is an online or offline merchant. 193 enum Genre { 194 // Unspecified merchant genre. 195 GENRE_UNSPECIFIED = 0; 196 197 // Offline merchant 198 OFFLINE = 1; 199 200 // Online merchant. 201 ONLINE = 2; 202 } 203 204 // Indicates whether the merchant has been onboarded by a bank or an 205 // aggregator. 206 enum OnboardingType { 207 // Unspecified merchant onboarding type. 208 ONBOARDING_TYPE_UNSPECIFIED = 0; 209 210 // Onboarded by aggreagator. 211 AGGREGATOR = 1; 212 213 // Onboarded by bank. 214 BANK = 2; 215 216 // Onboarded by the UPI network. 217 NETWORK = 3; 218 219 // Onboarded by the TPAP. 220 TPAP = 4; 221 } 222 223 // Indicates the ownership type of the merchant. 224 enum OwnershipType { 225 // Unspecified merchant ownership type. 226 OWNERSHIP_TYPE_UNSPECIFIED = 0; 227 228 // Properietary ownership. 229 PROPRIETARY = 1; 230 231 // Partnership ownership. 232 PARTNERSHIP = 2; 233 234 // Public ownership. 235 PUBLIC = 3; 236 237 // Private ownership. 238 PRIVATE = 4; 239 240 // Other ownership model. 241 OTHERS = 5; 242 } 243 244 // Merchant Category Code (MCC) as specified by UPI. This is a four-digit 245 // number listed in ISO 18245 for retail financial services. 246 string category_code = 1; 247 248 // A unique identifier for the merchant store where the payment settlement 249 // transaction occurred. 250 string store_id = 2; 251 252 // A unique identifier for the POS terminal in the store where the payment 253 // settlement transaction occurred. 254 string terminal_id = 3; 255 256 // Indicates the type of merchant. 257 Type type = 4; 258 259 // Indicates the genre of the merchant. 260 Genre genre = 5; 261 262 // Indicates the merchant's onboarding type. 263 OnboardingType onboarding_type = 6; 264 265 // Indicates the merchant's owner type. 266 OwnershipType ownership_type = 7; 267} 268 269// The API type for a transaction. Every transaction processed by the issuer 270// switch will be one of these API types. 271enum ApiType { 272 // Unspecified API type. 273 API_TYPE_UNSPECIFIED = 0; 274 275 // Balance API. Maps to UPI's `BalEnq` API. This is a metadata 276 // transaction API. 277 BALANCE = 1; 278 279 // Check transaction status API. Maps to UPI's `ChkTxn` API. This is a 280 // metadata transaction API. 281 CHECK_STATUS = 2; 282 283 // Complaint API. Maps to UPI's `Complaint` API. This is a dispute and issue 284 // resolution API. 285 COMPLAINT = 3; 286 287 // Heart beat API. Maps to UPI's `Hbt` API. This is a metadata transaction 288 // API. 289 HEART_BEAT = 4; 290 291 // Initiate registration API. Maps to UPI's `Otp` API. This is a metadata 292 // transaction API. 293 INITIATE_REGISTRATION = 5; 294 295 // List accounts API. Maps to UPI's `ListAccount` API. This is a metadata 296 // transaction API. 297 LIST_ACCOUNTS = 6; 298 299 // Mandate API. Maps to UPI's `Mandate` API. This is a metadata transaction 300 // API. 301 MANDATE = 7; 302 303 // Mandate confirmation API. Maps to UPI's `MandateConfirmation` API. This is 304 // a metadata transaction API. 305 MANDATE_CONFIRMATION = 8; 306 307 // Payment settlement API. Maps to UPI's `Pay` API. This is a financial 308 // transaction API. 309 SETTLE_PAYMENT = 9; 310 311 // Update credentials API. Maps to UPI's `SetCre` API. This is a metadata 312 // transaction API. 313 UPDATE_CREDENTIALS = 10; 314 315 // Validate registration API. Maps to UPI's `RegMob` API. This is a metadata 316 // transaction API. 317 VALIDATE_REGISTRATION = 11; 318 319 // Validate customer API. Maps to UPI's `ValCust` API. This is a validation 320 // API. 321 VALIDATE_CUSTOMER = 12; 322 323 // Voucher API. Maps to UPI's `Voucher` API. 324 VOUCHER = 13; 325 326 // Voucher confirmation API. Maps to UPI's `VoucherConfirmation` API. 327 VOUCHER_CONFIRMATION = 14; 328 329 // Activation API. Maps to UPI's `Activation` API. 330 ACTIVATION = 15; 331} 332 333// The type of a transaction. Every transaction processed by the issuer switch 334// will be one of these transaction types. Transaction types are associated with 335// a particular API type. This associated is documented with each value. 336enum TransactionType { 337 // Unspecified transaction type. 338 TRANSACTION_TYPE_UNSPECIFIED = 0; 339 340 // Autoupdate transaction type. This is associated with the `CHECK_STATUS` 341 // API type. Maps to UPI's `AUTOUPDATE` type. 342 TRANSACTION_TYPE_AUTOUPDATE = 1; 343 344 // Balance check transaction type. This is associated with the 345 // `BALANCE_ENQUIRY` API type. Maps to UPI's `BalChk` type. 346 TRANSACTION_TYPE_BALANCE_CHECK = 2; 347 348 // Balance enquiry transaction type. This is associated with the 349 // `BALANCE_ENQUIRY` API type. Maps to UPI's `BalEnq` type. 350 TRANSACTION_TYPE_BALANCE_ENQUIRY = 3; 351 352 // Check status transaction type. This is associated with the `COMPLAINT` API 353 // type. Maps to UPI's `CHECKSTATUS` type. 354 TRANSACTION_TYPE_CHECK_STATUS = 4; 355 356 // Check transaction type. This is associated with the `CHECK_STATUS` API 357 // type. Maps to UPI's `ChkTxn` type. 358 TRANSACTION_TYPE_CHECK_TRANSACTION = 5; 359 360 // Complaint transaction type. This is associated with the `COMPLAINT` API 361 // type. Maps to UPI's `COMPLAINT` type. 362 TRANSACTION_TYPE_COMPLAINT = 6; 363 364 // Create transaction type. This is associated with the `MANDATE` API type. 365 // Maps to UPI's `CREATE` type. 366 TRANSACTION_TYPE_CREATE = 7; 367 368 // Credit transaction type. This is associated with the `SETTLE_PAYMENT` API 369 // type. Maps to UPI's `CREDIT` type. 370 TRANSACTION_TYPE_CREDIT = 8; 371 372 // Debit transaction type. This is associated with the `SETTLE_PAYMENT` API 373 // type. Maps to UPI's `DEBIT` type. 374 TRANSACTION_TYPE_DEBIT = 9; 375 376 // Dispute transaction type. This is associated with the `COMPLAINT` API 377 // type. Maps to UPI's `DISPUTE` type. 378 TRANSACTION_TYPE_DISPUTE = 10; 379 380 // Heart beat transaction type. This is associated with `HEART_BEAT` API type. 381 // Maps to UPI's `Hbt` type. 382 TRANSACTION_TYPE_HEART_BEAT = 11; 383 384 // List accounts transaction type. This is associated with `LIST_ACCOUNTS` API 385 // type. Maps to UPI's `ListAccount` type. 386 TRANSACTION_TYPE_LIST_ACCOUNTS = 12; 387 388 // Mandate notification transaction type. This is associated with the 389 // `VALIDATE_CUSTOMER` API type. Maps to UPI's `MandateNotification` type. 390 TRANSACTION_TYPE_MANDATE_NOTIFICATION = 13; 391 392 // OTP transaction type. This is associated with the `INITIATE_REGISTRATION` 393 // API type. Maps to UPI's `Otp` type. 394 TRANSACTION_TYPE_OTP = 14; 395 396 // Pause transaction type. This is associated with the `MANDATE` API type. 397 // Maps to UPI's `PAUSE` type. 398 TRANSACTION_TYPE_PAUSE = 15; 399 400 // Redeem transaction type. This is associated with the `VOUCHER_CONFIRMATION` 401 // API type. Maps to UPI's `REDEEM` type. 402 TRANSACTION_TYPE_REDEEM = 16; 403 404 // Refund transaction type. This is associated with the `COMPLAINT` API 405 // type. Maps to UPI's `REFUND` type. 406 TRANSACTION_TYPE_REFUND = 17; 407 408 // Register mobile transaction type. This is associated with the 409 // `VALIDATE_REGISTRATION` API type. Maps to UPI's `RegMob` type. 410 TRANSACTION_TYPE_REGISTER_MOBILE = 18; 411 412 // Reversal transaction type. This is associated with the `SETTLE_PAYMENT` and 413 // `COMPLAINT` API types. Maps to UPI's `REVERSAL` type. 414 TRANSACTION_TYPE_REVERSAL = 19; 415 416 // Revoke transaction type. This is associated with the `MANDATE` API type. 417 // Maps to UPI's `REVOKE` type. 418 TRANSACTION_TYPE_REVOKE = 20; 419 420 // Status update transaction type. This is associated with the `COMPLAINT` API 421 // type. Maps to UPI's `STATUSUPDATE` type. 422 TRANSACTION_TYPE_STATUS_UPDATE = 21; 423 424 // Update transaction type. This is associated with the `MANDATE` API type. 425 // Maps to UPI's `UNPAUSE` type. 426 TRANSACTION_TYPE_UNPAUSE = 22; 427 428 // Update transaction type. This is associated with the `MANDATE` API type. 429 // Maps to UPI's `UPDATE` type. 430 TRANSACTION_TYPE_UPDATE = 23; 431 432 // Update credentials transaction type. This is associated with 433 // `UPDATE_CREDENTIALS` API type. Maps to UPI's `SetCre` type. 434 TRANSACTION_TYPE_UPDATE_CREDENTIALS = 24; 435 436 // Validate customer transaction type. This is associated with 437 // `VALIDATE_CUSTOMER` API type. Maps to UPI's `ValCust` type. 438 TRANSACTION_TYPE_VALIDATE_CUSTOMER = 25; 439 440 // Activation international transaction type. This is associated with 441 // 'ACTIVATION' API type. Maps to UPI's `International` type. 442 TRANSACTION_TYPE_ACTIVATION_INTERNATIONAL = 26; 443 444 // Activation UPI services transaction type. This is associated with 445 // 'ACTIVATION' API type. Maps to UPI's `UPI Services` type. 446 TRANSACTION_TYPE_ACTIVATION_UPI_SERVICES = 27; 447} 448 449// XmlApiType specifies the API type of the request or response as specified in 450// the XML payload. 451enum XmlApiType { 452 // Unspecified API type. 453 XML_API_TYPE_UNSPECIFIED = 0; 454 455 // Balance enquiry request API type. Maps to UPI's `ReqBalEnq` API. 456 REQ_BAL_ENQ = 1; 457 458 // Check transaction request API type. Maps to UPI's `ReqChkTxn` API. 459 REQ_CHK_TXN = 2; 460 461 // Complaint request API type. Maps to UPI's `ReqComplaint` API. 462 REQ_COMPLAINT = 3; 463 464 // Heart beat request API type. Maps to UPI's `ReqHbt` API. 465 REQ_HBT = 4; 466 467 // List accounts request API type. Maps to UPI's `ReqListAccount` API. 468 REQ_LIST_ACCOUNT = 5; 469 470 // Mandate request API. Maps to UPI's `ReqMandate` API. 471 REQ_MANDATE = 6; 472 473 // Mandate confirmation request API type. Maps to UPI's 474 // `ReqMandateConfirmation` API. 475 REQ_MANDATE_CONFIRMATION = 7; 476 477 // OTP request API. Maps to UPI's `ReqOtp` API. 478 REQ_OTP = 8; 479 480 // Payment settlement request API type. Maps to UPI's `ReqPay` API. 481 REQ_PAY = 9; 482 483 // Register mobile request API type. Maps to UPI's `ReqRegMob` API. 484 REQ_REG_MOB = 10; 485 486 // Update credentials request API type. Maps to UPI's `ReqSetCre` API. 487 REQ_SET_CRE = 11; 488 489 // Validate customer request API type. Maps to UPI's `ReqValCust`. 490 REQ_VAL_CUST = 12; 491 492 // Create voucher request API type. Maps to UPI's `ReqVoucher`. 493 REQ_VOUCHER = 13; 494 495 // Voucher confirmation request API type. Maps to UPI's 496 // `ReqVoucherConfirmation` API. 497 REQ_VOUCHER_CONFIRMATION = 14; 498 499 // Transaction confirmation request API type. Maps to UPI's 500 // `ReqTxnConfirmation` API. 501 REQ_TXN_CONFIRMATION = 15; 502 503 // Balance enquiry response API type. Maps to UPI's `RespBalEnq` API. 504 RESP_BAL_ENQ = 16; 505 506 // Check transaction response API type. Maps to UPI's `RespChkTxn` API. 507 RESP_CHK_TXN = 17; 508 509 // Complaint response API type. Maps to UPI's `RespComplaint` API. 510 RESP_COMPLAINT = 18; 511 512 // Heart beat response API type. Maps to UPI's `RespHbt` API. 513 RESP_HBT = 19; 514 515 // List accounts response API type. Maps to UPI's `RespListAccount` API. 516 RESP_LIST_ACCOUNT = 20; 517 518 // Mandate response API type. Maps to UPI's `RespMandate` API. 519 RESP_MANDATE = 21; 520 521 // Mandate confirmation response API type. Maps to UPI's 522 // `RespMandateConfirmation` API. 523 RESP_MANDATE_CONFIRMATION = 22; 524 525 // OTP response API. Maps to UPI's `RespOtp` API. 526 RESP_OTP = 23; 527 528 // Payment settlement response API type. Maps to UPI's `RespPay` API. 529 RESP_PAY = 24; 530 531 // Register mobile response API type. Maps to UPI's `RespRegMob` API. 532 RESP_REG_MOB = 25; 533 534 // Update credentials response API type. Maps to UPI's `RespSetCre` API. 535 RESP_SET_CRE = 26; 536 537 // Validate customer response API type. Maps to UPI's `RespValCust`. 538 RESP_VAL_CUST = 27; 539 540 // Create voucher response API type. Maps to UPI's `RespVoucher`. 541 RESP_VOUCHER = 28; 542 543 // Voucher confirmation responseAPI type. Maps to UPI's 544 // `RespVoucherConfirmation` API. 545 RESP_VOUCHER_CONFIRMATION = 29; 546 547 // Transaction confirmation response API type. Maps to UPI's 548 // `RespTxnConfirmation` API. 549 RESP_TXN_CONFIRMATION = 30; 550 551 // Activation request API type. Maps to UPI's `ReqActivation` API. 552 REQ_ACTIVATION = 31; 553 554 // Activation response API type. Maps to UPI's `RespActivation` API. 555 RESP_ACTIVATION = 32; 556} 557