Class: PayPalSDK::Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-paypal-extended/transaction.rb

Overview

Wrapper class to wrap response hash from PayPal as an object and to provide nice helper methods

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Transaction

Returns a new instance of Transaction.



4
5
6
7
# File 'lib/ruby-paypal-extended/transaction.rb', line 4

def initialize(data)
 @success = data["ACK"].to_s != "Failure"
 @response = data    
end

Instance Method Details

#responseObject



13
14
15
# File 'lib/ruby-paypal-extended/transaction.rb', line 13

def response
  @response
end

#success?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/ruby-paypal-extended/transaction.rb', line 9

def success?
  @success
end