-
Notifications
You must be signed in to change notification settings - Fork 28
/
api_instant_payouts.go
67 lines (53 loc) · 1.77 KB
/
api_instant_payouts.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
Adyen Payout API
API version: 68
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package payout
import (
"context"
"net/http"
"net/url"
"github.com/adyen/adyen-go-api-library/v9/src/common"
)
// InstantPayoutsApi service
type InstantPayoutsApi common.Service
// All parameters accepted by InstantPayoutsApi.Payout
type InstantPayoutsApiPayoutInput struct {
payoutRequest *PayoutRequest
}
func (r InstantPayoutsApiPayoutInput) PayoutRequest(payoutRequest PayoutRequest) InstantPayoutsApiPayoutInput {
r.payoutRequest = &payoutRequest
return r
}
/*
Prepare a request for Payout
@return InstantPayoutsApiPayoutInput
*/
func (a *InstantPayoutsApi) PayoutInput() InstantPayoutsApiPayoutInput {
return InstantPayoutsApiPayoutInput{}
}
/*
Payout Make an instant card payout
With this call, you can pay out to your customers, and funds will be made available within 30 minutes on the cardholder's bank account (this is dependent on whether the issuer supports this functionality). Instant card payouts are only supported for Visa and Mastercard cards.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param r InstantPayoutsApiPayoutInput - Request parameters, see PayoutInput
@return PayoutResponse, *http.Response, error
*/
func (a *InstantPayoutsApi) Payout(ctx context.Context, r InstantPayoutsApiPayoutInput) (PayoutResponse, *http.Response, error) {
res := &PayoutResponse{}
path := "/payout"
queryParams := url.Values{}
headerParams := make(map[string]string)
httpRes, err := common.SendAPIRequest(
ctx,
a.Client,
r.payoutRequest,
res,
http.MethodPost,
a.BasePath()+path,
queryParams,
headerParams,
)
return *res, httpRes, err
}