Sha256: f1d7a26c8138da984f76c86ff81b8e0c9322942a95c64a202e9a5a3fe800124c

Contents?: true

Size: 658 Bytes

Versions: 1

Compression:

Stored size: 658 Bytes

Contents

module Pxpay
  class Response
    attr_accessor :result
    def initialize(params)
      @result = params[:result]
      @user_id = params[:userid]
    end
  
    def response
      require 'rest_client'
      response = ::RestClient.post( 'https://www.paymentexpress.com/pxpay/pxaccess.aspx', build_xml( result ) )
      return ::Pxpay::Notification.new( response )
    end
  
    private
    def build_xml( result )
      xml = Builder::XmlMarkup.new
    
      xml.ProcessResponse do 
        xml.PxPayUserId PXPAY_CONFIG[:pxpay][:pxpay_user_id]
        xml.PxPayKey PXPAY_CONFIG[:pxpay][:pxpay_key]
        xml.Response result
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pxpay-0.1.0 lib/pxpay/response.rb