Module: PlentyClient::Payment::Method

Includes:
Endpoint, Request
Defined in:
lib/plenty_client/payment/method.rb

Constant Summary collapse

LIST_PAYMENT_METHODS =
'/payments/methods'
FIND_PAYMENT_METHOD =
'/payments/methods/{paymentMethodId}'
FIND_PLUGIN_PAYMENT_METHOD =
'/payments/methods/{pluginKey}'
CREATE_PAYMENT_METHOD =
'/payments/methods'
UPDATE_PAYMENT_METHOD =
'/payments/methods'
UPDATE_PAYMENT_METHOD_WITH_ID =
'/payments/methods/{pluginKey}'
LIST_PAYMENT_EBICS_ACCOUNTS =
'/payments/methods/ebics'
CREATE_PAYMENT_EBICS_ACCOUNT =
'/payments/methods/ebics'

Class Method Summary collapse

Methods included from Request

included

Methods included from Endpoint

included

Class Method Details

.create(body = {}) ⇒ Object



31
32
33
# File 'lib/plenty_client/payment/method.rb', line 31

def create(body = {})
  post(build_endpoint(CREATE_PAYMENT_METHOD), body)
end

.create_ebics_account(body = {}) ⇒ Object



47
48
49
# File 'lib/plenty_client/payment/method.rb', line 47

def (body = {})
  post(build_endpoint(CREATE_PAYMENT_EBICS_ACCOUNT), body)
end

.find(method_id, headers = {}, &block) ⇒ Object



23
24
25
# File 'lib/plenty_client/payment/method.rb', line 23

def find(method_id, headers = {}, &block)
  get(build_endpoint(FIND_PAYMENT_METHOD, payment_method: method_id), headers, &block)
end

.find_by_plugin_key(plugin_key, headers = {}, &block) ⇒ Object



27
28
29
# File 'lib/plenty_client/payment/method.rb', line 27

def find_by_plugin_key(plugin_key, headers = {}, &block)
  get(build_endpoint(FIND_PLUGIN_PAYMENT_METHOD, plugin_key: plugin_key), headers, &block)
end

.list(headers = {}, &block) ⇒ Object



19
20
21
# File 'lib/plenty_client/payment/method.rb', line 19

def list(headers = {}, &block)
  get(build_endpoint(LIST_PAYMENT_METHODS), headers, &block)
end

.list_ebics_accounts(headers = {}, &block) ⇒ Object

def update(plugin_key, body = {})

put(build_endpoint(UPDATE_PAYMENT_METHOD_WITH_ID, plugin_key: plugin_key), body)

end



43
44
45
# File 'lib/plenty_client/payment/method.rb', line 43

def list_ebics_accounts(headers = {}, &block)
  get(build_endpoint(LIST_PAYMENT_EBICS_ACCOUNTS), headers, &block)
end

.update(body = {}) ⇒ Object



35
36
37
# File 'lib/plenty_client/payment/method.rb', line 35

def update(body = {})
  put(build_endpoint(UPDATE_PAYMENT_METHOD), body)
end