Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Duplicated fields in hosted_order_form #8

Description

@jonnyjava

Using the hash you give as example in the readme (fixing little typo in shipping_method which should be shipping_methods) I tryed to do OpenPayU.hosted_order_form(order) but the result is not what I expected. As you can see below all the keys are repeated once camelized and once not. This makes the POST fail.

<form action="https://secure.payu.com/api/v2/order" method="post">
<input type="hidden" value="1000" name="total_amount">
<input type="hidden" value="http://localhost/continue" name="continue_url">
<input type="hidden" value="{ba8ff33b-0b32-42e4-b61d-2dcdacba3d7f}" name="req_id">
<input type="hidden" value="http://localhost/notify" name="notify_url">
<input type="hidden" value="http://localhost/order" name="order_url">
<input type="hidden" value="127.0.0.1" name="customer_ip">
<input type="hidden" value="145227" name="merchant_pos_id">
<input type="hidden" value="Order description" name="description">
<input type="hidden" value="PLN" name="currency_code">
<input type="hidden" value="Product 1" name="products.products.name[0]">
<input type="hidden" value="1000" name="products.products.unitPrice[0]">
<input type="hidden" value="1" name="products.products.quantity[0]">
<input type="hidden" value="1" name="ext_order_id">
<input type="hidden" value="1000" name="totalAmount">
<input type="hidden" value="http://localhost/continue" name="continueUrl">
<input type="hidden" value="{ba8ff33b-0b32-42e4-b61d-2dcdacba3d7f}" name="reqId">
<input type="hidden" value="http://localhost/notify" name="notifyUrl">
<input type="hidden" value="http://localhost/order" name="orderUrl">
<input type="hidden" value="127.0.0.1" name="customerIp">
<input type="hidden" value="145227" name="merchantPosId">
<input type="hidden" value="PLN" name="currencyCode">
<input type="hidden" value="1" name="extOrderId">
<input type="hidden" value="sender=145227;signature=1cef67f5170d2872e6e2c0f7976f1e1a;algorithm=MD5" name="OpenPayu-Signature">
<button formtarget="_blank" type="submit"></button></form>

I think the problem is due this line { k.camelize(:lower) => v.map(&:prepare_keys) } in this class OpenPayU::Models::Model.prepare_keys

I'll submit a fix as I'll be able to find one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions