Class: GpWebpay::Ws::Services::ProcessUsageBasedPayment

Inherits:
BaseSignedRequest show all
Defined in:
lib/gp_webpay/ws/services/process_usage_based_payment.rb

Constant Summary collapse

OPERATION_NAME =
:process_usage_based_payment
REQUEST_NAME =
:usage_based_payment_request
RESPONSE_NAME =
:process_usage_based_payment_response
RESPONSE_ENTITY_NAME =
:usage_based_payment_response
SERVICE_EXCEPTION =
:payment_service_exception

Constants inherited from BaseSignedRequest

BaseSignedRequest::DEFAULT_ATTRIBUTES

Instance Attribute Summary

Attributes inherited from BaseSignedRequest

#attributes, #config

Instance Method Summary collapse

Methods inherited from BaseSignedRequest

#call

Methods inherited from Service

#call

Constructor Details

#initialize(attributes, merchant_number: :default) ⇒ ProcessUsageBasedPayment

Returns a new instance of ProcessUsageBasedPayment.



19
20
21
22
23
24
25
# File 'lib/gp_webpay/ws/services/process_usage_based_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