-
Notifications
You must be signed in to change notification settings - Fork 1
/
recurring.go
35 lines (27 loc) · 1.21 KB
/
recurring.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
// Copyright 2018 Matthieu CORNUT-CHAUVINC. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package adyen
import (
"fmt"
"net/http"
"github.com/mcornut/go-adyen/constants"
"github.com/mcornut/go-adyen/types"
)
// ClientRecurring interface
type ClientRecurring interface {
ListRecurringDetails(params *types.RecurringDetailsParams) (*types.RecurringDetails, error)
Disable(params *types.RecurringDisableParams) (*types.RecurringDisable, error)
}
// ListRecurringDetails func
func (c Client) ListRecurringDetails(params *types.RecurringDetailsParams) (*types.RecurringDetails, error) {
adyenRecurringDetails := &types.RecurringDetails{}
err := c.call(http.MethodPost, fmt.Sprintf("/pal/servlet/Recurring/%v/listRecurringDetails", constants.APIRecurringV25), params, adyenRecurringDetails)
return adyenRecurringDetails, err
}
// Disable func
func (c Client) Disable(params *types.RecurringDisableParams) (*types.RecurringDisable, error) {
adyenRecurringDisable := &types.RecurringDisable{}
err := c.call("POST", fmt.Sprintf("/pal/servlet/Recurring/%v/disable", constants.APIRecurringV25), params, adyenRecurringDisable)
return adyenRecurringDisable, err
}