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.
Passed
Pull Request — master (#31)
by Victor Hugo
01:28
created

examples/oauth2/oauth2.go   A

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 23
dl 0
loc 39
rs 10
c 0
b 0
f 0
1
package main
2
3
import (
4
	"context"
5
	"fmt"
6
	"log"
7
8
	"golang.org/x/oauth2"
9
10
	"github.com/VictorAvelar/mollie-api-go/mollie"
11
	"github.com/VictorAvelar/mollie-api-go/mollie/connect"
12
)
13
14
func main() {
15
	c := oauth2.Config{
16
		ClientID:     "your client id",
17
		ClientSecret: "your client secret",
18
		Endpoint:     connect.Endpoint,
19
	}
20
	secured := c.Client(context.TODO(), nil)
21
22
	config := mollie.NewConfig(true, "")
23
24
	client, err := mollie.NewClient(secured, config)
25
	if err != nil {
26
		log.Fatal(err)
27
	}
28
29
	output, err := client.Methods.List(nil)
30
	if err != nil {
31
		return
32
	}
33
34
	/*
35
		Now you should see a list of the enabled payment methods for your
36
		account.
37
	*/
38
	for _, o := range output.Embedded.Methods {
39
		fmt.Printf("Id: %s | Name: %s", o.ID, o.Description)
40
	}
41
}
42