Skip to content

Commit

Permalink
Merge pull request #132 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Template changes
  • Loading branch information
azidouk authored Dec 3, 2024
2 parents 2c4e12a + cc30bbb commit a8dc279
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 24 deletions.
2 changes: 1 addition & 1 deletion lib/gocardless_pro/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def default_options
'User-Agent' => "#{user_agent}",
'Content-Type' => 'application/json',
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
'GoCardless-Client-Version' => '3.0.0'
'GoCardless-Client-Version' => '3.1.0'
}
}
end
Expand Down
32 changes: 24 additions & 8 deletions lib/gocardless_pro/resources/billing_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ module GoCardlessPro
module Resources
# Represents an instance of a billing_request resource returned from the API

# Billing Requests help create resources that require input or action from a
# customer. An example of required input might be additional customer
# billing
# details, while an action would be asking a customer to authorise a payment
# using their mobile banking app.
# Billing Requests help create resources that require input or action from
# a customer. An example of required input might be additional customer
# billing details, while an action would be asking a customer to authorise a
# payment using their mobile banking app.
#
# See [Billing Requests:
# Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/)
# for how-to's, explanations and tutorials.
# for how-to's, explanations and tutorials. <p
# class="notice"><strong>Important</strong>: All properties associated with
# `subscription_request` and `instalment_schedule_request` are only
# supported for ACH and PAD schemes.</p>
class BillingRequest
attr_reader :actions, :created_at, :fallback_enabled, :id, :mandate_request, :metadata, :payment_request,
:purpose_code, :resources, :status, :subscription_request
attr_reader :actions, :created_at, :fallback_enabled, :fallback_occurred, :id, :instalment_schedule_request,
:mandate_request, :metadata, :payment_request, :purpose_code, :resources, :status, :subscription_request

# Initialize a billing_request resource instance
# @param object [Hash] an object returned from the API
Expand All @@ -31,7 +33,9 @@ def initialize(object, response = nil)
@actions = object['actions']
@created_at = object['created_at']
@fallback_enabled = object['fallback_enabled']
@fallback_occurred = object['fallback_occurred']
@id = object['id']
@instalment_schedule_request = object['instalment_schedule_request']
@links = object['links']
@mandate_request = object['mandate_request']
@metadata = object['metadata']
Expand Down Expand Up @@ -82,6 +86,14 @@ def customer_billing_detail
@links['customer_billing_detail']
end

def instalment_schedule_request
@links['instalment_schedule_request']
end

def instalment_schedule_request_instalment_schedule
@links['instalment_schedule_request_instalment_schedule']
end

def mandate_request
@links['mandate_request']
end
Expand Down Expand Up @@ -109,6 +121,10 @@ def payment_request_payment
def subscription_request
@links['subscription_request']
end

def subscription_request_subscription
@links['subscription_request_subscription']
end
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/gocardless_pro/resources/billing_request_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Resources
# authorisation (such as open banking single payments).
class BillingRequestFlow
attr_reader :authorisation_url, :auto_fulfil, :created_at, :customer_details_captured, :exit_uri, :expires_at,
:id, :language, :lock_bank_account, :lock_currency, :lock_customer_details, :prefilled_bank_account, :prefilled_customer, :redirect_uri, :session_token, :show_redirect_buttons, :show_success_redirect_button
:id, :language, :lock_bank_account, :lock_currency, :lock_customer_details, :prefilled_bank_account, :prefilled_customer, :redirect_uri, :session_token, :show_redirect_buttons, :show_success_redirect_button, :skip_success_screen

# Initialize a billing_request_flow resource instance
# @param object [Hash] an object returned from the API
Expand All @@ -40,6 +40,7 @@ def initialize(object, response = nil)
@session_token = object['session_token']
@show_redirect_buttons = object['show_redirect_buttons']
@show_success_redirect_button = object['show_success_redirect_button']
@skip_success_screen = object['skip_success_screen']
@response = response
end

Expand Down
4 changes: 3 additions & 1 deletion lib/gocardless_pro/services/billing_requests_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ module GoCardlessPro
module Services
# Service for making requests to the BillingRequest endpoints
class BillingRequestsService < BaseService
#
# <p class="notice"><strong>Important</strong>: All properties associated with
# `subscription_request` and `instalment_schedule_request` are only supported
# for ACH and PAD schemes.</p>
# Example URL: /billing_requests
# @param options [Hash] parameters as a hash, under a params key.
def create(options = {})
Expand Down
2 changes: 1 addition & 1 deletion lib/gocardless_pro/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ module GoCardlessPro

module GoCardlessPro
# Current version of the GC gem
VERSION = '3.0.0'
VERSION = '3.1.0'
end
18 changes: 12 additions & 6 deletions spec/resources/billing_request_flow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
'redirect_uri' => 'redirect_uri-input',
'session_token' => 'session_token-input',
'show_redirect_buttons' => 'show_redirect_buttons-input',
'show_success_redirect_button' => 'show_success_redirect_button-input'
'show_success_redirect_button' => 'show_success_redirect_button-input',
'skip_success_screen' => 'skip_success_screen-input'
}
end

Expand All @@ -59,7 +60,8 @@
'redirect_uri' => 'redirect_uri-input',
'session_token' => 'session_token-input',
'show_redirect_buttons' => 'show_redirect_buttons-input',
'show_success_redirect_button' => 'show_success_redirect_button-input'
'show_success_redirect_button' => 'show_success_redirect_button-input',
'skip_success_screen' => 'skip_success_screen-input'
}
}
)
Expand All @@ -86,7 +88,8 @@
'redirect_uri' => 'redirect_uri-input',
'session_token' => 'session_token-input',
'show_redirect_buttons' => 'show_redirect_buttons-input',
'show_success_redirect_button' => 'show_success_redirect_button-input'
'show_success_redirect_button' => 'show_success_redirect_button-input',
'skip_success_screen' => 'skip_success_screen-input'
}

}.to_json,
Expand Down Expand Up @@ -146,7 +149,8 @@
'redirect_uri' => 'redirect_uri-input',
'session_token' => 'session_token-input',
'show_redirect_buttons' => 'show_redirect_buttons-input',
'show_success_redirect_button' => 'show_success_redirect_button-input'
'show_success_redirect_button' => 'show_success_redirect_button-input',
'skip_success_screen' => 'skip_success_screen-input'
}
end

Expand Down Expand Up @@ -208,7 +212,8 @@
'redirect_uri' => 'redirect_uri-input',
'session_token' => 'session_token-input',
'show_redirect_buttons' => 'show_redirect_buttons-input',
'show_success_redirect_button' => 'show_success_redirect_button-input'
'show_success_redirect_button' => 'show_success_redirect_button-input',
'skip_success_screen' => 'skip_success_screen-input'
}
}.to_json,

Expand Down Expand Up @@ -257,7 +262,8 @@
'redirect_uri' => 'redirect_uri-input',
'session_token' => 'session_token-input',
'show_redirect_buttons' => 'show_redirect_buttons-input',
'show_success_redirect_button' => 'show_success_redirect_button-input'
'show_success_redirect_button' => 'show_success_redirect_button-input',
'skip_success_screen' => 'skip_success_screen-input'
}
}.to_json,
headers: response_headers
Expand Down
Loading

0 comments on commit a8dc279

Please sign in to comment.