-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpg_test.go
40 lines (30 loc) · 882 Bytes
/
pg_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package pg
import (
"testing"
)
func TestRequestAccessToken(t *testing.T) {
result, success := requestAccessToken(&Credentials{ClientID: "XXX", ClientSecret: "YYY", GrantType: "client_credentials"})
t.Log(result)
if success {
t.Errorf("Result from Get access token %v. Data %v", success, result)
}
}
func TestUssdPush(t *testing.T) {
credentials := Credentials{ClientID: "XXX", ClientSecret: "YYYY", GrantType: "client_credentials"}
pg := PG{Credentials: credentials}
// Test Tigo Push
result, success := pg.RequestUssdPush(UssdPushRequest{
Channel: "TIGO_PUSH",
Amount: 1000,
Reference: "90210REFZ",
Currency: "TZS",
CallbackURL: "url://callback",
Description: "Test USSD push",
Msisdn: "+25565800000",
CountryCode: "TZ",
})
t.Log(result)
if success {
t.Errorf("Result from USSD Push %v. Data %v", success, result)
}
}