Mhamdans17 commited on
Commit ·
9b46732
1
Parent(s): b43786e
feat: return Tripay QRIS payload directly to frontend for inline display
Browse files
controllers/order_controller.go
CHANGED
|
@@ -502,11 +502,15 @@ func PayTripay(c *gin.Context) {
|
|
| 502 |
|
| 503 |
// Kembalikan JSON yang kompatibel dengan format respons frontend agar tidak merusak UI kasir
|
| 504 |
c.JSON(http.StatusOK, gin.H{
|
| 505 |
-
"order_id":
|
| 506 |
-
"order_number":
|
| 507 |
-
"snap_token":
|
| 508 |
-
"redirect_url":
|
| 509 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 510 |
})
|
| 511 |
}
|
| 512 |
|
|
|
|
| 502 |
|
| 503 |
// Kembalikan JSON yang kompatibel dengan format respons frontend agar tidak merusak UI kasir
|
| 504 |
c.JSON(http.StatusOK, gin.H{
|
| 505 |
+
"order_id": order.ID,
|
| 506 |
+
"order_number": order.OrderNumber,
|
| 507 |
+
"snap_token": "", // Dikosongkan agar frontend tidak keliru membuka popup Midtrans Snap
|
| 508 |
+
"redirect_url": tripayRes.Data.CheckoutURL,
|
| 509 |
+
"qr_url": tripayRes.Data.QrURL,
|
| 510 |
+
"qr_string": tripayRes.Data.QrString,
|
| 511 |
+
"payment_method": tripayRes.Data.PaymentMethod,
|
| 512 |
+
"payment_name": tripayRes.Data.PaymentName,
|
| 513 |
+
"total_amount": order.TotalAmount,
|
| 514 |
})
|
| 515 |
}
|
| 516 |
|