Class: GpWebpay::Ws::Services::ProcessCardOnFilePayment
- Inherits:
-
BaseSignedRequest
- Object
- Service
- BaseSignedRequest
- GpWebpay::Ws::Services::ProcessCardOnFilePayment
- Defined in:
- lib/gp_webpay/ws/services/process_card_on_file_payment.rb
Defined Under Namespace
Classes: GpWebpayConfirmationRequired
Constant Summary collapse
- OPERATION_NAME =
:process_card_on_file_payment
- REQUEST_NAME =
:card_on_file_payment_request
- RESPONSE_NAME =
:process_card_on_file_payment_response
- RESPONSE_ENTITY_NAME =
:card_on_file_payment_response
- SERVICE_EXCEPTION =
:card_on_file_payment_service_exception
Constants inherited from BaseSignedRequest
BaseSignedRequest::DEFAULT_ATTRIBUTES
Instance Attribute Summary
Attributes inherited from BaseSignedRequest
Instance Method Summary collapse
-
#initialize(attributes, merchant_number: :default) ⇒ ProcessCardOnFilePayment
constructor
A new instance of ProcessCardOnFilePayment.
- #rescue_from_soap(exception) ⇒ Object
Methods inherited from BaseSignedRequest
Methods inherited from Service
Constructor Details
#initialize(attributes, merchant_number: :default) ⇒ ProcessCardOnFilePayment
Returns a new instance of ProcessCardOnFilePayment.
19 20 21 22 23 24 25 |
# File 'lib/gp_webpay/ws/services/process_card_on_file_payment.rb', line 19 def initialize(attributes, merchant_number: :default) config = GpWebpay.config[merchant_number] || GpWebpay.config.default merged_attributes = { return_url: GpWebpay::Engine.routes.url_helpers.gp_webpay_orders_url({ merchant_number: config.merchant_number }) }.merge(attributes) super(merged_attributes, merchant_number: merchant_number) end |
Instance Method Details
#rescue_from_soap(exception) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/gp_webpay/ws/services/process_card_on_file_payment.rb', line 27 def rescue_from_soap(exception) response = WsResponse.from_fault_error(exception.to_hash, self.class::SERVICE_EXCEPTION, config.merchant_number) if response.valid? && response.params[:authentication_link].present? raise GpWebpayConfirmationRequired.new('GP Webpay requires authentication', response.params[:authentication_link]) end response end |