Class: GovukPayApiClient::CreatePayment

Inherits:
Object
  • Object
show all
Includes:
Api
Defined in:
lib/govuk_pay_api_client/create_payment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Api

#get, included, #post, #response_body

Constructor Details

#initialize(fee, return_url) ⇒ CreatePayment

Returns a new instance of CreatePayment.

Raises:



6
7
8
9
10
11
# File 'lib/govuk_pay_api_client/create_payment.rb', line 6

def initialize(fee, return_url)
  raise RequiresFeeObject if fee.blank?
  raise RequiresReturnUrl if return_url.blank?
  @fee = fee
  @return_url = return_url
end

Instance Attribute Details

#feeObject

Returns the value of attribute fee.



4
5
6
# File 'lib/govuk_pay_api_client/create_payment.rb', line 4

def fee
  @fee
end

#return_urlObject

Returns the value of attribute return_url.



4
5
6
# File 'lib/govuk_pay_api_client/create_payment.rb', line 4

def return_url
  @return_url
end

Instance Method Details

#callObject



13
14
15
16
# File 'lib/govuk_pay_api_client/create_payment.rb', line 13

def call
  post
  parsed_response
end