Sha256: 9900e7f546289e8d00c4aabed2f9d977d914427a9886d55af1429651c3e6b02c
Contents?: true
Size: 1.48 KB
Versions: 7
Compression:
Stored size: 1.48 KB
Contents
module Ipizza::Provider class Sampo class << self attr_accessor :service_url, :return_url, :file_key, :key_secret, :file_cert, :snd_id, :lang, :rec_acc, :rec_name end def payment_request(payment, service = 1002) req = Ipizza::PaymentRequest.new req.service_url = self.service_url req.sign_params = { 'VK_SERVICE' => service.to_s, 'VK_VERSION' => '008', 'VK_SND_ID' => self.snd_id, 'VK_STAMP' => payment.stamp, 'VK_AMOUNT' => sprintf('%.2f', payment.amount), 'VK_CURR' => payment.currency, 'VK_REF' => Ipizza::Util.sign_731(payment.refnum), 'VK_MSG' => payment.message } if service == 1001 req.sign_params['VK_ACC'] = self.rec_acc req.sign_params['VK_NAME'] = self.rec_name end req.extra_params = { 'VK_RETURN' => self.return_url, 'VK_LANG' => self.lang } if service == 1001 param_order = ['VK_SERVICE', 'VK_VERSION', 'VK_SND_ID', 'VK_STAMP', 'VK_AMOUNT', 'VK_CURR', 'VK_ACC', 'VK_NAME', 'VK_REF', 'VK_MSG'] else param_order = ['VK_SERVICE', 'VK_VERSION', 'VK_SND_ID', 'VK_STAMP', 'VK_AMOUNT', 'VK_CURR', 'VK_REF', 'VK_MSG'] end req.sign(self.key, self.key_secret, param_order) req end def payment_response(params) response = Ipizza::PaymentResponse.new(params) response.verify(self.class.file_cert) return response end end end
Version data entries
7 entries across 7 versions & 1 rubygems