Class: Adyen::API::RecurringService

Inherits:
SimpleSOAPClient show all
Extended by:
TestHelpers
Defined in:
lib/adyen/api/recurring_service.rb,
lib/adyen/api/test_helpers.rb,
lib/adyen/api/templates/recurring_service.rb

Overview

This is the class that maps actions to Adyen’s Recurring SOAP service.

It’s encouraged to use the shortcut methods on the Adyen::API module, which abstracts away the difference between this service and the PaymentService. Henceforth, for extensive documentation you should look at the Adyen::API documentation.

The most important difference is that you instantiate a RecurringService with the parameters that are needed for the call that you will eventually make.

Examples:

recurring = Adyen::API::RecurringService.new(:shopper => { :reference => user.id })
response = recurring.disable
response.success? # => true

Defined Under Namespace

Modules: TestHelpers Classes: DisableResponse, ListResponse, StoreTokenResponse

Constant Summary collapse

ENDPOINT_URI =

The Adyen Recurring SOAP service endpoint uri.

'https://pal-%s.adyen.com/pal/servlet/soap/Recurring'
LIST_LAYOUT =
<<EOS
    <recurring:listRecurringDetails xmlns:payment="http://payment.services.adyen.com" xmlns:recurring="http://recurring.services.adyen.com">
      <recurring:request>
        <recurring:recurring>
          <payment:contract>RECURRING</payment:contract>
        </recurring:recurring>
        <recurring:merchantAccount>%s</recurring:merchantAccount>
        <recurring:shopperReference>%s</recurring:shopperReference>
      </recurring:request>
    </recurring:listRecurringDetails>
EOS
DISABLE_LAYOUT =
<<EOS
    <recurring:disable xmlns:recurring="http://recurring.services.adyen.com">
      <recurring:request>
        <recurring:merchantAccount>%s</recurring:merchantAccount>
        <recurring:shopperReference>%s</recurring:shopperReference>
        %s
      </recurring:request>
    </recurring:disable>
EOS
RECURRING_DETAIL_PARTIAL =
<<EOS
        <recurring:recurringDetailReference>%s</recurring:recurringDetailReference>
EOS
STORE_TOKEN_LAYOUT =
<<EOS
    <recurring:storeToken xmlns:recurring="http://recurring.services.adyen.com" xmlns:payment="http://payment.services.adyen.com">
      <recurring:request>
        <recurring:recurring>
          <payment:contract>RECURRING</payment:contract>
        </recurring:recurring>
        <recurring:merchantAccount>%s</recurring:merchantAccount>
        <recurring:shopperReference>%s</recurring:shopperReference>
        <recurring:shopperEmail>%s</recurring:shopperEmail>
        %s
      </recurring:request>
    </recurring:storeToken>
EOS
CARD_PARTIAL =
<<EOS
        <recurring:card>
          <payment:holderName>%s</payment:holderName>
          <payment:number>%s</payment:number>
          <payment:cvc>%s</payment:cvc>
          <payment:expiryYear>%s</payment:expiryYear>
          <payment:expiryMonth>%02d</payment:expiryMonth>
        </recurring:card>
EOS
ELV_PARTIAL =

Electronic bank debit in Germany. Semi real-time payment method.

<<EOS
        <recurring:elv>
          <payment:bankLocation>%s</payment:bankLocation>
          <payment:bankName>%s</payment:bankName>
          <payment:bankLocationId>%s</payment:bankLocationId>
          <payment:accountHolderName>%s</payment:accountHolderName>
          <payment:bankAccountNumber>%02d</payment:bankAccountNumber>
        </recurring:elv>
EOS

Constants included from TestHelpers

TestHelpers::DISABLE_RESPONSE

Constants inherited from SimpleSOAPClient

SimpleSOAPClient::CACERT, SimpleSOAPClient::ENVELOPE

Instance Attribute Summary

Attributes inherited from SimpleSOAPClient

#params

Instance Method Summary collapse

Methods included from TestHelpers

disabled_stub, stub_disabled!

Methods inherited from SimpleSOAPClient

#call_webservice_action, endpoint, #initialize, #validate_parameter_value!, #validate_parameters!

Constructor Details

This class inherits a constructor from Adyen::API::SimpleSOAPClient

Instance Method Details

#disableObject



30
31
32
# File 'lib/adyen/api/recurring_service.rb', line 30

def disable
  call_webservice_action('disable', disable_request_body, DisableResponse)
end

#listObject



25
26
27
# File 'lib/adyen/api/recurring_service.rb', line 25

def list
  call_webservice_action('listRecurringDetails', list_request_body, ListResponse)
end

#store_tokenObject



35
36
37
# File 'lib/adyen/api/recurring_service.rb', line 35

def store_token
  call_webservice_action('storeToken', store_token_request_body, StoreTokenResponse)
end