Class: PaymentTest::PaymentPluginBeatrix

Inherits:
Object
  • Object
show all
Defined in:
lib/payment_test/api_beatrix.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ PaymentPluginBeatrix

Returns a new instance of PaymentPluginBeatrix.


6
7
8
# File 'lib/payment_test/api_beatrix.rb', line 6

def initialize(parent)
  @parent = parent
end

Instance Attribute Details

#parentObject (readonly)

Returns the value of attribute parent


4
5
6
# File 'lib/payment_test/api_beatrix.rb', line 4

def parent
  @parent
end

Instance Method Details

#add_payment_method(kb_account_id, kb_payment_method_id, paymentMethodProps, setDefault, properties, context) ⇒ Object


39
40
# File 'lib/payment_test/api_beatrix.rb', line 39

def add_payment_method(, kb_payment_method_id, paymentMethodProps, setDefault, properties, context)
end

#authorize_payment(kb_account_id, kb_payment_id, kb_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object


11
12
# File 'lib/payment_test/api_beatrix.rb', line 11

def authorize_payment(, kb_payment_id, kb_transaction_id, kb_payment_method_id, amount, currency, properties, context)
end

#build_form_descriptor(kb_account_id, customFields, properties, context) ⇒ Object


82
83
# File 'lib/payment_test/api_beatrix.rb', line 82

def build_form_descriptor(, customFields, properties, context)
end

#capture_payment(kb_account_id, kb_payment_id, kb_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object


14
15
# File 'lib/payment_test/api_beatrix.rb', line 14

def capture_payment(, kb_payment_id, kb_transaction_id, kb_payment_method_id, amount, currency, properties, context)
end

#credit_payment(kb_account_id, kb_payment_id, kb_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object


24
25
# File 'lib/payment_test/api_beatrix.rb', line 24

def credit_payment(, kb_payment_id, kb_transaction_id, kb_payment_method_id, amount, currency, properties, context)
end

#delete_payment_method(kb_account_id, kb_payment_method_id, properties, context) ⇒ Object


42
43
# File 'lib/payment_test/api_beatrix.rb', line 42

def delete_payment_method(, kb_payment_method_id, properties, context)
end

#get_payment_info(kb_account_id, kb_payment_id, properties, context) ⇒ Object


31
32
33
# File 'lib/payment_test/api_beatrix.rb', line 31

def get_payment_info(, kb_payment_id, properties, context)
  [build_transaction_info(:PURCHASE, kb_payment_id)]
end

#get_payment_method_detail(kb_account_id, kb_payment_method_id, properties, context) ⇒ Object


45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/payment_test/api_beatrix.rb', line 45

def get_payment_method_detail(, kb_payment_method_id, properties, context)
  res = Killbill::Plugin::Model::PaymentMethodPlugin.new
  res.kb_payment_method_id = "9e3ff858-809d-4d12-a1fa-da789e0841d"
  res.external_payment_method_id = "external_payment_method_id"
  res.is_default_payment_method = true
  properties = []
  prop1 = Killbill::Plugin::Model::PluginProperty.new
  prop1.key = "key1"
  prop1.value = "value1"
  properties << prop1
  prop2 = Killbill::Plugin::Model::PluginProperty.new
  prop2.key = "key2"
  prop2.value = "value2"
  properties << prop2
  res.properties=properties
  res
end

#get_payment_methods(kb_account_id, refreshFromGateway, properties, context) ⇒ Object


66
67
68
69
70
71
72
73
# File 'lib/payment_test/api_beatrix.rb', line 66

def get_payment_methods(, refreshFromGateway, properties, context)
  res = Killbill::Plugin::Model::PaymentMethodInfoPlugin.new
  res. = 
  res.payment_method_id = 
  res.is_default = true
  res.external_payment_method_id = "external_payment_method_id"
  [res]
end

#process_notification(notification, properties, context) ⇒ Object


85
86
# File 'lib/payment_test/api_beatrix.rb', line 85

def process_notification(notification, properties, context)
end

#purchase_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object


17
18
19
# File 'lib/payment_test/api_beatrix.rb', line 17

def purchase_payment(, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
  build_transaction_info :PURCHASE, kb_payment_id, kb_payment_transaction_id, amount, currency
end

#refund_payment(kb_account_id, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context) ⇒ Object


27
28
29
# File 'lib/payment_test/api_beatrix.rb', line 27

def refund_payment(, kb_payment_id, kb_payment_transaction_id, kb_payment_method_id, amount, currency, properties, context)
  build_transaction_info :REFUND, kb_payment_id, kb_payment_transaction_id, amount, currency
end

#reset_payment_methods(kb_account_id, paymentMethods, properties, context) ⇒ Object


79
80
# File 'lib/payment_test/api_beatrix.rb', line 79

def reset_payment_methods(, paymentMethods, properties, context)
end

#search_payment_methods(searchKey, offset, limit, properties, context) ⇒ Object


75
76
77
# File 'lib/payment_test/api_beatrix.rb', line 75

def search_payment_methods(searchKey, offset, limit, properties, context)
  [Killbill::Plugin::Model::PaymentMethodInfoPlugin.new]
end

#search_payments(searchKey, offset, limit, properties, context) ⇒ Object


35
36
37
# File 'lib/payment_test/api_beatrix.rb', line 35

def search_payments(searchKey, offset, limit, properties, context)
  [get_payment_method_detail(nil, nil, properties, context)]
end

#set_default_payment_method(kb_account_id, kb_payment_method_id, properties, context) ⇒ Object


63
64
# File 'lib/payment_test/api_beatrix.rb', line 63

def set_default_payment_method(, kb_payment_method_id, properties, context)
end

#void_payment(kb_account_id, kb_payment_id, kb_transaction_id, kb_payment_method_id, properties, context) ⇒ Object


21
22
# File 'lib/payment_test/api_beatrix.rb', line 21

def void_payment(, kb_payment_id, kb_transaction_id, kb_payment_method_id, properties, context)
end