Module: Adyen::REST::ModifyPayment

Included in:
Client
Defined in:
lib/adyen/rest/modify_payment.rb

Overview

This module implements the Payment.capture API to capture previously authorised payments.

Defined Under Namespace

Classes: Request, Response

Instance Method Summary collapse

Instance Method Details

#cancel_or_refund_payment(attributes = {}) ⇒ Object

Constructs and issues a Payment.cancel API call.



80
81
82
83
# File 'lib/adyen/rest/modify_payment.rb', line 80

def cancel_or_refund_payment(attributes = {})
  request = cancel_or_refund_payment_request(attributes)
  execute_request(request)
end

#cancel_or_refund_payment_request(attributes = {}) ⇒ Object



85
86
87
88
89
90
91
92
93
94
# File 'lib/adyen/rest/modify_payment.rb', line 85

def cancel_or_refund_payment_request(attributes = {})
  Adyen::REST::ModifyPayment::Request.new('Payment.cancelOrRefund', attributes,
    prefix: 'modification_request',
    response_class: Adyen::REST::ModifyPayment::Response,
    response_options: {
      prefix: 'modification_result',
      expects: '[cancelOrRefund-received]'
    }
  )
end

#cancel_payment(attributes = {}) ⇒ Object

Constructs and issues a Payment.cancel API call.



46
47
48
49
# File 'lib/adyen/rest/modify_payment.rb', line 46

def cancel_payment(attributes = {})
  request = cancel_payment_request(attributes)
  execute_request(request)
end

#cancel_payment_request(attributes = {}) ⇒ Object



51
52
53
54
55
56
57
58
59
60
# File 'lib/adyen/rest/modify_payment.rb', line 51

def cancel_payment_request(attributes = {})
  Adyen::REST::ModifyPayment::Request.new('Payment.cancel', attributes,
    prefix: 'modification_request',
    response_class: Adyen::REST::ModifyPayment::Response,
    response_options: {
      prefix: 'modification_result',
      expects: '[cancel-received]'
    }
  )
end

#capture_payment(attributes = {}) ⇒ Object

Constructs and issues a Payment.capture API call.



29
30
31
32
# File 'lib/adyen/rest/modify_payment.rb', line 29

def capture_payment(attributes = {})
  request = capture_payment_request(attributes)
  execute_request(request)
end

#capture_payment_request(attributes = {}) ⇒ Object



34
35
36
37
38
39
40
41
42
43
# File 'lib/adyen/rest/modify_payment.rb', line 34

def capture_payment_request(attributes = {})
  Adyen::REST::ModifyPayment::Request.new('Payment.capture', attributes,
    prefix: 'modification_request',
    response_class: Adyen::REST::ModifyPayment::Response,
    response_options: {
      prefix: 'modification_result',
      expects: '[capture-received]'
    }
  )
end

#refund_payment(attributes = {}) ⇒ Object

Constructs and issues a Payment.cancel API call.



63
64
65
66
# File 'lib/adyen/rest/modify_payment.rb', line 63

def refund_payment(attributes = {})
  request = refund_payment_request(attributes)
  execute_request(request)
end

#refund_payment_request(attributes = {}) ⇒ Object



68
69
70
71
72
73
74
75
76
77
# File 'lib/adyen/rest/modify_payment.rb', line 68

def refund_payment_request(attributes = {})
  Adyen::REST::ModifyPayment::Request.new('Payment.refund', attributes,
    prefix: 'modification_request',
    response_class: Adyen::REST::ModifyPayment::Response,
    response_options: {
      prefix: 'modification_result',
      expects: '[refund-received]'
    }
  )
end