Class: Killbill::FirstdataE4::PaymentPlugin
- Inherits:
-
Plugin::ActiveMerchant::PaymentPlugin
- Object
- Plugin::ActiveMerchant::PaymentPlugin
- Killbill::FirstdataE4::PaymentPlugin
- Defined in:
- lib/firstdata_e4/api.rb
Instance Method Summary collapse
- #add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context) ⇒ Object
- #authorize_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object
- #build_form_descriptor(kb_account_id, descriptor_fields, properties, context) ⇒ Object
- #capture_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object
- #credit_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object
- #delete_payment_method(kb_account_id, kb_payment_method_id, properties, context) ⇒ Object
- #get_active_merchant_module ⇒ Object
- #get_payment_info(kb_account_id, kb_payment_id, properties, context) ⇒ Object
- #get_payment_method_detail(kb_account_id, kb_payment_method_id, properties, context) ⇒ Object
- #get_payment_methods(kb_account_id, refresh_from_gateway, properties, context) ⇒ Object
-
#initialize ⇒ PaymentPlugin
constructor
A new instance of PaymentPlugin.
- #on_event(event) ⇒ Object
- #process_notification(notification, properties, context) ⇒ Object
- #purchase_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object
- #refund_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object
- #reset_payment_methods(kb_account_id, payment_methods, properties, context) ⇒ Object
- #search_payment_methods(search_key, offset, limit, properties, context) ⇒ Object
- #search_payments(search_key, offset, limit, properties, context) ⇒ Object
- #set_default_payment_method(kb_account_id, kb_payment_method_id, properties, context) ⇒ Object
- #void_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, properties, context) ⇒ Object
Constructor Details
#initialize ⇒ PaymentPlugin
Returns a new instance of PaymentPlugin.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/firstdata_e4/api.rb', line 5 def initialize gateway_builder = Proc.new do |config| # Change this if needed ::ActiveMerchant::Billing::FirstdataE4Gateway.new :login => config[:login], :password => config[:password] end super(gateway_builder, :firstdata_e4, ::Killbill::FirstdataE4::FirstdataE4PaymentMethod, ::Killbill::FirstdataE4::FirstdataE4Transaction, ::Killbill::FirstdataE4::FirstdataE4Response) end |
Instance Method Details
#add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context) ⇒ Object
91 92 93 94 95 96 97 |
# File 'lib/firstdata_e4/api.rb', line 91 def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, kb_payment_method_id, payment_method_props, set_default, properties, context) end |
#authorize_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/firstdata_e4/api.rb', line 27 def (kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) end |
#build_form_descriptor(kb_account_id, descriptor_fields, properties, context) ⇒ Object
139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/firstdata_e4/api.rb', line 139 def build_form_descriptor(kb_account_id, descriptor_fields, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) # Add your custom static hidden tags here = { #:token => config[:firstdata_e4][:token] } descriptor_fields = merge_properties(descriptor_fields, ) super(kb_account_id, descriptor_fields, properties, context) end |
#capture_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/firstdata_e4/api.rb', line 35 def capture_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) end |
#credit_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/firstdata_e4/api.rb', line 59 def credit_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) end |
#delete_payment_method(kb_account_id, kb_payment_method_id, properties, context) ⇒ Object
99 100 101 102 103 104 105 |
# File 'lib/firstdata_e4/api.rb', line 99 def delete_payment_method(kb_account_id, kb_payment_method_id, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, kb_payment_method_id, properties, context) end |
#get_active_merchant_module ⇒ Object
167 168 169 |
# File 'lib/firstdata_e4/api.rb', line 167 def get_active_merchant_module ::OffsitePayments.integration(:first_data) end |
#get_payment_info(kb_account_id, kb_payment_id, properties, context) ⇒ Object
75 76 77 78 79 80 81 |
# File 'lib/firstdata_e4/api.rb', line 75 def get_payment_info(kb_account_id, kb_payment_id, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, kb_payment_id, properties, context) end |
#get_payment_method_detail(kb_account_id, kb_payment_method_id, properties, context) ⇒ Object
107 108 109 110 111 112 113 |
# File 'lib/firstdata_e4/api.rb', line 107 def get_payment_method_detail(kb_account_id, kb_payment_method_id, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, kb_payment_method_id, properties, context) end |
#get_payment_methods(kb_account_id, refresh_from_gateway, properties, context) ⇒ Object
119 120 121 122 123 124 125 |
# File 'lib/firstdata_e4/api.rb', line 119 def get_payment_methods(kb_account_id, refresh_from_gateway, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, refresh_from_gateway, properties, context) end |
#on_event(event) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/firstdata_e4/api.rb', line 19 def on_event(event) # Require to deal with per tenant configuration invalidation super(event) # # Custom event logic could be added below... # end |
#process_notification(notification, properties, context) ⇒ Object
153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/firstdata_e4/api.rb', line 153 def process_notification(notification, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(notification, properties, context) do |gw_notification, service| # Retrieve the payment # gw_notification.kb_payment_id = # # Set the response body # gw_notification.entity = end end |
#purchase_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/firstdata_e4/api.rb', line 43 def purchase_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) end |
#refund_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/firstdata_e4/api.rb', line 67 def refund_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) end |
#reset_payment_methods(kb_account_id, payment_methods, properties, context) ⇒ Object
135 136 137 |
# File 'lib/firstdata_e4/api.rb', line 135 def reset_payment_methods(kb_account_id, payment_methods, properties, context) super end |
#search_payment_methods(search_key, offset, limit, properties, context) ⇒ Object
127 128 129 130 131 132 133 |
# File 'lib/firstdata_e4/api.rb', line 127 def search_payment_methods(search_key, offset, limit, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(search_key, offset, limit, properties, context) end |
#search_payments(search_key, offset, limit, properties, context) ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/firstdata_e4/api.rb', line 83 def search_payments(search_key, offset, limit, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(search_key, offset, limit, properties, context) end |
#set_default_payment_method(kb_account_id, kb_payment_method_id, properties, context) ⇒ Object
115 116 117 |
# File 'lib/firstdata_e4/api.rb', line 115 def set_default_payment_method(kb_account_id, kb_payment_method_id, properties, context) # TODO end |
#void_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, properties, context) ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/firstdata_e4/api.rb', line 51 def void_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, properties, context) # Pass extra parameters for the gateway here = {} properties = merge_properties(properties, ) super(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, properties, context) end |