Skip to content

Commit

Permalink
Changes generated by 56098794bc52ecad552c75db0cbdd34691603afc
Browse files Browse the repository at this point in the history
  • Loading branch information
gocardless-robot committed Sep 25, 2024
1 parent 2fa1815 commit 6e3a139
Show file tree
Hide file tree
Showing 20 changed files with 71 additions and 104 deletions.
67 changes: 17 additions & 50 deletions billing_request_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ type BillingRequestLinks struct {
PaymentProvider string `url:"payment_provider,omitempty" json:"payment_provider,omitempty"`
PaymentRequest string `url:"payment_request,omitempty" json:"payment_request,omitempty"`
PaymentRequestPayment string `url:"payment_request_payment,omitempty" json:"payment_request_payment,omitempty"`
SubscriptionRequest string `url:"subscription_request,omitempty" json:"subscription_request,omitempty"`
}

type BillingRequestMandateRequestConstraintsPeriodicLimits struct {
Expand Down Expand Up @@ -169,35 +168,19 @@ type BillingRequestResources struct {
CustomerBillingDetail *BillingRequestResourcesCustomerBillingDetail `url:"customer_billing_detail,omitempty" json:"customer_billing_detail,omitempty"`
}

type BillingRequestSubscriptionRequest struct {
Amount int `url:"amount,omitempty" json:"amount,omitempty"`
AppFee int `url:"app_fee,omitempty" json:"app_fee,omitempty"`
Count int `url:"count,omitempty" json:"count,omitempty"`
Currency string `url:"currency,omitempty" json:"currency,omitempty"`
DayOfMonth int `url:"day_of_month,omitempty" json:"day_of_month,omitempty"`
Interval int `url:"interval,omitempty" json:"interval,omitempty"`
IntervalUnit string `url:"interval_unit,omitempty" json:"interval_unit,omitempty"`
Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
Month string `url:"month,omitempty" json:"month,omitempty"`
Name string `url:"name,omitempty" json:"name,omitempty"`
PaymentReference string `url:"payment_reference,omitempty" json:"payment_reference,omitempty"`
StartDate string `url:"start_date,omitempty" json:"start_date,omitempty"`
}

// BillingRequest model
type BillingRequest struct {
Actions []BillingRequestActions `url:"actions,omitempty" json:"actions,omitempty"`
CreatedAt string `url:"created_at,omitempty" json:"created_at,omitempty"`
FallbackEnabled bool `url:"fallback_enabled,omitempty" json:"fallback_enabled,omitempty"`
Id string `url:"id,omitempty" json:"id,omitempty"`
Links *BillingRequestLinks `url:"links,omitempty" json:"links,omitempty"`
MandateRequest *BillingRequestMandateRequest `url:"mandate_request,omitempty" json:"mandate_request,omitempty"`
Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
PaymentRequest *BillingRequestPaymentRequest `url:"payment_request,omitempty" json:"payment_request,omitempty"`
PurposeCode string `url:"purpose_code,omitempty" json:"purpose_code,omitempty"`
Resources *BillingRequestResources `url:"resources,omitempty" json:"resources,omitempty"`
Status string `url:"status,omitempty" json:"status,omitempty"`
SubscriptionRequest *BillingRequestSubscriptionRequest `url:"subscription_request,omitempty" json:"subscription_request,omitempty"`
Actions []BillingRequestActions `url:"actions,omitempty" json:"actions,omitempty"`
CreatedAt string `url:"created_at,omitempty" json:"created_at,omitempty"`
FallbackEnabled bool `url:"fallback_enabled,omitempty" json:"fallback_enabled,omitempty"`
Id string `url:"id,omitempty" json:"id,omitempty"`
Links *BillingRequestLinks `url:"links,omitempty" json:"links,omitempty"`
MandateRequest *BillingRequestMandateRequest `url:"mandate_request,omitempty" json:"mandate_request,omitempty"`
Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
PaymentRequest *BillingRequestPaymentRequest `url:"payment_request,omitempty" json:"payment_request,omitempty"`
PurposeCode string `url:"purpose_code,omitempty" json:"purpose_code,omitempty"`
Resources *BillingRequestResources `url:"resources,omitempty" json:"resources,omitempty"`
Status string `url:"status,omitempty" json:"status,omitempty"`
}

type BillingRequestService interface {
Expand Down Expand Up @@ -258,30 +241,14 @@ type BillingRequestCreateParamsPaymentRequest struct {
Scheme string `url:"scheme,omitempty" json:"scheme,omitempty"`
}

type BillingRequestCreateParamsSubscriptionRequest struct {
Amount int `url:"amount,omitempty" json:"amount,omitempty"`
AppFee int `url:"app_fee,omitempty" json:"app_fee,omitempty"`
Count int `url:"count,omitempty" json:"count,omitempty"`
Currency string `url:"currency,omitempty" json:"currency,omitempty"`
DayOfMonth int `url:"day_of_month,omitempty" json:"day_of_month,omitempty"`
Interval int `url:"interval,omitempty" json:"interval,omitempty"`
IntervalUnit string `url:"interval_unit,omitempty" json:"interval_unit,omitempty"`
Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
Month string `url:"month,omitempty" json:"month,omitempty"`
Name string `url:"name,omitempty" json:"name,omitempty"`
PaymentReference string `url:"payment_reference,omitempty" json:"payment_reference,omitempty"`
StartDate string `url:"start_date,omitempty" json:"start_date,omitempty"`
}

// BillingRequestCreateParams parameters
type BillingRequestCreateParams struct {
FallbackEnabled bool `url:"fallback_enabled,omitempty" json:"fallback_enabled,omitempty"`
Links *BillingRequestCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
MandateRequest *BillingRequestCreateParamsMandateRequest `url:"mandate_request,omitempty" json:"mandate_request,omitempty"`
Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
PaymentRequest *BillingRequestCreateParamsPaymentRequest `url:"payment_request,omitempty" json:"payment_request,omitempty"`
PurposeCode string `url:"purpose_code,omitempty" json:"purpose_code,omitempty"`
SubscriptionRequest *BillingRequestCreateParamsSubscriptionRequest `url:"subscription_request,omitempty" json:"subscription_request,omitempty"`
FallbackEnabled bool `url:"fallback_enabled,omitempty" json:"fallback_enabled,omitempty"`
Links *BillingRequestCreateParamsLinks `url:"links,omitempty" json:"links,omitempty"`
MandateRequest *BillingRequestCreateParamsMandateRequest `url:"mandate_request,omitempty" json:"mandate_request,omitempty"`
Metadata map[string]interface{} `url:"metadata,omitempty" json:"metadata,omitempty"`
PaymentRequest *BillingRequestCreateParamsPaymentRequest `url:"payment_request,omitempty" json:"payment_request,omitempty"`
PurposeCode string `url:"purpose_code,omitempty" json:"purpose_code,omitempty"`
}

// Create
Expand Down
4 changes: 2 additions & 2 deletions testdata/bank_authorisations.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"create": {
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 8081","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2024-09-24T11:21:08.667Z","expires_at":"2024-09-24T11:21:08.667Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 8081","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2024-09-25T17:57:55.803Z","expires_at":"2024-09-25T17:57:55.803Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
},
"get": {
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 7887","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2024-09-24T11:21:08.668Z","expires_at":"2024-09-24T11:21:08.668Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
"body": {"bank_authorisations":{"authorisation_type":"example authorisation_type 7887","authorised_at":"2020-01-01T12:00:00.000Z","created_at":"2024-09-25T17:57:55.803Z","expires_at":"2024-09-25T17:57:55.803Z","id":"BAU123","last_visited_at":"2020-01-01T12:00:00.000Z","links":{"billing_request":"BRQ123","institution":"monzo"},"qr_code_url":"https://pay.gocardless.com/obauth/BAU123/qr_code","redirect_uri":"https://my-website.com/abc/callback","url":"https://pay.gocardless.com/obauth/BAU123"}}
}
}
4 changes: 2 additions & 2 deletions testdata/billing_request_flows.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"create": {
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":false,"created_at":"2024-09-24T11:21:08.671Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-09-24T11:21:08.671Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":true,"lock_currency":false,"lock_customer_details":false,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":true,"show_success_redirect_button":true}}
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":true,"created_at":"2024-09-25T17:57:55.806Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-09-25T17:57:55.806Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":false,"lock_currency":false,"lock_customer_details":true,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":true,"show_success_redirect_button":false}}
},
"initialise": {
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":false,"created_at":"2024-09-24T11:21:08.671Z","customer_details_captured":true,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-09-24T11:21:08.671Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":false,"lock_currency":false,"lock_customer_details":false,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":true,"show_success_redirect_button":false}}
"body": {"billing_request_flows":{"authorisation_url":"https://monzo.com/abc-123-things","auto_fulfil":false,"created_at":"2024-09-25T17:57:55.806Z","customer_details_captured":false,"exit_uri":"https://my-website.com/abc/callback","expires_at":"2024-09-25T17:57:55.806Z","id":"BRF123","language":"en","links":{"billing_request":"BRQ123"},"lock_bank_account":true,"lock_currency":false,"lock_customer_details":false,"prefilled_bank_account":{"account_type":"savings"},"prefilled_customer":{"address_line1":"221B Baker Street","address_line2":"Marylebone","address_line3":"City of Westminster","city":"London","company_name":"Hamilton Trading Ltd.","country_code":"GB","danish_identity_number":"220550-6218","email":"[email protected]","family_name":"Osborne","given_name":"Frank","postal_code":"NW1 6XE","region":"Greater London","swedish_identity_number":"556564-5404"},"redirect_uri":"https://my-website.com/abc/callback","session_token":"sesh_123","show_redirect_buttons":false,"show_success_redirect_button":true}}
}
}
Loading

0 comments on commit 6e3a139

Please sign in to comment.