Class: PayU::Form

Inherits:
Object
  • Object
show all
Defined in:
lib/pay_u/form.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Form

Returns a new instance of Form.



8
9
10
11
# File 'lib/pay_u/form.rb', line 8

def initialize(params)
  super(params)
  @signer = PayU::Signer::Form.new(order.attributes)
end

Instance Attribute Details

#signerObject (readonly)

Returns the value of attribute signer.



6
7
8
# File 'lib/pay_u/form.rb', line 6

def signer
  @signer
end

Instance Method Details

#paramsObject



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/pay_u/form.rb', line 19

def params
  {
    action: PayU.configuration.webcheckout_url,
    fields: {
      merchantId: order.merchant_id,
      accountId: order.,
      description: order.description,
      referenceCode: order.reference_code,
      amount: order.amount,
      tax: order.tax,
      taxReturnBase: order.tax_return_base,
      currency: order.currency,
      signature: signature,
      test: order.test? ? "1" : "0",
      extra1: order.extra_1,
      extra2: order.extra_2,
      extra3: order.extra_3,
      responseUrl: order.response_url,
      confirmationUrl: order.confirmation_url,
    },
  }
end

#signatureObject



14
15
16
# File 'lib/pay_u/form.rb', line 14

def signature
  signer.signature
end