Class: DefraRubyMocks::GovpayGetPaymentService

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

Instance Method Summary collapse

Methods inherited from BaseService

run

Instance Method Details

#run(payment_id:, amount: Random.rand(100..1_000), created_at: Time.current) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/services/defra_ruby_mocks/govpay_get_payment_service.rb', line 8

def run(payment_id:, amount: Random.rand(100..1_000), created_at: Time.current)
  {
    created_date: created_at,
    amount: amount,
    state: {
      status: "success",
      finished: true
    },
    description: "Your waste carriers registration fee",
    reference: "12345",
    language: "en",
    payment_id: payment_id,
    refund_summary: {
      status: "available",
      amount_available: amount - 100,
      amount_submitted: 0
    },
    total_amount: amount,
    payment_provider: "worldpay",
    provider_id: "10987654321"
  }
end