Class: AbacatePay::Resources::Transparents

Inherits:
Resource
  • Object
show all
Defined in:
lib/abacate_pay/resources/transparents.rb

Overview

Represents a transparent checkout (PIX or boleto) in the AbacatePay system.

Constant Summary collapse

RESOURCE_PROPERTIES =
{
  customer: "AbacatePay::Resources::Customers"
}.freeze
DATETIME_PROPERTIES =
%w[created_at updated_at expires_at].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Transparents

Returns a new instance of Transparents.



24
25
26
# File 'lib/abacate_pay/resources/transparents.rb', line 24

def initialize(data)
  fill(data)
end

Instance Attribute Details

#amountObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def amount
  @amount
end

#bar_codeObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def bar_code
  @bar_code
end

#br_codeObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def br_code
  @br_code
end

#br_code_base64Object

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def br_code_base64
  @br_code_base64
end

#created_atObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def created_at
  @created_at
end

#customerObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def customer
  @customer
end

#descriptionObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def description
  @description
end

#dev_modeObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def dev_mode
  @dev_mode
end

#due_dateObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def due_date
  @due_date
end

#expires_atObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def expires_at
  @expires_at
end

#expires_inObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def expires_in
  @expires_in
end

#idObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def id
  @id
end

#metadataObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def 
  @metadata
end

#methodObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def method
  @method
end

#platform_feeObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def platform_fee
  @platform_fee
end

#qr_codeString?

The API returns the copy-and-paste payload as brCode and the image as brCodeBase64. Older documentation used qrCode/qrCodeImage, so both spellings are accepted: the reader prefers the qr* value when the API sends one and falls back to br*.

Returns:

  • (String, nil)

    PIX copy-and-paste payload



34
35
36
# File 'lib/abacate_pay/resources/transparents.rb', line 34

def qr_code
  @qr_code || br_code
end

#qr_code_imageString?

Returns PIX QR code image as a data URI.

Returns:

  • (String, nil)

    PIX QR code image as a data URI



39
40
41
# File 'lib/abacate_pay/resources/transparents.rb', line 39

def qr_code_image
  @qr_code_image || br_code_base64
end

#receipt_urlObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def receipt_url
  @receipt_url
end

#statusObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def status
  @status
end

#updated_atObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def updated_at
  @updated_at
end

#urlObject

qr_code and qr_code_image are defined below rather than generated here: they fall back to the br_code fields the API actually sends.



15
16
17
# File 'lib/abacate_pay/resources/transparents.rb', line 15

def url
  @url
end

Instance Method Details

#dev_mode?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/abacate_pay/resources/transparents.rb', line 43

def dev_mode?
  @dev_mode
end