IPG messages added

This commit is contained in:
2025-08-10 13:19:18 +03:30
parent 975b9f4231
commit c9b7387a9e
4 changed files with 117 additions and 26 deletions
+108 -16
View File
@@ -579,6 +579,33 @@ message CommissionRes {}
// auth.v1.BankInfo bank_info = 2; // BankInfo
// }
enum AccountingType {
ACCOUNTING_TYPE_WITHDRAW = 0;
// Deposits
ACCOUNTING_TYPE_DEPOSIT_IPG = 10;
ACCOUNTING_TYPE_DEPOSIT_BANK_ACCOUNT = 11;
ACCOUNTING_TYPE_DEPOSIT_IBAN = 12;
ACCOUNTING_TYPE_DEPOSIT_CARD = 13;
ACCOUNTING_TYPE_DEPOSIT_DIRECT_DEBIT = 14;
// Withdraw
ACCOUNTING_TYPE_WITHDRAW_IBAN = 20; // User request to receive irt via iban
ACCOUNTING_TYPE_WITHDRAW_CARD = 21; // User request to receive irt via card no
ACCOUNTING_TYPE_WITHDRAW_BANK_ACCOUNT = 22; // User request to receive irt via bank
ACCOUNTING_TYPE_WITHDRAW_IPG_REFUND = 23;
// ???
}
enum AccountingStatus {
ACCOUNTING_STATUS_UNKNOWN = 0;
ACCOUNTING_STATUS_PENDING = 1;
ACCOUNTING_STATUS_SUCCESS = 2;
ACCOUNTING_STATUS_FAILED = 3;
ACCOUNTING_STATUS_CANCELLED = 4;
ACCOUNTING_STATUS_REJECTED = 5;
}
enum IPGStatus {
IPG_SUCCESS = 0;
IPG_FAILED = -1;
@@ -588,33 +615,98 @@ enum IPGStatus {
// represent the information regarding the sale of the token
message IPGGetTokenReq {
auth.v1.InternalIAM iam = 1;
int64 asset_id = 2;
double amount = 3;
optional uint64 discount_code = 4;
double amount = 2;
repeated string allowed_card_numbers = 3;
}
// represent the information regarding the ipg gateway
message IPGGetTokenRes {
string url = 1;
int64 unit_price = 2;
int64 total_price = 3;
double amount = 4;
string asset = 5;
optional uint64 discount_code = 6;
int64 amount = 2;
}
message IPGConfirmReq {
string redirected_url = 1; // This field includes all of ipg's query params
// string ref_id = 1;
// string res_code = 2;
// string sale_order_id = 3;
// string sale_reference_id = 4;
// string card_holder_info = 5;
// string card_holder_pan = 6;
// string amount = 7;
}
// type IPGLog struct {
// AccountingID uint
// Accounting Accounting
// RefID string `gorm:"primaryKey"`
// Amount int64
// Status walletv1.AccountingStatus
// CreatedAt time.Time
// UpdatedAt time.Time
// Token string
// PSP PSP
// TransactionID *int64
// Transaction *Transaction
// }
//
// type PSP string
//
// const (
// UNKNOWN_PSP = PSP("unknown")
// PSP_VANDAR_BP_MELLAT = PSP("vandar_bp_mellat")
// PSP_VANDAR_SEP = PSP("vandar_sep")
// PSP_VANDAR = PSP("vandar")
// PSP_BP_MELLAT = PSP("bp_mellat")
// )
enum PSP {
PSP_UNKNOWN = 0;
PSP_VANDAR_BP_MELLAT = 10;
PSP_VANDAR_SEP = 11;
PSP_VANDAR = 12;
PSP_BP_MELLAT = 20;
}
message Accounting {
uint64 id = 1;
int64 user_id = 2;
int64 balance = 3;
}
message IPGGenTokenPayload {
string ref_id = 1;
int64 amount = 2;
string payer_id = 3;
string mobile = 4;
string national_id = 5;
int64 order_id = 6;
string callback_url = 7;
repeated string bank_cards = 8;
}
message IPGLog {
string ref_id = 1;
Accounting accounting = 2;
int64 amount = 4;
AccountingStatus status = 5;
string created_at = 6;
string updated_at = 7;
string token = 8;
PSP psp = 9;
optional int64 transaction_id = 10;
optional Transaction transaction = 11;
}
message IPGLogReq {
string ref_id = 1;
string res_code = 2;
string sale_order_id = 3;
string sale_reference_id = 4;
string card_holder_info = 5;
string card_holder_pan = 6;
string final_amount = 7;
}
message IPGConfirmRes {
string receipt_link = 1;
string ref_id = 1;
}
message SaleManualReq {
@@ -690,7 +782,7 @@ message BuyAssetRes {
/* Contract */
enum ContractType {
CONTRACT_TYPE_ICO = 0;
CONTRACT_TYPE_MARKET = 1; //FIXME: Please remove this :)
CONTRACT_TYPE_MARKET = 1; // FIXME: Please remove this :)
CONTRACT_TYPE_BNPL = 2;
CONTRACT_TYPE_REDEEM = 3;
CONTRACT_TYPE_MARKET_MAKER = 4;