Class: Boletoman::Services::Santander::Boleto::Ticket

Inherits:
Ticket show all
Defined in:
lib/boletoman/services/santander/boleto/ticket.rb

Constant Summary

Constants inherited from Ticket

Ticket::BANK_CODE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ticket

#operation, #requires_certificate?, #response_class, #wsdl

Methods inherited from Request

#extra_config_options, #requires_certificate?

Methods inherited from Boletoman::Services::Soap::Request

#basic_config, #call, #client, #config_options, #extra_config_options, #operation, #response, #response_class, #wsdl

Constructor Details

#initialize(data) ⇒ Ticket

Returns a new instance of Ticket.



11
12
13
# File 'lib/boletoman/services/santander/boleto/ticket.rb', line 11

def initialize(data)
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



9
10
11
# File 'lib/boletoman/services/santander/boleto/ticket.rb', line 9

def data
  @data
end

Instance Method Details

#messageObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/boletoman/services/santander/boleto/ticket.rb', line 15

def message
  {
    'TicketRequest' => {
      dados: {
        entry: [
          {
            key: 'CONVENIO.COD-BANCO',
            value: BANK_CODE
          },
          {
            key: 'CONVENIO.COD-CONVENIO',
            value: covenant
          },
          {
            key: 'PAGADOR.TP-DOC',
            value: formatter.document_type
          },
          {
            key: 'PAGADOR.NUM-DOC',
            value: formatter.document
          },
          {
            key: 'PAGADOR.NOME',
            value: formatter.payer_name
          },
          {
            key: 'PAGADOR.ENDER',
            value: formatter.payer_street
          },
          {
            key: 'PAGADOR.BAIRRO',
            value: formatter.payer_neighborhood
          },
          {
            key: 'PAGADOR.CIDADE',
            value: formatter.payer_city
          },
          {
            key: 'PAGADOR.UF',
            value: formatter.payer_state
          },
          {
            key: 'PAGADOR.CEP',
            value: formatter.payer_zip_code
          },
          {
            key: 'TITULO.SEU-NUMERO',
            value: formatter.full_nosso_numero
          },
          {
            key: 'TITULO.NOSSO-NUMERO',
            value: formatter.full_nosso_numero
          },
          {
            key: 'TITULO.DT-VENCTO',
            value: formatter.due_date
          },
          {
            key: 'TITULO.DT-EMISSAO',
            value: formatter.issue_date
          },
          {
            key: 'TITULO.ESPECIE',
            value: 17
          },
          {
            key: 'TITULO.VL-NOMINAL',
            value: formatter.value
          },
          {
            key: 'TITULO.PC-MULTA',
            value: formatter.penalty_percentage
          },
          {
            key: 'TITULO.QT-DIAS-MULTA',
            value: formatter.penalty_days
          },
          {
            key: 'TITULO.PC-JURO',
            value: formatter.interest_percentage
          },
          {
            key: 'MENSAGEM',
            value: formatter.message
          }
        ]
      },
      expiracao: '100',
      sistema: 'YMB'
    }
  }
end