Skip to content

Commit f563d5e

Browse files
authored
Merge pull request #250 from recurly/v3-v2021-02-25-19050956020
Generated Latest Changes for v2021-02-25
2 parents 548c5fe + 9c0f8ad commit f563d5e

File tree

6 files changed

+163
-5
lines changed

6 files changed

+163
-5
lines changed

billing_info_create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ type BillingInfoCreate struct {
9191
// Bank identifier code for UK based banks. Required for Bacs based billing infos. (Bacs only)
9292
SortCode *string `json:"sort_code,omitempty"`
9393

94-
// The payment method type for a non-credit card based billing info. `bacs` and `becs` are the only accepted values.
94+
// The payment method type for a non-credit card based billing info. `bacs`, `becs`, `pix-automatico`, `mercadopago` are the only accepted values.
9595
Type *string `json:"type,omitempty"`
9696

9797
// The bank account type. (ACH only)

openapi/api.yaml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18373,9 +18373,11 @@ components:
1837318373
street1:
1837418374
type: string
1837518375
title: Street 1
18376+
maxLength: 50
1837618377
street2:
1837718378
type: string
1837818379
title: Street 2
18380+
maxLength: 50
1837918381
city:
1838018382
type: string
1838118383
title: City
@@ -23977,8 +23979,10 @@ components:
2397723979
gateway_code:
2397823980
type: string
2397923981
title: Gateway Code
23980-
description: If present, this subscription's transactions will use the payment
23981-
gateway with this code.
23982+
description: If present, this subscription's subsequent transactions will
23983+
use the payment gateway with this code. To select a payment gateway to
23984+
use when creating a Subscription, be sure to set the `account.billing_info.gateway_code`
23985+
as well.
2398223986
maxLength: 13
2398323987
transaction_type:
2398423988
description: An optional type designation for the payment gateway transaction
@@ -24634,6 +24638,22 @@ components:
2463424638
title: VAT Number
2463524639
fraud_info:
2463624640
"$ref": "#/components/schemas/TransactionFraudInfo"
24641+
next_action:
24642+
type: object
24643+
x-class-name: TransactionNextAction
24644+
description: Next action values are used for any required customer follow-up
24645+
action. Currently, this is supported for Ebanx when using Pix Automatico.
24646+
properties:
24647+
type:
24648+
type: string
24649+
title: Next action type
24650+
description: The type of next action required.
24651+
"$ref": "#/components/schemas/NextActionTypeEnum"
24652+
value:
24653+
type: string
24654+
title: Next action value
24655+
description: The value associated with the next action type.
24656+
title: Next action
2463724657
TransactionFraudInfo:
2463824658
type: object
2463924659
title: Fraud information
@@ -27043,9 +27063,11 @@ components:
2704327063
- credit_card
2704427064
- eft
2704527065
- google_pay
27066+
- mercadopago
2704627067
- money_order
2704727068
- other
2704827069
- paypal
27070+
- pix_automatico
2704927071
- roku
2705027072
- sepadirectdebit
2705127073
- wire_transfer
@@ -27183,6 +27205,11 @@ components:
2718327205
- scheduled
2718427206
- success
2718527207
- void
27208+
NextActionTypeEnum:
27209+
type: string
27210+
description: The type of next action required for the transaction.
27211+
enum:
27212+
- qr_code
2718627213
CvvCheckEnum:
2718727214
type: string
2718827215
enum:
@@ -27259,6 +27286,9 @@ components:
2725927286
- boleto
2726027287
- cash_app
2726127288
- upi_autopay
27289+
- pix_automatico
27290+
- mercadopago
27291+
- klarna
2726227292
CardTypeEnum:
2726327293
type: string
2726427294
enum:
@@ -27584,10 +27614,12 @@ components:
2758427614
AchTypeEnum:
2758527615
type: string
2758627616
description: The payment method type for a non-credit card based billing info.
27587-
`bacs` and `becs` are the only accepted values.
27617+
`bacs`, `becs`, `pix-automatico`, `mercadopago` are the only accepted values.
2758827618
enum:
2758927619
- bacs
2759027620
- becs
27621+
- pix-automatico
27622+
- mercadopago
2759127623
AchAccountTypeEnum:
2759227624
type: string
2759327625
description: The bank account type. (ACH only)

scripts/clean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ rm -f transaction.go
2626
rm -f invoice_mini.go
2727
rm -f address_with_name.go
2828
rm -f transaction_payment_gateway.go
29+
rm -f transaction_next_action.go
2930
rm -f coupon_redemption.go
3031
rm -f coupon.go
3132
rm -f plan_mini.go

subscription_create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ type SubscriptionCreate struct {
113113
// When `eom` an invoice becomes past due the specified number of `Net Terms` days from the last day of the current month.
114114
NetTermsType *string `json:"net_terms_type,omitempty"`
115115

116-
// If present, this subscription's transactions will use the payment gateway with this code.
116+
// If present, this subscription's subsequent transactions will use the payment gateway with this code. To select a payment gateway to use when creating a Subscription, be sure to set the `account.billing_info.gateway_code` as well.
117117
GatewayCode *string `json:"gateway_code,omitempty"`
118118

119119
// An optional type designation for the payment gateway transaction created by this request. Supports 'moto' value, which is the acronym for mail order and telephone transactions.

transaction.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ type Transaction struct {
153153

154154
// Fraud information
155155
FraudInfo TransactionFraudInfo `json:"fraud_info,omitempty"`
156+
157+
// Next action values are used for any required customer follow-up action. Currently, this is supported for Ebanx when using Pix Automatico.
158+
NextAction TransactionNextAction `json:"next_action,omitempty"`
156159
}
157160

158161
// GetResponse returns the ResponseMetadata that generated this resource

transaction_next_action.go

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
// This file is automatically created by Recurly's OpenAPI generation process
2+
// and thus any edits you make by hand will be lost. If you wish to make a
3+
// change to this file, please create a Github issue explaining the changes you
4+
// need and we will usher them to the appropriate places.
5+
package recurly
6+
7+
import (
8+
"context"
9+
"net/http"
10+
)
11+
12+
type TransactionNextAction struct {
13+
recurlyResponse *ResponseMetadata
14+
15+
// The type of next action required.
16+
Type string `json:"type,omitempty"`
17+
18+
// The value associated with the next action type.
19+
Value string `json:"value,omitempty"`
20+
}
21+
22+
// GetResponse returns the ResponseMetadata that generated this resource
23+
func (resource *TransactionNextAction) GetResponse() *ResponseMetadata {
24+
return resource.recurlyResponse
25+
}
26+
27+
// setResponse sets the ResponseMetadata that generated this resource
28+
func (resource *TransactionNextAction) setResponse(res *ResponseMetadata) {
29+
resource.recurlyResponse = res
30+
}
31+
32+
// internal struct for deserializing accounts
33+
type transactionNextActionList struct {
34+
ListMetadata
35+
Data []TransactionNextAction `json:"data"`
36+
recurlyResponse *ResponseMetadata
37+
}
38+
39+
// GetResponse returns the ResponseMetadata that generated this resource
40+
func (resource *transactionNextActionList) GetResponse() *ResponseMetadata {
41+
return resource.recurlyResponse
42+
}
43+
44+
// setResponse sets the ResponseMetadata that generated this resource
45+
func (resource *transactionNextActionList) setResponse(res *ResponseMetadata) {
46+
resource.recurlyResponse = res
47+
}
48+
49+
// TransactionNextActionList allows you to paginate TransactionNextAction objects
50+
type TransactionNextActionList struct {
51+
client HTTPCaller
52+
requestOptions *RequestOptions
53+
nextPagePath string
54+
hasMore bool
55+
data []TransactionNextAction
56+
}
57+
58+
func NewTransactionNextActionList(client HTTPCaller, nextPagePath string, requestOptions *RequestOptions) *TransactionNextActionList {
59+
return &TransactionNextActionList{
60+
client: client,
61+
requestOptions: requestOptions,
62+
nextPagePath: nextPagePath,
63+
hasMore: true,
64+
}
65+
}
66+
67+
type TransactionNextActionLister interface {
68+
Fetch() error
69+
FetchWithContext(ctx context.Context) error
70+
Count() (*int64, error)
71+
CountWithContext(ctx context.Context) (*int64, error)
72+
Data() []TransactionNextAction
73+
HasMore() bool
74+
Next() string
75+
}
76+
77+
func (list *TransactionNextActionList) HasMore() bool {
78+
return list.hasMore
79+
}
80+
81+
func (list *TransactionNextActionList) Next() string {
82+
return list.nextPagePath
83+
}
84+
85+
func (list *TransactionNextActionList) Data() []TransactionNextAction {
86+
return list.data
87+
}
88+
89+
// Fetch fetches the next page of data into the `Data` property
90+
func (list *TransactionNextActionList) FetchWithContext(ctx context.Context) error {
91+
resources := &transactionNextActionList{}
92+
err := list.client.Call(ctx, http.MethodGet, list.nextPagePath, nil, nil, list.requestOptions, resources)
93+
if err != nil {
94+
return err
95+
}
96+
// copy over properties from the response
97+
list.nextPagePath = resources.Next
98+
list.hasMore = resources.HasMore
99+
list.data = resources.Data
100+
return nil
101+
}
102+
103+
// Fetch fetches the next page of data into the `Data` property
104+
func (list *TransactionNextActionList) Fetch() error {
105+
return list.FetchWithContext(context.Background())
106+
}
107+
108+
// Count returns the count of items on the server that match this pager
109+
func (list *TransactionNextActionList) CountWithContext(ctx context.Context) (*int64, error) {
110+
resources := &transactionNextActionList{}
111+
err := list.client.Call(ctx, http.MethodHead, list.nextPagePath, nil, nil, list.requestOptions, resources)
112+
if err != nil {
113+
return nil, err
114+
}
115+
resp := resources.GetResponse()
116+
return resp.TotalRecords, nil
117+
}
118+
119+
// Count returns the count of items on the server that match this pager
120+
func (list *TransactionNextActionList) Count() (*int64, error) {
121+
return list.CountWithContext(context.Background())
122+
}

0 commit comments

Comments
 (0)