class GoCardlessPro::Resources::Block
Blocks are created to prevent certain customer details from being used when creating mandates.
The details used to create blocks can be exact matches, like a bank account or an email, or a more generic match such as an email domain or bank name. Please be careful when creating blocks for more generic matches as this may block legitimate payers from using your service.
New block types may be added over time.
A block is in essence a simple rule that is used to match against details in a newly created mandate. If there is a successful match then the mandate is transitioned to a “blocked” state.
Please note:
- Payments and subscriptions cannot be created against a mandate in
blocked state.
- A mandate can never be transitioned out of the blocked state.
The one exception to this is when blocking a ‘bank_name’. This block will prevent bank accounts from being created for banks that match the given name. To ensure we match bank names correctly an existing bank account must be used when creating this block. Please be aware that we cannot always match a bank account to a given bank name.
<p class=“notice”>
This API is currently only available for GoCardless Protect+ integrators
-
please <a href=“help@gocardless.com”>get in touch</a> if you
would like to use this API. </p>
Attributes
Public Class Methods
Source
# File lib/gocardless_pro/resources/block.rb, line 57 def initialize(object, response = nil) @object = object @active = object['active'] @block_type = object['block_type'] @created_at = object['created_at'] @id = object['id'] @reason_description = object['reason_description'] @reason_type = object['reason_type'] @resource_reference = object['resource_reference'] @updated_at = object['updated_at'] @response = response end
Initialize a block resource instance @param object [Hash] an object returned from the API
Public Instance Methods
Source
# File lib/gocardless_pro/resources/block.rb, line 71 def api_response ApiResponse.new(@response) end
Source
# File lib/gocardless_pro/resources/block.rb, line 76 def to_h @object end
Provides the block resource as a hash of all its readable attributes