Method: Appwrite::Avatars#get_credit_card

Defined in:
lib/appwrite/services/avatars.rb

#get_credit_card(code:, width: nil, height: nil, quality: nil) ⇒ Object

The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

Parameters:

  • code (CreditCard)

    Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro, rupay.

  • width (Integer) (defaults to: nil)

    Image width. Pass an integer between 0 to 2000. Defaults to 100.

  • height (Integer) (defaults to: nil)

    Image height. Pass an integer between 0 to 2000. Defaults to 100.

  • quality (Integer) (defaults to: nil)

    Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.

Returns:



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/appwrite/services/avatars.rb', line 69

def get_credit_card(code:, width: nil, height: nil, quality: nil)
    api_path = '/avatars/credit-cards/{code}'
        .gsub('{code}', code)

    if code.nil?
      raise Appwrite::Exception.new('Missing required parameter: "code"')
    end

    api_params = {
        width: width,
        height: height,
        quality: quality,
    }
    
    api_headers = {
    }

    @client.call(
        method: 'GET',
        path: api_path,
        headers: api_headers,
        params: api_params,
    )
end