Skip to content

Commit

Permalink
Fix form params signature
Browse files Browse the repository at this point in the history
  • Loading branch information
daninfpj committed Dec 28, 2018
1 parent 941e648 commit 8aadb87
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/pay_u/form.rb
Expand Up @@ -29,7 +29,7 @@ def params
taxReturnBase: order.tax_return_base,
currency: order.currency,
signature: signature,
test: order.test? ? 1 : 0,
test: order.test? ? "1" : "0",
responseUrl: order.response_url,
confirmationUrl: order.confirmation_url,
},
Expand Down
2 changes: 1 addition & 1 deletion lib/pay_u/signer/form.rb
Expand Up @@ -5,7 +5,7 @@ def fields
api_key,
merchant_id,
reference_code,
format("%<amount>d", amount: amount),
format("%<amount>g", amount: format("%<amount>f", amount: amount)),
currency,
]
end
Expand Down
2 changes: 1 addition & 1 deletion spec/pay_u/form_spec.rb
Expand Up @@ -48,7 +48,7 @@
expect(form.params[:fields][:amount]).to eq(amount)
expect(form.params[:fields][:currency]).to eq(currency)
expect(form.params[:fields][:signature]).to eq("7ee7cf808ce6a39b17481c54f2c57acc")
expect(form.params[:fields][:test]).to eq(1)
expect(form.params[:fields][:test]).to eq("1")
expect(form.params[:fields][:responseUrl]).to eq(response_url)
expect(form.params[:fields][:confirmationUrl]).to eq(confirmation_url)
end
Expand Down

0 comments on commit 8aadb87

Please sign in to comment.