Class: DefraRubyMocks::GovpayCreatePaymentService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/defra_ruby_mocks/govpay_create_payment_service.rb

Instance Method Summary collapse

Methods inherited from BaseService

run

Instance Method Details

#run(amount:, description:) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/services/defra_ruby_mocks/govpay_create_payment_service.rb', line 8

def run(amount:, description:)
  success_response.merge(
    {
      _links: {
        self: { href: "#{base_url}/#{payment_id}", method: "GET" },
        next_url: { href: "#{base_url}/secure/next-url-uuid-abc123", method: "GET" }
      },
      amount: amount.to_i,
      description: description,
      payment_id: payment_id
    }
  )
end