update linkqu request
This commit is contained in:
parent
bb834e5439
commit
98cccdce51
@ -44,6 +44,21 @@ type CreateQRISRequest struct {
|
|||||||
Signature string `json:"signature"`
|
Signature string `json:"signature"`
|
||||||
ClientID string `json:"client_id"`
|
ClientID string `json:"client_id"`
|
||||||
URLCallback string `json:"url_callback"`
|
URLCallback string `json:"url_callback"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateVARequest struct {
|
||||||
|
Amount int64 `json:"amount"`
|
||||||
|
PartnerReff string `json:"partner_reff"`
|
||||||
|
CustomerID string `json:"customer_id"`
|
||||||
|
CustomerName string `json:"customer_name"`
|
||||||
|
Expired string `json:"expired"`
|
||||||
|
Username string `json:"username"`
|
||||||
|
Pin string `json:"pin"`
|
||||||
|
CustomerPhone string `json:"customer_phone"`
|
||||||
|
CustomerEmail string `json:"customer_email"`
|
||||||
|
Signature string `json:"signature"`
|
||||||
|
ClientID string `json:"client_id"`
|
||||||
|
URLCallback string `json:"url_callback"`
|
||||||
BankCode string `json:"bank_code"`
|
BankCode string `json:"bank_code"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,6 +82,22 @@ func (s *LinkQuService) constructQRISPayload(req entity.LinkQuRequest) CreateQRI
|
|||||||
CustomerEmail: req.CustomerEmail,
|
CustomerEmail: req.CustomerEmail,
|
||||||
ClientID: s.config.LinkQuClientID(),
|
ClientID: s.config.LinkQuClientID(),
|
||||||
URLCallback: s.config.LinkQuCallbackURL(),
|
URLCallback: s.config.LinkQuCallbackURL(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *LinkQuService) constructVAPayload(req entity.LinkQuRequest) CreateVARequest {
|
||||||
|
return CreateVARequest{
|
||||||
|
Amount: req.TotalAmount,
|
||||||
|
PartnerReff: req.PaymentReferenceID,
|
||||||
|
CustomerID: req.CustomerID,
|
||||||
|
CustomerName: req.CustomerName,
|
||||||
|
Expired: time.Now().Add(1 * time.Hour).Format("20060102150405"),
|
||||||
|
Username: s.config.LinkQuUsername(),
|
||||||
|
Pin: s.config.LinkQuPIN(),
|
||||||
|
CustomerPhone: req.CustomerPhone,
|
||||||
|
CustomerEmail: req.CustomerEmail,
|
||||||
|
ClientID: s.config.LinkQuClientID(),
|
||||||
|
URLCallback: s.config.LinkQuCallbackURL(),
|
||||||
BankCode: req.BankCode,
|
BankCode: req.BankCode,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -138,7 +169,7 @@ func (s *LinkQuService) CreatePaymentVA(linkQuRequest entity.LinkQuRequest) (*en
|
|||||||
path := "/transaction/create/va"
|
path := "/transaction/create/va"
|
||||||
method := "POST"
|
method := "POST"
|
||||||
|
|
||||||
req := s.constructQRISPayload(linkQuRequest)
|
req := s.constructVAPayload(linkQuRequest)
|
||||||
|
|
||||||
if req.Expired == "" {
|
if req.Expired == "" {
|
||||||
req.Expired = time.Now().Add(1 * time.Hour).Format("20060102150405")
|
req.Expired = time.Now().Add(1 * time.Hour).Format("20060102150405")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user