Skip to content

Commit

Permalink
fix some problems
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadv184 committed Dec 30, 2021
1 parent 45a5191 commit e37f99f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func pay() gin.HandlerFunc {
// Get Transaction ID
transactionID := payment.GetTransactionID()
// Redirect the user to the bank payment page.
payUrl := payment.PayUrl()
payUrl := payment.PayURL()
c.Redirect(http.StatusFound, payUrl)
}
}
Expand Down
4 changes: 2 additions & 2 deletions gateway/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
type Driver interface {
// Purchase sends a purchase request to the driver's gateway.
Purchase(invoice *invoice.Invoice) (string, error)
// PayUrl returns the url to redirect the user to for payment.
PayUrl(invoice *invoice.Invoice) string
// PayURL returns the url to redirect the user to for payment.
PayURL(invoice *invoice.Invoice) string
// GetDriverName returns the name of the driver.
GetDriverName() string
// Verify checks the payment status of the invoice.
Expand Down
2 changes: 1 addition & 1 deletion gopayment.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (p *Payment) Purchase() error {

// PayURL return the payment URL
func (p *Payment) PayURL() string {
return p.driver.PayUrl(p.invoice)
return p.driver.PayURL(p.invoice)
}

// PayMethod returns the Request Method to be used to pay the invoice.
Expand Down
2 changes: 1 addition & 1 deletion test/gopayment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (g *Gateway) Purchase(invoice *invoice.Invoice) (string, error) {
}
return invoice.GetUUID(), nil
}
func (g *Gateway) PayUrl(invoice *invoice.Invoice) string {
func (g *Gateway) PayURL(invoice *invoice.Invoice) string {
return "Gateway.com/" + invoice.GetTransactionID()
}
func (g *Gateway) Verify(interface{}) (*receipt.Receipt, error) {
Expand Down

0 comments on commit e37f99f

Please sign in to comment.