Class: GoCardlessPro::Services::LogosService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/gocardless_pro/services/logos_service.rb

Overview

Service for making requests to the Logo endpoints

Instance Method Summary collapse

Methods inherited from BaseService

#initialize, #make_request, #sub_url

Constructor Details

This class inherits a constructor from GoCardlessPro::Services::BaseService

Instance Method Details

#create_for_creditor(options = {}) ⇒ Object

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

Parameters:

  • options (Hash) (defaults to: {})

    parameters as a hash, under a params key.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 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