Class: Pxpay::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/pxpay/response.rb

Overview

The response object received from Payment Express

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Response

Create a new Payment Express response object by passing in the return parameters provided to the success/failure URL



10
11
12
13
14
# File 'lib/pxpay/response.rb', line 10

def initialize(params)
  @result = params[:result]
  @user_id = params[:userid]
  @post = build_xml( params[:result] )
end

Instance Attribute Details

#postObject

Returns the value of attribute post.



6
7
8
# File 'lib/pxpay/response.rb', line 6

def post
  @post
end

Instance Method Details

#responseObject

Retrieving the transaction details from Payment Express as an instance of Pxpay::Notification



17
18
19
20
# File 'lib/pxpay/response.rb', line 17

def response
  response = ::RestClient.post( 'https://www.paymentexpress.com/pxpay/pxaccess.aspx',  self.post )
  return ::Pxpay::Notification.new( response )
end