Class: PayPro::Payment

Inherits:
Resource show all
Defined in:
lib/pay_pro/entities/payment.rb

Constant Summary collapse

RESOURCE_PATH =
'payments'

Instance Attribute Summary

Attributes inherited from Entity

#api_client

Instance Method Summary collapse

Methods included from Operations::Requestable

#api_request

Methods inherited from Entity

create_from_data, #initialize, #inspect

Constructor Details

This class inherits a constructor from PayPro::Entity

Instance Method Details

#cancel(**options) ⇒ Object



7
8
9
# File 'lib/pay_pro/entities/payment.rb', line 7

def cancel(**options)
  api_request(method: 'delete', uri: resource_url, options: options)
end

#chargebacks(params = {}, **options) ⇒ Object



19
20
21
# File 'lib/pay_pro/entities/payment.rb', line 19

def chargebacks(params = {}, **options)
  api_request(method: 'get', uri: "#{resource_url}/chargebacks", params: params, options: options)
end

#refund(body = {}, **options) ⇒ Object



11
12
13
# File 'lib/pay_pro/entities/payment.rb', line 11

def refund(body = {}, **options)
  api_request(method: 'post', uri: "#{resource_url}/refunds", body: body.to_json, options: options)
end

#refunds(params = {}, **options) ⇒ Object



15
16
17
# File 'lib/pay_pro/entities/payment.rb', line 15

def refunds(params = {}, **options)
  api_request(method: 'get', uri: "#{resource_url}/refunds", params: params, options: options)
end