lib/paykassa.rb in paykassa-0.1.1 vs lib/paykassa.rb in paykassa-0.1.2
- old
+ new
@@ -2,11 +2,11 @@
require_relative "paykassa/version"
require_relative "paykassa/order"
module Paykassa
class Error < StandardError; end
- class Order
+ class Paykassa
def initialize(domain, sci_id, sci_key, api_id = nil, api_key = nil, test)
@paykassa_order = PaykassaOrder.new({domain: domain, sci_id: sci_id, sci_key: sci_key})
if api_id.nil?
@paykassa_pay = nil
else
@@ -14,11 +14,10 @@
{
domain: domain, api_id: api_id, api_key: api_key, test: test
}
)
end
-
end
def pay(amount: , shop: , currency: , system_name: , paid_commission: "shop", number:, tag:, priority:)
raise "api_key not present!" if @paykassa_pay.nil?
@paykassa_pay.pay({
amount: amount,
@@ -57,10 +56,7 @@
raise StandardError.new(result[:message]) if result[:error]
order_id = res[:data][:order_id]
amount = res[:data][:amount]
{order_id: order_id, amount: amount}
end
-
-
- end
-
+ end
end