Class Index [+]

Quicksearch

ActiveMerchant::Billing::Integrations::Moneybookers::Notification

Public Class Methods

new(data, options) click to toggle source
    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 10
10:           def initialize(data, options)
11:             if options[:credential2].nil?
12:               raise ArgumentError, "You need to provide the md5 secret as the option :credential2 to verify that the notification originated from Moneybookers"
13:             end
14:             super
15:           end

Public Instance Methods

acknowledge() click to toggle source

Acknowledge the transaction to MoneyBooker. This method has to be called after a new apc arrives. It will verify that all the information we received is correct and will return a ok or a fail. The secret (second credential) has to be provided in the parameter :credential2 when instantiating the Notification object.

Example:

  def ipn
    notify = Moneybookers.notification(request.raw_post, :credential2 => 'secret')

    if notify.acknowledge
      ... process order ... if notify.complete?
    else
      ... log possible hacking attempt ...
    end
     # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 121
121:           def acknowledge
122:             fields = [merchant_id, item_id, Digest::MD5.hexdigest(secret).upcase, merchant_amount, merchant_currency, status_code].join
123:             md5sig == Digest::MD5.hexdigest(fields).upcase
124:           end
complete?() click to toggle source
    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 17
17:           def complete?
18:             status == 'Completed'
19:           end
currency() click to toggle source

currency of the payment as posted by the merchant on the entry form

    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 78
78:           def currency
79:             params['currency']
80:           end
gross() click to toggle source

amount of the payment as posted by the merchant on the entry form (ex. 39.60/39.6/39)

    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 83
83:           def gross
84:             params['amount']
85:           end
item_id() click to toggle source
    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 47
47:           def item_id
48:             params['transaction_id']
49:           end
md5sig() click to toggle source
    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 68
68:           def md5sig
69:             params['md5sig']
70:           end
merchant_amount() click to toggle source

total amount of the payment in Merchants currency (ex 25.46/25.4/25)

    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 93
93:           def merchant_amount
94:             params['mb_amount']
95:           end
merchant_currency() click to toggle source

currency of mb_amount, will always be the same as the currency of the beneficiary’s account at Moneybookers.com

    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 88
88:           def merchant_currency
89:             params['mb_currency']
90:           end
merchant_id() click to toggle source

Unique ID from the merchant’s Moneybookers.com account, needed for calculatinon of md5 sig

    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 73
73:           def merchant_id
74:             params['merchant_id']
75:           end
payer_email() click to toggle source
    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 60
60:           def payer_email
61:             params['pay_from_email']
62:           end
received_at() click to toggle source

When was this payment received by the client.

    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 56
56:           def received_at
57:             nil
58:           end
receiver_email() click to toggle source
    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 64
64:           def receiver_email
65:             params['pay_to_email']
66:           end
secret() click to toggle source
     # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 102
102:           def secret
103:             @options[:credential2]
104:           end
status() click to toggle source

‘2’ Processed – This status is sent when the transaction is processed and the funds have been received on your Moneybookers account. ‘0’ Pending – This status is sent when the customers pays via the pending bank transfer option. Such transactions will auto-process IF the bank transfer is received by Moneybookers. We strongly recommend that you do NOT process the order/transaction in your system upon receipt of a pending status from Moneybookers. ‘-1’ Cancelled – Pending transactions can either be cancelled manually by the sender in their online account history or they will auto-cancel after 14 days if still pending. ‘-2’ Failed – This status is sent when the customer tries to pay via Credit Card or Direct Debit but our provider declines the transaction. If you do not accept Credit Card or Direct Debit payments via Moneybookers (see page 17) then you will never receive the failed status. ‘-3’ Chargeback – This status could be received only if your account is configured to receive chargebacks. If this is the case, whenever a chargeback is received by Moneybookers, a -3 status will be posted on the status_url for the reversed transaction.

    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 26
26:           def status
27:             case status_code
28:             when '2'
29:               'Completed'
30:             when '0'
31:               'Pending'
32:             when '-1'
33:               'Cancelled'
34:             when '-2'
35:               'Failed'
36:             when '-3'
37:               'Reversed'
38:             else
39:               'Error'
40:             end
41:           end
status_code() click to toggle source
    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 43
43:           def status_code
44:             params['status']
45:           end
test?() click to toggle source

Was this a test transaction?

     # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 98
 98:           def test?
 99:             false
100:           end
transaction_id() click to toggle source
    # File lib/active_merchant/billing/integrations/moneybookers/notification.rb, line 51
51:           def transaction_id
52:             params['mb_transaction_id']
53:           end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.