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
Push — master ( ade00f...013a6a )
by
unknown
01:57 queued 14s
created

mollie.*WalletsService.ApplePaymentSession   A

Complexity

Conditions 3

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 11
nop 2
dl 0
loc 17
rs 9.85
c 0
b 0
f 0
1
package mollie
2
3
import (
4
	"context"
5
	"encoding/json"
6
)
7
8
// Wallet describes the wallet types that Mollie supports.
9
type Wallet string
10
11
// Available wallet types.
12
const (
13
	ApplePayWallet Wallet = "applepay"
14
)
15
16
// WalletsService operates over the resources described
17
// in Mollie's wallets API endpoints section.
18
type WalletsService service
19
20
// ApplePaymentSession contains information about an Apple pay session.
21
type ApplePaymentSession struct {
22
	EpochTimestamp    int    `json:"epochTimestamp,omitempty"`
23
	ExpiresAt         int    `json:"expiresAt,omitempty"`
24
	MerchantSessionID string `json:"merchantSessionIdentifier,omitempty"`
25
	Nonce             string `json:"nonce,omitempty"`
26
	MerchantID        string `json:"merchantIdentified,omitempty"`
27
	DomainName        string `json:"domainName,omitempty"`
28
	DisplayName       string `json:"displayName,omitempty"`
29
	Signature         string `json:"signature,omitempty"`
30
}
31
32
// ApplePaymentSessionRequest contains the body parameters for requesting
33
// a valid PaymentSession from Apple.
34
type ApplePaymentSessionRequest struct {
35
	Domain        string `json:"domain,omitempty"`
36
	ValidationURL string `json:"validationUrl,omitempty"`
37
}
38
39
// ApplePaymentSession returns an Apple Payment Session object valid for one transaction.
40
//
41
// See: https://docs.mollie.com/reference/v2/wallets-api/request-apple-pay-payment-session
42
func (ms *WalletsService) ApplePaymentSession(ctx context.Context, asr *ApplePaymentSessionRequest) (
43
	res *Response,
44
	aps *ApplePaymentSession,
45
	err error,
46
) {
47
	u := "v2/wallets/applepay/sessions"
48
49
	res, err = ms.client.post(ctx, u, asr, nil)
50
	if err != nil {
51
		return
52
	}
53
54
	if err = json.Unmarshal(res.content, &aps); err != nil {
55
		return
56
	}
57
58
	return
59
}
60