feat(payment): implement Zibal IPG payment gateway integration, admin merchant configuration and verification page
Deploy Canina / deploy (push) Successful in 3m28s
Deploy Canina / deploy (push) Successful in 3m28s
This commit is contained in:
1 parent
03900e726a
commit
8992060cb7
94 files changed
+53456
-29275
No files matched your search
@@ -28,6 +28,7 @@ model User {
|
||||
blogs Blog[]
|
||||
prescriptions Prescription[]
|
||||
partnerAccount PartnerAccount?
|
||||
paymentTransactions PaymentTransaction[]
|
||||
|
||||
@@map("users")
|
||||
}
|
||||
@@ -315,17 +316,49 @@ model Order {
|
||||
charityDonation Decimal @default(0.00) @map("charity_donation") @db.Decimal(15, 2)
|
||||
isRefill Boolean @default(false) @map("is_refill")
|
||||
refillIntervalDays Int? @map("refill_interval_days")
|
||||
status String @default("processing") @db.VarChar(30) // processing, shipped, delivered
|
||||
status String @default("processing") @db.VarChar(30) // pending_payment, processing, shipped, delivered, cancelled
|
||||
paymentMethod String? @default("card") @map("payment_method") @db.VarChar(30)
|
||||
shippingAddress String? @map("shipping_address") @db.Text
|
||||
trackingNumber String? @unique @map("tracking_number") @db.VarChar(100)
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz()
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
coupon Coupon? @relation(fields: [couponId], references: [id])
|
||||
orderItems OrderItem[]
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
coupon Coupon? @relation(fields: [couponId], references: [id])
|
||||
orderItems OrderItem[]
|
||||
paymentTransactions PaymentTransaction[]
|
||||
|
||||
@@map("orders")
|
||||
}
|
||||
|
||||
model PaymentTransaction {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
userId String @map("user_id") @db.Uuid
|
||||
orderId String? @map("order_id") @db.Uuid
|
||||
amount Decimal @db.Decimal(15, 2) // in Tomans
|
||||
amountRials BigInt? @map("amount_rials")
|
||||
gateway String @default("zibal") @db.VarChar(50)
|
||||
trackId String? @unique @map("track_id") @db.VarChar(100)
|
||||
refNumber String? @map("ref_number") @db.VarChar(100)
|
||||
cardNumber String? @map("card_number") @db.VarChar(30)
|
||||
hashedCardNumber String? @map("hashed_card_number") @db.VarChar(100)
|
||||
status String @default("PENDING") @db.VarChar(30) // PENDING, PAID, FAILED, VERIFIED
|
||||
resultCode Int? @map("result_code")
|
||||
message String? @db.Text
|
||||
description String? @db.Text
|
||||
type String @default("ORDER") @db.VarChar(30) // ORDER, WALLET_TOPUP
|
||||
paidAt DateTime? @map("paid_at") @db.Timestamptz()
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz()
|
||||
updatedAt DateTime @default(now()) @updatedAt @map("updated_at") @db.Timestamptz()
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
order Order? @relation(fields: [orderId], references: [id], onDelete: SetNull)
|
||||
|
||||
@@index([userId])
|
||||
@@index([orderId])
|
||||
@@index([trackId])
|
||||
@@map("payment_transactions")
|
||||
}
|
||||
|
||||
model OrderItem {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
orderId String @map("order_id") @db.Uuid
|
||||
|
||||
Reference in new issue
Block a user