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
(payee)
(payee_transactions_id)
(payment_id)
(pos_transaction_id)
(status)
(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.4'
Class Method Summary collapse
-
.acronym ⇒ String
Returns the current acronym for Barion.
-
.acronym=(val) ⇒ Object
Sets the acronym for Barion.
-
.config {|Barion::Config.instance| ... } ⇒ Object
Configure the Barion engine.
-
.default_payee ⇒ String
deprecated
Deprecated.
Use ::Barion.config.default_payee instead
-
.default_payee=(val) ⇒ Object
deprecated
Deprecated.
Use ::Barion.config.default_payee= instead
-
.deprecator ⇒ ActiveSupport::Deprecation
Returns the deprecator instance for the Barion module.
-
.item_class ⇒ Class
deprecated
Deprecated.
Use ::Barion.config.item_class instead
-
.item_class=(val) ⇒ Object
deprecated
Deprecated.
Use ::Barion.config.item_class= instead
-
.pixel_id ⇒ String?
deprecated
Deprecated.
Use ::Barion.config.pixel_id instead.
-
.pixel_id=(val) ⇒ Object
Sets the Barion Pixel ID.
-
.poskey ⇒ String?
deprecated
Deprecated.
Use ::Barion.config.poskey instead.
-
.poskey=(val) ⇒ Object
deprecated
Deprecated.
Use ::Barion.config.poskey= instead
-
.publickey ⇒ String?
Returns the current PublicKey setting.
-
.publickey=(val) ⇒ Object
Sets the PublicKey for the shop.
-
.rest_client_class ⇒ Class
deprecated
Deprecated.
Use ::Barion.config.rest_client_class instead
-
.rest_client_class=(val) ⇒ Object
deprecated
Deprecated.
Use ::Barion.config.rest_client_class= instead
- .sandbox ⇒ boolean deprecated Deprecated.
-
.sandbox=(val) ⇒ Object
deprecated
Deprecated.
Use ::Barion.config.sandbox= instead
-
.sandbox? ⇒ Boolean
deprecated
Deprecated.
Use ::Barion.config.sandbox? instead.
-
.user_class ⇒ Object
deprecated
Deprecated.
Use ::Barion.config.user_class instead
-
.user_class=(val) ⇒ Object
deprecated
Deprecated.
Use ::Barion.config.user_class= instead
Class Method Details
.acronym ⇒ String
Returns the current acronym for Barion.
128 129 130 131 132 133 134 |
# File 'lib/barion.rb', line 128 def self.acronym config.acronym deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.acronym=(val) ⇒ Object
Sets the acronym for Barion.
139 140 141 142 143 144 145 |
# File 'lib/barion.rb', line 139 def self.acronym=(val) config.acronym = val deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.config {|Barion::Config.instance| ... } ⇒ Object
Configure the Barion engine
33 34 35 36 37 |
# File 'lib/barion.rb', line 33 def self.config(&_block) return Barion::Config.instance unless block_given? yield(Barion::Config.instance) end |
.default_payee ⇒ String
Use ::Barion.config.default_payee instead
Returns the current default payee for Barion.
The default payee is the default email address to which the payment confirmation email is sent.
183 184 185 186 187 188 189 |
# File 'lib/barion.rb', line 183 def self.default_payee config.default_payee deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.default_payee=(val) ⇒ Object
Use ::Barion.config.default_payee= instead
Sets the default payee for Barion.
Updates the Barion configuration with the provided default payee. This method is deprecated and it is recommended to use ‘::Barion.config.default_payee=` instead.
199 200 201 202 203 204 205 |
# File 'lib/barion.rb', line 199 def self.default_payee=(val) config.default_payee = val deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.deprecator ⇒ ActiveSupport::Deprecation
Returns the deprecator instance for the Barion module.
This is a singleton method that initializes the deprecator if it hasn’t been initialized yet, using ActiveSupport::Deprecation.
22 23 24 |
# File 'lib/barion.rb', line 22 def self.deprecator @deprecator ||= ActiveSupport::Deprecation.new('1.0', 'Barion') end |
.item_class ⇒ Class
Use ::Barion.config.item_class instead
Returns the class used for item representation.
This method is deprecated and it is recommended to use ‘::Barion.config.item_class` instead.
243 244 245 246 247 248 249 |
# File 'lib/barion.rb', line 243 def self.item_class config.item_class deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.item_class=(val) ⇒ Object
Use ::Barion.config.item_class= instead
Sets the class used for item representation.
Updates the Barion configuration with the provided item class. This method is deprecated and it is recommended to use ‘::Barion.config.item_class=` instead.
260 261 262 263 264 265 266 |
# File 'lib/barion.rb', line 260 def self.item_class=(val) config.item_class = val deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.pixel_id ⇒ String?
Use ::Barion.config.pixel_id instead.
Returns the current Barion Pixel ID.
The Pixel ID is used for tracking and analytics purposes.
153 154 155 156 157 158 159 |
# File 'lib/barion.rb', line 153 def self.pixel_id config.pixel_id deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.pixel_id=(val) ⇒ Object
Sets the Barion Pixel ID.
Updates the Barion configuration with the provided Pixel ID. This method is deprecated and it is recommended to use ‘::Barion.config.pixel_id=` instead.
168 169 170 171 172 173 174 |
# File 'lib/barion.rb', line 168 def self.pixel_id=(val) config.pixel_id = val deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.poskey ⇒ String?
Use ::Barion.config.poskey instead.
Returns the current POSKey setting.
83 84 85 86 87 88 89 |
# File 'lib/barion.rb', line 83 def self.poskey config.poskey deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.poskey=(val) ⇒ Object
Use ::Barion.config.poskey= instead
Sets the POSKey for the shop.
95 96 97 98 99 100 101 |
# File 'lib/barion.rb', line 95 def self.poskey=(val) config.poskey = (val) deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.publickey ⇒ String?
Returns the current PublicKey setting.
106 107 108 109 110 111 112 |
# File 'lib/barion.rb', line 106 def self.publickey config.publickey deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.publickey=(val) ⇒ Object
Sets the PublicKey for the shop.
117 118 119 120 121 122 123 |
# File 'lib/barion.rb', line 117 def self.publickey=(val) config.publickey = (val) deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.rest_client_class ⇒ Class
Use ::Barion.config.rest_client_class instead
Returns the class used for making REST calls to the Barion API.
This method is deprecated and it is recommended to use ‘::Barion.config.rest_client_class` instead.
274 275 276 277 278 279 280 |
# File 'lib/barion.rb', line 274 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
Use ::Barion.config.rest_client_class= instead
Sets the class used for making REST calls to the Barion API.
Updates the Barion configuration with the provided REST client class. This method is deprecated and it is recommended to use ‘::Barion.config.rest_client_class=` instead.
290 291 292 293 294 295 296 |
# File 'lib/barion.rb', line 290 def self.rest_client_class=(val) config.rest_client_class = val deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.sandbox ⇒ boolean
Returns whether the Barion engine is in sandbox mode.
43 44 45 46 47 48 49 |
# File 'lib/barion.rb', line 43 def self.sandbox config.sandbox deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.sandbox=(val) ⇒ Object
Use ::Barion.config.sandbox= instead
Sets whether the Barion engine is in sandbox mode.
56 57 58 59 60 61 62 |
# File 'lib/barion.rb', line 56 def self.sandbox=(val) config.sandbox = val deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.sandbox? ⇒ Boolean
Use ::Barion.config.sandbox? instead.
Returns whether the Barion engine is in sandbox mode.
This method delegates to the Barion::Config instance’s sandbox? method to determine the current sandbox mode setting.
71 72 73 74 75 76 77 |
# File 'lib/barion.rb', line 71 def self.sandbox? config.sandbox? deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.user_class ⇒ Object
Use ::Barion.config.user_class instead
Returns the class used for user authentication.
This method is deprecated and it is recommended to use ‘::Barion.config.user_class` instead.
212 213 214 215 216 217 218 |
# File 'lib/barion.rb', line 212 def self.user_class config.user_class deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |
.user_class=(val) ⇒ Object
Use ::Barion.config.user_class= instead
Sets the class used for user authentication.
Updates the Barion configuration with the provided user class. This method is deprecated and it is recommended to use ‘::Barion.config.user_class=` instead.
228 229 230 231 232 233 234 |
# File 'lib/barion.rb', line 228 def self.user_class=(val) config.user_class = val deprecator.warn( "#{__method__} is deprecated. " \ "Use ::Barion.config.#{__method__} instead." ) end |