lib/sisow/payment.rb in sisow-0.9.3 vs lib/sisow/payment.rb in sisow-0.9.4
- old
+ new
@@ -16,16 +16,17 @@
send("#{k}=", v)
end
end
def payment_url
- request = Sisow::Api::TransactionRequest.new(self)
- response = request.perform
-
CGI::unescape(response.issuerurl) if response.issuerurl?
end
+ def transaction_id
+ response.trxid if response.trxid?
+ end
+
def shop_id
Sisow.configuration.shop_id
end
def valid?
@@ -33,8 +34,18 @@
purchase_id.index(/\#|_/).nil? &&
(!amount.nil? && amount != '')
end
def payment_method; raise 'Implement me in a subclass'; end
+
+ private
+
+ def response
+ @raw_response ||= request.perform
+ end
+
+ def request
+ @request ||= Sisow::Api::TransactionRequest.new(self)
+ end
end
end