Module: Buckaruby::TransactionResponse

Overview

Base for a transaction response.

Instance Method Summary collapse

Instance Method Details

#collect_dateObject



115
116
117
118
119
# File 'lib/buckaruby/response.rb', line 115

def collect_date
  if payment_method == PaymentMethod::SEPA_DIRECT_DEBIT
    parse_date(params[:brq_service_sepadirectdebit_collectdate])
  end
end

#consumer_bicObject



82
83
84
85
86
87
88
89
90
91
# File 'lib/buckaruby/response.rb', line 82

def consumer_bic
  case payment_method
  when PaymentMethod::IDEAL
    params[:brq_service_ideal_consumerbic]
  when PaymentMethod::IDEAL_PROCESSING
    params[:brq_service_idealprocessing_consumerbic]
  when PaymentMethod::SEPA_DIRECT_DEBIT
    params[:brq_service_sepadirectdebit_customerbic]
  end
end

#consumer_ibanObject



93
94
95
96
97
98
99
100
101
102
# File 'lib/buckaruby/response.rb', line 93

def consumer_iban
  case payment_method
  when PaymentMethod::IDEAL
    params[:brq_service_ideal_consumeriban]
  when PaymentMethod::IDEAL_PROCESSING
    params[:brq_service_idealprocessing_consumeriban]
  when PaymentMethod::SEPA_DIRECT_DEBIT
    params[:brq_service_sepadirectdebit_customeriban]
  end
end

#consumer_nameObject



104
105
106
107
108
109
110
111
112
113
# File 'lib/buckaruby/response.rb', line 104

def consumer_name
  case payment_method
  when PaymentMethod::IDEAL
    params[:brq_service_ideal_consumername] || params[:brq_customer_name]
  when PaymentMethod::IDEAL_PROCESSING
    params[:brq_service_idealprocessing_consumername] || params[:brq_customer_name]
  when PaymentMethod::SEPA_DIRECT_DEBIT
    params[:brq_service_sepadirectdebit_customername] || params[:brq_customer_name]
  end
end

#invoicenumberObject



121
122
123
# File 'lib/buckaruby/response.rb', line 121

def invoicenumber
  params[:brq_invoicenumber]
end

#mandate_referenceObject



125
126
127
128
129
# File 'lib/buckaruby/response.rb', line 125

def mandate_reference
  if payment_method == PaymentMethod::SEPA_DIRECT_DEBIT
    params[:brq_service_sepadirectdebit_mandatereference]
  end
end

#payment_idObject



131
132
133
# File 'lib/buckaruby/response.rb', line 131

def payment_id
  params[:brq_payment]
end

#payment_methodObject



135
136
137
# File 'lib/buckaruby/response.rb', line 135

def payment_method
  parse_payment_method(params[:brq_payment_method] || params[:brq_transaction_method])
end

#transaction_idObject



139
140
141
# File 'lib/buckaruby/response.rb', line 139

def transaction_id
  params[:brq_transactions]
end

#transaction_statusObject



143
144
145
# File 'lib/buckaruby/response.rb', line 143

def transaction_status
  status
end

#transaction_typeObject



147
148
149
# File 'lib/buckaruby/response.rb', line 147

def transaction_type
  TransactionType.parse(params[:brq_transaction_type], params[:brq_recurring])
end