Skip to content

Commit

Permalink
[NEW] GenerateSignatureKey for Midtrans IRIS
Browse files Browse the repository at this point in the history
  • Loading branch information
andhikamaheva committed Jan 9, 2019
1 parent e119673 commit db59953
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions iris.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,13 @@ func (gateway *IrisGateway) ValidateSignatureKey(payload string, headerKey strin
}
return false
}

// GenerateSignatureKey : Generate Iris Signature key
func (gateway *IrisGateway) GenerateSignatureKey(payload string) string {
hasher := sha512.New()
hasher.Write([]byte(string(payload) + gateway.Client.MerchantKey))

signatureKey := hex.EncodeToString(hasher.Sum(nil))

return signatureKey
}

0 comments on commit db59953

Please sign in to comment.