Module: Adyen::REST::AuthorisePayment

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

Overview

This module implements the Payment.authorise, and Payment.authorise3d API calls, and includes a custom response class to make handling the response easier.

Defined Under Namespace

Classes: ListRecurringDetailsResponse, Request, Response

Instance Method Summary collapse

Instance Method Details

#authorise_payment(attributes) ⇒ Adyen::REST::AuthorisePayment::Response Also known as: authorize_payment

Sends an authorise payment request to Adyen’s webservice.

Parameters:

  • attributes (Hash)

    The attributes to include in the request.

Returns:

See Also:



101
102
103
104
# File 'lib/adyen/rest/authorise_payment.rb', line 101

def authorise_payment(attributes)
  request = authorise_payment_request(attributes)
  execute_request(request)
end

#authorise_payment_3dsecure(attributes) ⇒ Adyen::REST::AuthorisePayment::Response Also known as: authorize_payment_3dsecure

Sends a 3Dsecure-enabled authorise payment request to Adyen’s webservice.

The response differs based on the credit card uses in the transaction. For some credit cards, an additional offsite step may be required to complete the transaction. Check .redirect_shopper? to see if this is the case. Other cards are not 3DSecure-enabled, and may immediately authorise the transaction. Check .authorised? to see if this is the case.

Parameters:

  • attributes (Hash)

    The attributes to include in the request.

Returns:

See Also:



137
138
139
140
# File 'lib/adyen/rest/authorise_payment.rb', line 137

def authorise_payment_3dsecure(attributes)
  request = authorise_payment_3dsecure_request(attributes)
  execute_request(request)
end

#authorise_payment_3dsecure_request(attributes = {}) ⇒ Adyen::REST::AuthorisePayment::Response Also known as: authorize_payment_3dsecure_request

Generates a Payment.authorise3d request to Adyen’s webservice.

The response differs based on the credit card uses in the transaction. For some credit cards, an additional offsite step may be required to complete the transaction. Check .redirect_shopper? to see if this is the case. Other cards are not 3DSecure-enabled, and may immediately authorise the transaction. Check .authorised? to see if this is the case.

Parameters:

  • attributes (Hash) (defaults to: {})

    The attributes to include in the request.

Returns:

See Also:



118
119
120
121
122
123
# File 'lib/adyen/rest/authorise_payment.rb', line 118

def authorise_payment_3dsecure_request(attributes = {})
  Adyen::REST::AuthorisePayment::Request.new('Payment.authorise3d', attributes,
      prefix: 'payment_request_3d',
      response_class: Adyen::REST::AuthorisePayment::Response,
      response_options: { prefix: 'payment_result' })
end

#authorise_payment_request(attributes = {}) ⇒ Adyen::REST::Request Also known as: authorize_payment_request

Generates Payment.authorise request for Adyen’s webservice.

Parameters:

  • attributes (Hash) (defaults to: {})

    The attributes to include in the request.

Returns:

See Also:



88
89
90
91
92
93
# File 'lib/adyen/rest/authorise_payment.rb', line 88

def authorise_payment_request(attributes = {})
  Adyen::REST::AuthorisePayment::Request.new('Payment.authorise', attributes,
      prefix: 'payment_request',
      response_class: Adyen::REST::AuthorisePayment::Response,
      response_options: { prefix: 'payment_result' })
end

#authorise_recurring_payment(attributes) ⇒ Adyen::REST::AuthorisePayment::Response

Sends an authorise recurring payment request to Adyen’s webservice.

Parameters:

  • attributes (Hash)

    The attributes to include in the request.

Returns:

See Also:



159
160
161
162
# File 'lib/adyen/rest/authorise_payment.rb', line 159

def authorise_recurring_payment(attributes)
  request = authorise_recurring_payment_request(attributes)
  execute_request(request)
end

#authorise_recurring_payment_request(attributes = {}) ⇒ Adyen::REST::Request

Generates Payment.authorise request with recurring for Adyen’s webservice.

Parameters:

  • attributes (Hash) (defaults to: {})

    The attributes to include in the request.

Returns:

See Also:



146
147
148
149
150
151
# File 'lib/adyen/rest/authorise_payment.rb', line 146

def authorise_recurring_payment_request(attributes={})
  Adyen::REST::AuthoriseRecurringPayment::Request.new('Payment.authorise', attributes,
      prefix: 'payment_request',
      response_class: Adyen::REST::AuthorisePayment::Response,
      response_options: { prefix: 'payment_result' })
end

#list_recurring_details(attributes) ⇒ Adyen::REST::AuthorisePayment::ListRecurringDetailsResponse

Sends an list recurring details request to Adyen’s webservice. The response responds to .details and .references with recurring data.



231
232
233
234
# File 'lib/adyen/rest/authorise_payment.rb', line 231

def list_recurring_details(attributes)
  request = list_recurring_details_request(attributes)
  execute_request(request)
end

#list_recurring_details_request(attributes = {}) ⇒ Adyen::REST::ListRecurringDetailsPayment::Request

Generates Recurring.listRecurringDetails request for Adyen’s webservice.

Parameters:

  • attributes (Hash) (defaults to: {})

    The attributes to include in the request.

Returns:

See Also:



218
219
220
221
222
223
# File 'lib/adyen/rest/authorise_payment.rb', line 218

def list_recurring_details_request(attributes = {})
  Adyen::REST::ListRecurringDetailsPayment::Request.new('Recurring.listRecurringDetails', attributes,
      prefix: 'recurring_details_request',
      response_class: Adyen::REST::AuthorisePayment::ListRecurringDetailsResponse,
      response_options: { prefix: 'recurring_details_result' })
end

#reauthorise_recurring_payment(attributes) ⇒ Adyen::REST::AuthorisePayment::Response Also known as: reauthorize_recurring_payment

Sends an authorise recurring payment request to Adyen’s webservice. This method can be called if a previous contract was established with #authorise_recurring_payment

Parameters:

  • attributes (Hash)

    The attributes to include in the request.

Returns:

See Also:



183
184
185
186
# File 'lib/adyen/rest/authorise_payment.rb', line 183

def reauthorise_recurring_payment(attributes)
  request = reauthorise_recurring_payment_request(attributes)
  execute_request(request)
end

#reauthorise_recurring_payment_request(attributes = {}) ⇒ Adyen::REST::Request Also known as: reauthorize_recurring_payment_request

Generates Payment.authorise request with recurring for Adyen’s webservice. This method can be called if a previous contract was established with #authorise_recurring_payment

Parameters:

  • attributes (Hash) (defaults to: {})

    The attributes to include in the request.

Returns:

See Also:



169
170
171
172
173
174
# File 'lib/adyen/rest/authorise_payment.rb', line 169

def reauthorise_recurring_payment_request(attributes={})
  Adyen::REST::ReauthoriseRecurringPayment::Request.new('Payment.authorise', attributes,
      prefix: 'payment_request',
      response_class: Adyen::REST::AuthorisePayment::Response,
      response_options: { prefix: 'payment_result' })
end