Class: OffsitePayments::Integrations::Newebpay::Notification

Inherits:
Notification
  • Object
show all
Includes:
HasTradeInfo
Defined in:
lib/offsite_payments/integrations/newebpay/notification.rb

Overview

The Notification object from NewebPay

Since:

  • 0.1.0

Instance Method Summary collapse

Methods included from HasTradeInfo

#checksum, #trade_info, #valid?

Instance Method Details

#currencyString

The Newebpay use TWD as currency

Returns:

  • (String)

Since:

  • 0.1.0



31
32
33
# File 'lib/offsite_payments/integrations/newebpay/notification.rb', line 31

def currency
  :TWD
end

#grossNumber

Returns:

  • (Number)

Since:

  • 0.1.0



22
23
24
# File 'lib/offsite_payments/integrations/newebpay/notification.rb', line 22

def gross
  trade_info.dig('Result', 'Amt')&.to_i
end

#statusString

Returns:

  • (String)

Since:

  • 0.1.0



15
16
17
# File 'lib/offsite_payments/integrations/newebpay/notification.rb', line 15

def status
  trade_info['Status']
end