Skip to content

Commit

Permalink
Merge pull request #128 from gocardless/template-changes
Browse files Browse the repository at this point in the history
Template changes
  • Loading branch information
bekundayo authored May 13, 2024
2 parents aed47c2 + 77abc64 commit ab7af9b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/gocardless_pro/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def default_options
'User-Agent' => "#{user_agent}",
'Content-Type' => 'application/json',
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
'GoCardless-Client-Version' => '2.54.0',
'GoCardless-Client-Version' => '2.55.0',
},
}
end
Expand Down
5 changes: 4 additions & 1 deletion lib/gocardless_pro/middlewares/raise_gocardless_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ module Middlewares
class RaiseGoCardlessErrors < Faraday::Middleware
API_ERROR_STATUSES = 501..599
CLIENT_ERROR_STATUSES = 400..500
API_STATUS_NO_CONTENT = 204

def on_complete(env)
raise ApiError, generate_error_data(env) if !json?(env) || API_ERROR_STATUSES.include?(env.status)
if !(env.status == API_STATUS_NO_CONTENT || json?(env)) || API_ERROR_STATUSES.include?(env.status)
raise ApiError, generate_error_data(env)
end

return unless CLIENT_ERROR_STATUSES.include?(env.status)

Expand Down
1 change: 0 additions & 1 deletion lib/gocardless_pro/resources/subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ module Resources
# last working day of the month).
# - otherwise the charge date will be rolled __forwards__ to the next
# business day.
#
class Subscription
attr_reader :amount
attr_reader :app_fee
Expand Down
6 changes: 6 additions & 0 deletions lib/gocardless_pro/services/bank_details_lookups_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ class BankDetailsLookupsService < BaseService
# Performs a bank details lookup. As part of the lookup, a modulus check and
# reachability check are performed.
#
# For UK-based bank accounts, where an account holder name is provided (and an
# account number, a sort code or an iban
# are already present), we verify that the account holder name and bank account
# number match the details held by
# the relevant bank.
#
# If your request returns an [error](#api-usage-errors) or the
# `available_debit_schemes`
# attribute is an empty array, you will not be able to collect payments from the
Expand Down
6 changes: 6 additions & 0 deletions lib/gocardless_pro/services/billing_requests_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ def collect_customer_details(identity, options = {})
# Direct Debit. If a bank account is discovered to be closed or invalid, the
# customer is requested to adjust the account number/routing number and
# succeed in this check to continue with the flow.
#
# _BACS scheme_ [Payer Name
# Verification](https://hub.gocardless.com/s/article/Introduction-to-Payer-Name-Verification?language=en_GB)
# is enabled by default for UK based bank accounts, meaning we verify the
# account holder name and bank account
# number match the details held by the relevant bank.
# Example URL: /billing_requests/:identity/actions/collect_bank_account
#
# @param identity # Unique identifier, beginning with "BRQ".
Expand Down
1 change: 0 additions & 1 deletion lib/gocardless_pro/services/subscriptions_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ def update(identity, options = {})
#
# - `pause_cycles_must_be_greater_than_or_equal_to` if the provided value for
# `pause_cycles` cannot be satisfied.
#
# Example URL: /subscriptions/:identity/actions/pause
#
# @param identity # Unique identifier, beginning with "SB".
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 = '2.54.0'
VERSION = '2.55.0'
end

0 comments on commit ab7af9b

Please sign in to comment.