Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed URL ROBOKASSA #209

Open
abuhtoyarov opened this issue Aug 3, 2016 · 1 comment
Open

Changed URL ROBOKASSA #209

abuhtoyarov opened this issue Aug 3, 2016 · 1 comment

Comments

@abuhtoyarov
Copy link

Docs

I look the documentation and see that now a new URL for payment
https://auth.robokassa.ru/Merchant/Index.aspx

To work in test mode required parameter is IsTest.

Now for payment use the following URL:

http://test.robokassa.ru/Index.aspx -test mode
https://merchant.roboxchange.com/Index.aspx - production mode

@anoam
Copy link

anoam commented Aug 24, 2016

As hotfix you can redefine urls like this:

# config/initializers/offsite_payments.rb
OffsitePayments::Integrations::Robokassa.production_url = "https://auth.robokassa.ru/Merchant/Index.aspx"
OffsitePayments::Integrations::Robokassa.test_url = "https://auth.robokassa.ru/Merchant/Index.aspx"

The best way I found to add IsTest to parameters is monkey patching:

OffsitePayments::Integrations::Robokassa::Helper.class_eval do
  def form_fields
    @fields
      .merge(test_field)
      .merge(OffsitePayments::Integrations::Robokassa.signature_parameter_name => generate_signature)
  end

  def params
    @fields.merge(test_field)
  end

  private

  def test_field
    {"IsTest" => test? ? 1 : 0}
  end
end

It works fine for me, but I'm not pretty sure that it would be ok for all cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants