GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( f3b768...a537c4 )
by Victor Hugo
02:09 queued 53s
created

examples.GetPaymentMethod   A

Complexity

Conditions 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
dl 0
loc 10
rs 10
c 0
b 0
f 0
nop 0
1
package examples
2
3
import (
4
	"fmt"
5
	"log"
6
	"os"
7
8
	"github.com/VictorAvelar/mollie-api-go/mollie"
9
)
10
11
12
func init() {
13
	_ = os.Setenv(mollie.APITokenEnv, "YOUR_API_TOKEN")
14
15
	config := mollie.NewConfig(true, mollie.APITokenEnv)
16
	client, _ = mollie.NewClient(nil, config)
17
}
18
19
// ListPaymentMethods code sample for getting a list of enabled payment methods on the website 
20
func ListPaymentMethods() {
21
22
	options := &mollie.MethodsOptions{Resource: "orders"}
23
	list, err := client.Methods.List(options)
24
25
	if err != nil {
26
		log.Fatal(err)
27
	}
28
29
	fmt.Println(list)
30
}
31
32
// ListAllPaymentMethods code sample for getting a list all payment methods offered by Mollie
33
func ListAllPaymentMethods() {
34
35
	options := &mollie.MethodsOptions{Locale: "en_US"}
36
	list, err := client.Methods.All(options)
37
38
	if err != nil {
39
		log.Fatal(err)
40
	}
41
42
	fmt.Println(list)
43
}
44
45
// GetPaymentMethod code sample for getting an enabled payment method on the website 
46
func GetPaymentMethod() {
47
	
48
	options := &mollie.MethodsOptions{Include: "issuers"}
49
	paymentMethod, err := client.Methods.Get("ideal", options)
50
51
	if err != nil {
52
		log.Fatal(err)
53
	}
54
55
	fmt.Println(paymentMethod)
56
}
57