class GoCardlessPro::Services::LogosService
Service for making requests to the Logo endpoints
Public Instance Methods
Source
# File lib/gocardless_pro/services/logos_service.rb, line 22 def create_for_creditor(options = {}) path = '/branding/logos' 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::Logo.new(unenvelope_body(response.body), response) end
Creates a new logo associated with a creditor. If a creditor already has a logo, this will update the existing logo linked to the creditor.
We support JPG and PNG formats. Your logo will be scaled to a maximum of 300px by 40px. For more guidance on how to upload logos that will look great across your customer payment page and notification emails see [here](developer.gocardless.com/gc-embed/setting-up-branding#tips_for_uploading_your_logo). Example URL: /branding/logos @param options [Hash] parameters as a hash, under a params key.
Private Instance Methods
Source
# File lib/gocardless_pro/services/logos_service.rb, line 48 def envelope_key 'logos' end
return the key which API responses will envelope data under
Source
# File lib/gocardless_pro/services/logos_service.rb, line 43 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]