Class: QiwiPay::Cheque
- Inherits:
-
Object
- Object
- QiwiPay::Cheque
- Defined in:
- lib/qiwi-pay/cheque.rb
Overview
Чек 54-ФЗ
Defined Under Namespace
Instance Method Summary collapse
-
#encode ⇒ String
Encoded cheque.
-
#initialize(params) ⇒ Cheque
constructor
A new instance of Cheque.
-
#to_json ⇒ String
Cheque as JSON.
Constructor Details
#initialize(params) ⇒ Cheque
Returns a new instance of Cheque.
68 69 70 |
# File 'lib/qiwi-pay/cheque.rb', line 68 def initialize(params) @json = JSON.fast_generate params end |
Instance Method Details
#encode ⇒ String
Returns Encoded cheque.
99 100 101 |
# File 'lib/qiwi-pay/cheque.rb', line 99 def encode Base64.strict_encode64(Zlib::Deflate.deflate(to_json)) end |
#to_json ⇒ String
Returns cheque as JSON.
94 95 96 |
# File 'lib/qiwi-pay/cheque.rb', line 94 def to_json @json end |