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
@@ -227,6 +227,8 @@ export class OrdersService {
|
||||
refillIntervalDays: createOrderDto.refillIntervalDays || 60,
|
||||
trackingNumber,
|
||||
status: 'processing',
|
||||
paymentMethod: 'wallet',
|
||||
shippingAddress: createOrderDto.shippingAddress,
|
||||
orderItems: {
|
||||
create: orderItemsData,
|
||||
},
|
||||
@@ -240,6 +242,9 @@ export class OrdersService {
|
||||
});
|
||||
}
|
||||
|
||||
const isOnline = createOrderDto.paymentMethod === 'online';
|
||||
const initialStatus = isOnline ? 'pending_payment' : 'processing';
|
||||
|
||||
const createdOrder = await this.prisma.order.create({
|
||||
data: {
|
||||
userId,
|
||||
@@ -249,7 +254,9 @@ export class OrdersService {
|
||||
isRefill: Boolean(createOrderDto.isRefill),
|
||||
refillIntervalDays: createOrderDto.refillIntervalDays || 60,
|
||||
trackingNumber,
|
||||
status: 'processing',
|
||||
status: initialStatus,
|
||||
paymentMethod: createOrderDto.paymentMethod || 'card',
|
||||
shippingAddress: createOrderDto.shippingAddress,
|
||||
orderItems: {
|
||||
create: orderItemsData,
|
||||
},
|
||||
@@ -261,8 +268,8 @@ export class OrdersService {
|
||||
},
|
||||
});
|
||||
|
||||
// Send Order Confirmation SMS
|
||||
if (userId) {
|
||||
// Send Order Confirmation SMS (for card-to-card or non-online orders, online orders get SMS on verify)
|
||||
if (userId && !isOnline) {
|
||||
const user = await this.prisma.user.findUnique({
|
||||
where: { id: userId },
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user