Skip to content

Commit

Permalink
updated payment controller
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanM007 committed Aug 26, 2024
1 parent d5f65b7 commit 4e7053f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions controllers/payment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,32 @@ func NewPayment(c *gin.Context) {
return
}
}

type UpdatePay struct {
Id uint `json:"id" binding:"required"`
Source Channel `json:"source" binding:"required"`
Amount float64 `json:"amount" binding:"amount"`
Currency Currency `json:"currency" binding:"currency"`
Recipient Channel `json:"recipient" binding:"recipient"`
Timestamp time.Time `json:"timeStamp" binding:"timestamp"`
UpdateRemarks string `json:"updateRemarks" binding:"required"`
}

func UpdatePayment(c *gin.Context) {

var updatePay UpdatePay

if err := c.BindJSON(&updatePay); err != nil {
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"status": "ACCESS_DENIED", "message": "Invalid payment update!!", "err": err.Error()})
return
}
}

type DeletePay struct {
Id uint `json:"id" binding:"required"`
DeleteRemarks string `json:"deleteRemarks" binding:"required"`
}

func DeletePayment(c *gin.Context) {

}

0 comments on commit 4e7053f

Please sign in to comment.