class GoCardlessPro::Services::PayerThemesService
Service for making requests to the PayerTheme endpoints
Public Instance Methods
Source
# File lib/gocardless_pro/services/payer_themes_service.rb, line 18 def create_for_creditor(options = {}) path = '/branding/payer_themes' params = options.delete(:params) || {} options[:params] = {} options[:params][envelope_key] = params options[:retry_failures] = true response = make_request(:post, path, options) return if response.body.nil? Resources::PayerTheme.new(unenvelope_body(response.body), response) end
Creates a new payer theme associated with a creditor. If a creditor already has payer themes, this will update the existing payer theme linked to the creditor. Example URL: /branding/payer_themes @param options [Hash] parameters as a hash, under a params key.
Private Instance Methods
Source
# File lib/gocardless_pro/services/payer_themes_service.rb, line 44 def envelope_key 'payer_themes' end
return the key which API responses will envelope data under
Source
# File lib/gocardless_pro/services/payer_themes_service.rb, line 39 def unenvelope_body(body) body[envelope_key] || body['data'] end
Unenvelope the response of the body using the service’s ‘envelope_key`
@param body [Hash]