Class: Cielo::Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/cielo/ws15/transaction.rb

Overview

Representação de uma transação

Constant Summary collapse

ONLY_AUTHENTICATE =

Apenas autentica a transação

0
AUTHORIZE_IF_AUTHENTICATED =

Autoriza a transação apenas se tiver sido autenticada

1
AUTHORIZE =

Autoriza a transação

2
AUTHORIZE_WITHOUT_AUTHENTICATION =

Autorização direta, sem autenticação

3
RECURRENCE =

Autorização para recorrência

4

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(merchant, holder, order, payment_method, return_url, authorize, capture: true) ⇒ Transaction

Inicializa uma instância de Transaction informando os dados do estabelecimento, portador do cartão, pedido, forma de pagamento, URL de retorno, método de autorização e forma de captura.

Parameters:

  • merchant (Merchant)

    Dados do estabelecimento comercial

  • holder (Holder)

    Portador do cartão

  • order (Order)

    Dados do pedido

  • payment_method (PaymentMethod)

    Forma de pagamento

  • return_url (String)

    URL de retorno

  • authorize (Number)

    Método de autorização

  • capture (Boolean) (defaults to: true)

    Se a transação deve ser capturada automaticamente



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/cielo/ws15/transaction.rb', line 72

def initialize(
  merchant,
  holder,
  order,
  payment_method,
  return_url,
  authorize,
  capture: true)

  @merchant = merchant
  @holder = holder
  @order = order
  @payment_method = payment_method
  @return_url = return_url
  @authorize = authorize
  @do_capture = capture
end

Instance Attribute Details

#authenticationAuthentication

Dados da autenticação

Returns:



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def authentication
  @authentication
end

#authentication_urlString

URL de redirecionamento à Cielo

Returns:

  • (String)

    the current value of authentication_url



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def authentication_url
  @authentication_url
end

#authorizarionAuthorizarion

Dados da autorização

Returns:

  • (Authorizarion)

    the current value of authorizarion



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def authorizarion
  @authorizarion
end

#authorizationObject

Returns the value of attribute authorization.



40
41
42
# File 'lib/cielo/ws15/transaction.rb', line 40

def authorization
  @authorization
end

#authorizeNumber

Método de autorização

Returns:

  • (Number)

    the current value of authorize



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def authorize
  @authorize
end

#avsString

Bloco XML contendo informações necessárias para realizar a consulta ao serviço

Returns:

  • (String)

    the current value of avs



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def avs
  @avs
end

#binString

Seis primeiros dígitos do cartão

Returns:

  • (String)

    the current value of bin



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def bin
  @bin
end

#cancellationArray<Cancellation>

Lista de cancelamentos ocorridos

Returns:

  • (Array<Cancellation>)

    the current value of cancellation



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def cancellation
  @cancellation
end

#captureCapture

Dados da captura

Returns:

  • (Capture)

    the current value of capture



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def capture
  @capture
end

#do_captureBoolean

Indica se a captura deve ser automática ou não

Returns:

  • (Boolean)

    the current value of do_capture



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def do_capture
  @do_capture
end

#free_fieldString

Campo livre

Returns:

  • (String)

    the current value of free_field



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def free_field
  @free_field
end

#generate_tokenBoolean

Se um token deve ser gerado para o cartão

Returns:

  • (Boolean)

    the current value of generate_token



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def generate_token
  @generate_token
end

#holderHolder

Dados do portador do cartão

Returns:

  • (Holder)

    the current value of holder



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def holder
  @holder
end

#merchantMerchant

Dados do estabelecimento comercial

Returns:

  • (Merchant)

    the current value of merchant



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def merchant
  @merchant
end

#orderOrder

Dados do pedido na plataforma da loja

Returns:

  • (Order)

    the current value of order



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def order
  @order
end

#panString

Código PAN da transação

Returns:

  • (String)

    the current value of pan



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def pan
  @pan
end

#payment_methodPaymentMethod

Dados da forma de pagamento

Returns:



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def payment_method
  @payment_method
end

#return_urlString

URL de redirecionamento da Cielo para a loja

Returns:

  • (String)

    the current value of return_url



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def return_url
  @return_url
end

#statusNumber

Código de status da transação

Returns:

  • (Number)

    the current value of status



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def status
  @status
end

#tidString

ID da transação

Returns:

  • (String)

    the current value of tid



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def tid
  @tid
end

#tokenToken

Dados do token

Returns:

  • (Token)

    the current value of token



24
25
26
# File 'lib/cielo/ws15/transaction.rb', line 24

def token
  @token
end