Class: Payzilla::Payment

Inherits:
Object
  • Object
show all
Defined in:
lib/payzilla/payment.rb

Constant Summary collapse

TYPE_CASH =
0
TYPE_INNER_CARD =
1
TYPE_FOREIGN_CARD =
2
TYPE_IBANK =
3
TYPE_ACCOUNT =
4

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Payment

Returns a new instance of Payment.



155
156
157
158
159
# File 'lib/payzilla/payment.rb', line 155

def initialize(args={})
  payment_type = self::TYPE_CASH

  args.each{|k,v| send "#{k}=", v}
end

Instance Attribute Details

#accountObject

Account, which you need to replenish

Used by:

  • Akado

  • Beeline

  • Cyberplat

  • Matrix

  • Megafon

  • MTS

  • OSMP

  • Skylink

  • Yamoney

  • Yota



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#agent_idObject

Agent identifier

Used by:

  • Cyberplat



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#commision_amountObject

Amount of commision, that would be subtracted from enrolled amount

Used by:

  • Rapida



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#commission_amountObject

Returns the value of attribute commission_amount.



144
145
146
# File 'lib/payzilla/payment.rb', line 144

def commission_amount
  @commission_amount
end

#created_atObject

Note:

If in this list format is missing, than you can use default DateTime.now without any formating

Paymend creatiton date

Used by:

  • Akado. Format: YYYY-MM-DD HH24:MI:SS by Moscow local time

  • Beeline

  • Matrix. Format: YYYY-MM-DD HH24:MI:SS by Moscow local time

  • Megafon

  • MTS

  • Skylink

  • Yota. Format: YYYY-MM-DDTHH24:MI:SS by Moscow local time



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#discount_cardObject

Client’s discount card

Used by:

  • Beeline optional



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#enrolled_amountObject

Note:

Missing format in this list mens, that you should use integer value without coins

Amount of money, that client will recieve

Used by:

  • Akado. Format: 100.00

  • Beeline

  • Cyberplat

  • Mailru

  • Matrix

  • Megafon

  • MTS. Format: 100.00

  • OSMP

  • Rapida

  • Skylink

  • Webmoney

  • Yamoney



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#fieldsObject

Additional params, that can be passed into payment

Used by:

  • Cyberplat

  • Rapida

  • Webmoney

    • phone - account, you need to pay to

    • purse - currency

    • name - your name

    • passport_serie

    • passport_date



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#gateway_payment_idObject

Gateway payment idetifier. You can get it by parsing response of check method

Used by:

  • Matrix

  • MTS



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#gateway_provider_idObject

Gateway provider identifier

Used by:

  • MTS

  • OSMP

  • Rapida



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#idObject

Note:

Should be unique for each paymet (For example current time plus some salt)

Paymen identifier

Used by:

  • Akado

  • Beeline

  • Cyberplat

  • Mailru

  • Matrix

  • Megafon

  • MTS

  • OSMP

  • Rapida

  • Skylink

  • Webmoney

  • Yamoney

  • Yota



144
145
146
# File 'lib/payzilla/payment.rb', line 144

def id
  @id
end

Amount of money, that client put into kiosk

Used by:

  • Beeline

  • OSMP

  • Skylink



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#payment_typeObject

Chose payment type. On the left side is ‘what you want’, and on the right - what you should pass

  • Cash | self::TYPE_CASH

  • Inner card | self::TYPE_INNER_CARD

  • Foreign card | self::TYPE_FOREIGN_CARD

  • Bank account | self::TYPE_IBANK

  • Account | self::TYPE_ACCOUNT



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#subagent_idObject

Subagent identifier

Used by:

  • Beeline. optional



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type

#terminal_idObject

Terminal identifier

Used by:

  • Cyberplat

  • MTS

  • Rapida



144
145
146
147
# File 'lib/payzilla/payment.rb', line 144

attr_accessor :id, :account, :created_at, :enrolled_amount,
:paid_amount, :terminal_id, :gateway_provider_id,
:discount_card, :subagent_id, :agent_id, :fields,
:commission_amount, :payment_type