Module: Barion

Defined in:
lib/barion.rb,
lib/barion/config.rb,
lib/barion/engine.rb,
lib/barion/version.rb,
app/models/barion/item.rb,
app/models/barion/address.rb,
app/models/barion/payment.rb,
app/models/barion/purchase.rb,
app/helpers/barion/main_helper.rb,
app/helpers/barion/pixel_helper.rb,
app/models/barion/payer_account.rb,
app/models/barion/application_record.rb,
app/models/barion/gift_card_purchase.rb,
app/helpers/barion/application_helper.rb,
app/models/barion/payment_transaction.rb,
app/models/concerns/barion/currencies.rb,
app/controllers/barion/main_controller.rb,
app/models/concerns/barion/data_formats.rb,
app/models/concerns/barion/json_serializer.rb,
app/controllers/barion/application_controller.rb

Overview

Schema Information

Table name: barion_payment_transactions

id                    :integer          not null, primary key
comment               :string
currency              :string(3)
payee                 :string           not null
payer                 :string
status                :integer          default("prepared"), not null
total                 :decimal(, )      not null
transaction_time      :datetime
transaction_type      :integer
created_at            :datetime         not null
updated_at            :datetime         not null
payee_transactions_id :integer
payment_id            :integer
pos_transaction_id    :string           not null
related_id            :string
transaction_id        :string

Indexes

index_barion_payment_transactions_on_payee                  (payee)
index_barion_payment_transactions_on_payee_transactions_id  (payee_transactions_id)
index_barion_payment_transactions_on_payment_id             (payment_id)
index_barion_payment_transactions_on_pos_transaction_id     (pos_transaction_id)
index_barion_payment_transactions_on_status                 (status)
index_barion_payment_transactions_on_transaction_id         (transaction_id)

Foreign Keys

payee_transactions_id  (payee_transactions_id => barion_payment_transactions.id)
payment_id             (payment_id => barion_payments.id)

Defined Under Namespace

Modules: ApplicationHelper, Currencies, DataFormats, JsonSerializer, MainHelper, PixelHelper Classes: Address, ApplicationController, ApplicationRecord, Config, Engine, Error, GiftCardPurchase, Item, MainController, PayerAccount, Payment, PaymentTransaction, Purchase, TamperedData

Constant Summary collapse

BASE_URL =
{
  test: 'https://api.test.barion.com',
  prod: 'https://api.barion.com'
}.freeze
PIXELID_PATTERN =
::Regexp.new('BP-.{10}-\d{2}').freeze
VERSION =
'0.5.2'

Class Method Summary collapse

Class Method Details

.acronymObject



80
81
82
83
84
85
86
# File 'lib/barion.rb', line 80

def self.acronym
  config.acronym
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.acronym=(val) ⇒ Object



88
89
90
91
92
93
94
# File 'lib/barion.rb', line 88

def self.acronym=(val)
  config.acronym = val
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.configObject



20
21
22
# File 'lib/barion.rb', line 20

def self.config
  ::Barion::Config.instance
end

.default_payeeObject



112
113
114
115
116
117
118
# File 'lib/barion.rb', line 112

def self.default_payee
  config.default_payee
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.default_payee=(val) ⇒ Object



120
121
122
123
124
125
126
# File 'lib/barion.rb', line 120

def self.default_payee=(val)
  config.default_payee = val
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.deprecatorObject



16
17
18
# File 'lib/barion.rb', line 16

def self.deprecator
  @deprecator ||= ActiveSupport::Deprecation.new('1.0', 'Barion')
end

.item_classObject



144
145
146
147
148
149
150
# File 'lib/barion.rb', line 144

def self.item_class
  config.item_class
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.item_class=(val) ⇒ Object



152
153
154
155
156
157
158
# File 'lib/barion.rb', line 152

def self.item_class=(val)
  config.item_class = val
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.pixel_idObject



96
97
98
99
100
101
102
# File 'lib/barion.rb', line 96

def self.pixel_id
  config.pixel_id
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.pixel_id=(val) ⇒ Object



104
105
106
107
108
109
110
# File 'lib/barion.rb', line 104

def self.pixel_id=(val)
  config.pixel_id = val
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.poskeyObject



48
49
50
51
52
53
54
# File 'lib/barion.rb', line 48

def self.poskey
  config.poskey
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.poskey=(val) ⇒ Object



56
57
58
59
60
61
62
# File 'lib/barion.rb', line 56

def self.poskey=(val)
  config.poskey = (val)
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.publickeyObject



64
65
66
67
68
69
70
# File 'lib/barion.rb', line 64

def self.publickey
  config.publickey
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.publickey=(val) ⇒ Object



72
73
74
75
76
77
78
# File 'lib/barion.rb', line 72

def self.publickey=(val)
  config.publickey = (val)
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.rest_client_classObject



160
161
162
163
164
165
166
# File 'lib/barion.rb', line 160

def self.rest_client_class
  config.rest_client_class
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.rest_client_class=(val) ⇒ Object



168
169
170
171
172
173
174
# File 'lib/barion.rb', line 168

def self.rest_client_class=(val)
  config.rest_client_class = val
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.sandboxObject



24
25
26
27
28
29
30
# File 'lib/barion.rb', line 24

def self.sandbox
  config.sandbox
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.sandbox=(val) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/barion.rb', line 32

def self.sandbox=(val)
  config.sandbox = val
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.sandbox?Boolean

Returns:

  • (Boolean)


40
41
42
43
44
45
46
# File 'lib/barion.rb', line 40

def self.sandbox?
  config.sandbox?
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.user_classObject



128
129
130
131
132
133
134
# File 'lib/barion.rb', line 128

def self.user_class
  config.user_class
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end

.user_class=(val) ⇒ Object



136
137
138
139
140
141
142
# File 'lib/barion.rb', line 136

def self.user_class=(val)
  config.user_class = val
  deprecator.warn(
    "#{__method__} is deprecated. " \
    "Use ::Barion.config.#{__method__} instead."
  )
end