-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetails.go
More file actions
22 lines (20 loc) · 733 Bytes
/
details.go
File metadata and controls
22 lines (20 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package pesapal
import (
"fmt"
"net/url"
"strconv"
"swiftbay-api/common/utils"
"time"
)
func setDetailsParameters(consumerKey string, merchantReference string, transactionTrackingID string) url.Values {
timestamp := time.Now().Unix()
params := url.Values{}
params.Add("oauth_consumer_key", consumerKey)
params.Add("oauth_nonce", fmt.Sprintf("%s%s", strconv.FormatInt(timestamp, 10), utils.RandStringBytesMaskImprSrc(12)))
params.Add("oauth_signature_method", "HMAC-SHA1")
params.Add("oauth_timestamp", strconv.FormatInt(timestamp, 10))
params.Add("oauth_version", "1.0")
params.Add("pesapal_merchant_reference", merchantReference)
params.Add("pesapal_transaction_tracking_id", transactionTrackingID)
return params
}