diff --git a/billing_info_verify_cvv.go b/billing_info_verify_cvv.go new file mode 100644 index 0000000..399411a --- /dev/null +++ b/billing_info_verify_cvv.go @@ -0,0 +1,13 @@ +// This file is automatically created by Recurly's OpenAPI generation process +// and thus any edits you make by hand will be lost. If you wish to make a +// change to this file, please create a Github issue explaining the changes you +// need and we will usher them to the appropriate places. +package recurly + +import () + +type BillingInfoVerifyCVV struct { + + // Unique security code for a credit card. + VerificationValue *string `json:"verification_value,omitempty"` +} diff --git a/client_operations.go b/client_operations.go index acf8e0e..8acb577 100644 --- a/client_operations.go +++ b/client_operations.go @@ -64,6 +64,9 @@ type ClientInterface interface { VerifyBillingInfo(accountId string, params *VerifyBillingInfoParams, opts ...Option) (*Transaction, error) VerifyBillingInfoWithContext(ctx context.Context, accountId string, params *VerifyBillingInfoParams, opts ...Option) (*Transaction, error) + VerifyBillingInfoCvv(accountId string, body *BillingInfoVerifyCVV, opts ...Option) (*Transaction, error) + VerifyBillingInfoCvvWithContext(ctx context.Context, accountId string, body *BillingInfoVerifyCVV, opts ...Option) (*Transaction, error) + ListBillingInfos(accountId string, params *ListBillingInfosParams, opts ...Option) (BillingInfoLister, error) CreateBillingInfo(accountId string, body *BillingInfoCreate, opts ...Option) (*BillingInfo, error) @@ -979,6 +982,35 @@ func (c *Client) verifyBillingInfo(ctx context.Context, accountId string, params return result, err } +// VerifyBillingInfoCvv wraps VerifyBillingInfoCvvWithContext using the background context +func (c *Client) VerifyBillingInfoCvv(accountId string, body *BillingInfoVerifyCVV, opts ...Option) (*Transaction, error) { + ctx := context.Background() + return c.verifyBillingInfoCvv(ctx, accountId, body, opts...) +} + +// VerifyBillingInfoCvvWithContext Verify an account's credit card billing cvv +// +// API Documentation: https://developers.recurly.com/api/v2021-02-25#operation/verify_billing_info_cvv +// +// Returns: Transaction information from verify. +func (c *Client) VerifyBillingInfoCvvWithContext(ctx context.Context, accountId string, body *BillingInfoVerifyCVV, opts ...Option) (*Transaction, error) { + return c.verifyBillingInfoCvv(ctx, accountId, body, opts...) +} + +func (c *Client) verifyBillingInfoCvv(ctx context.Context, accountId string, body *BillingInfoVerifyCVV, opts ...Option) (*Transaction, error) { + path, err := c.InterpolatePath("/accounts/{account_id}/billing_info/verify_cvv", accountId) + if err != nil { + return nil, err + } + requestOptions := NewRequestOptions(opts...) + result := &Transaction{} + err = c.Call(ctx, http.MethodPost, path, body, nil, requestOptions, result) + if err != nil { + return nil, err + } + return result, err +} + type ListBillingInfosParams struct { // Ids - Filter results by their IDs. Up to 200 IDs can be passed at once using diff --git a/openapi/api.yaml b/openapi/api.yaml index 8cabebe..e01a1ad 100644 --- a/openapi/api.yaml +++ b/openapi/api.yaml @@ -2441,6 +2441,47 @@ paths: {\n\t\tfmt.Printf(\"Resource not found: %v\", e)\n\t\treturn nil, err\n\t}\n\tfmt.Printf(\"Unexpected Recurly error: %v\", e)\n\treturn nil, err\n}\n\nfmt.Printf(\"Fetched Transaction: %v\", transaction)" + "/accounts/{account_id}/billing_info/verify_cvv": + post: + tags: + - billing_info + operationId: verify_billing_info_cvv + summary: Verify an account's credit card billing cvv + parameters: + - "$ref": "#/components/parameters/account_id" + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/BillingInfoVerifyCVV" + responses: + '200': + description: Transaction information from verify. + content: + application/json: + schema: + "$ref": "#/components/schemas/Transaction" + '429': + description: Over limit error. A credit card can only be checked 3 times + in 24 hours. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + '422': + description: Invalid billing information, or error running the verification + transaction. + content: + application/json: + schema: + "$ref": "#/components/schemas/ErrorMayHaveTransaction" + default: + description: Unexpected error. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + x-code-samples: [] "/accounts/{account_id}/billing_infos": get: tags: @@ -16942,6 +16983,12 @@ components: type: string description: An identifier for a specific payment gateway. maxLength: 13 + BillingInfoVerifyCVV: + type: object + properties: + verification_value: + type: string + description: Unique security code for a credit card. Coupon: type: object properties: @@ -19275,7 +19322,7 @@ components: properties: starting_billing_cycle: type: integer - description: Represents the first billing cycle of a ramp. + description: Represents the billing cycle where a ramp interval starts. default: 1 currencies: type: array @@ -21239,7 +21286,7 @@ components: properties: starting_billing_cycle: type: integer - description: Represents how many billing cycles are included in a ramp interval. + description: Represents the billing cycle where a ramp interval starts. default: 1 unit_amount: type: integer @@ -21250,7 +21297,7 @@ components: properties: starting_billing_cycle: type: integer - description: Represents how many billing cycles are included in a ramp interval. + description: Represents the billing cycle where a ramp interval starts. remaining_billing_cycles: type: integer description: Represents how many billing cycles are left in a ramp interval. diff --git a/plan_ramp_interval.go b/plan_ramp_interval.go index cdd683b..9c8fd15 100644 --- a/plan_ramp_interval.go +++ b/plan_ramp_interval.go @@ -12,7 +12,7 @@ import ( type PlanRampInterval struct { recurlyResponse *ResponseMetadata - // Represents the first billing cycle of a ramp. + // Represents the billing cycle where a ramp interval starts. StartingBillingCycle int `json:"starting_billing_cycle,omitempty"` // Represents the price for the ramp interval. diff --git a/plan_ramp_interval_create.go b/plan_ramp_interval_create.go index a79f0bb..585121a 100644 --- a/plan_ramp_interval_create.go +++ b/plan_ramp_interval_create.go @@ -8,7 +8,7 @@ import () type PlanRampIntervalCreate struct { - // Represents the first billing cycle of a ramp. + // Represents the billing cycle where a ramp interval starts. StartingBillingCycle *int `json:"starting_billing_cycle,omitempty"` // Represents the price for the ramp interval. diff --git a/scripts/clean b/scripts/clean index 43e513a..9f1443e 100755 --- a/scripts/clean +++ b/scripts/clean @@ -86,6 +86,7 @@ rm -f billing_info_create.go rm -f custom_field_create.go rm -f account_update.go rm -f billing_info_verify.go +rm -f billing_info_verify_cvv.go rm -f coupon_redemption_create.go rm -f invoice_create.go rm -f line_item_create.go diff --git a/subscription_ramp_interval.go b/subscription_ramp_interval.go index 5ac3585..904a72f 100644 --- a/subscription_ramp_interval.go +++ b/subscription_ramp_interval.go @@ -8,7 +8,7 @@ import () type SubscriptionRampInterval struct { - // Represents how many billing cycles are included in a ramp interval. + // Represents the billing cycle where a ramp interval starts. StartingBillingCycle *int `json:"starting_billing_cycle,omitempty"` // Represents the price for the ramp interval. diff --git a/subscription_ramp_interval_response.go b/subscription_ramp_interval_response.go index 0e1294c..6f549ea 100644 --- a/subscription_ramp_interval_response.go +++ b/subscription_ramp_interval_response.go @@ -12,7 +12,7 @@ import ( type SubscriptionRampIntervalResponse struct { recurlyResponse *ResponseMetadata - // Represents how many billing cycles are included in a ramp interval. + // Represents the billing cycle where a ramp interval starts. StartingBillingCycle int `json:"starting_billing_cycle,omitempty"` // Represents how many billing cycles are left in a ramp interval.