Class: ActiveMerchant::Billing::Integrations::Ipay88::Return

Inherits:
Return
  • Object
show all
Includes:
PostsData
Defined in:
lib/active_merchant/billing/integrations/ipay88/return.rb

Instance Attribute Summary

Attributes inherited from Return

#notification, #params

Instance Method Summary collapse

Methods inherited from Return

#cancelled?, #initialize, #message, #parse

Constructor Details

This class inherits a constructor from ActiveMerchant::Billing::Integrations::Return

Instance Method Details

#accountObject

Merchant Code assigned by iPay88



11
12
13
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 11

def 
  params["MerchantCode"]
end

#amountObject

The payment with two decimals



26
27
28
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 26

def amount
  params["Amount"]
end

#auth_codeObject

Bank’s approval code



49
50
51
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 49

def auth_code
  params["AuthCode"]
end

#currencyObject

The currency. List of possible values:

MYR
USD
CNY


34
35
36
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 34

def currency
  params["Currency"]
end

#errorObject

The error description. List of possible values:

Duplicate reference number
Invalid merchant
Invalid parameters
Overlimit per transaction
Payment not allowed
Permission not allow
Signature not match
Status not approved


69
70
71
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 69

def error
  params["ErrDesc"]
end

#orderObject

Unique merchant transaction number



21
22
23
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 21

def order
  params["RefNo"]
end

#paymentObject

The payment method



16
17
18
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 16

def payment
  params["PaymentId"].to_i
end

#remarkObject

Merchant remark



39
40
41
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 39

def remark
  params["Remark"]
end

#secure?Boolean

Convenience method to check if the request is secure by checking the incoming signature against our own generated signature

Returns:

  • (Boolean)


81
82
83
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 81

def secure?
  self.generated_signature == self.signature
end

#signatureObject

The hash signature



74
75
76
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 74

def signature
  params["Signature"]
end

#statusObject

Payment status. List of possible values:

1

Success

0

Fail



56
57
58
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 56

def status
  params["Status"]
end

#success?Boolean

Was the transaction successful?

Returns:

  • (Boolean)


86
87
88
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 86

def success?
  self.secure? && self.requery == "00" && self.status == "1"
end

#transactionObject

Transaction ID from iPay88



44
45
46
# File 'lib/active_merchant/billing/integrations/ipay88/return.rb', line 44

def transaction
  params["TransId"]
end