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

Paypal Express Request setup options #29

Closed
rafops opened this issue Apr 4, 2012 · 4 comments
Closed

Paypal Express Request setup options #29

rafops opened this issue Apr 4, 2012 · 4 comments

Comments

@rafops
Copy link

rafops commented Apr 4, 2012

Hi Nov

There is a way to pass options like "HDRIMG", "LOCALECODE" or "BRANDNAME" to Paypal Express Request setup?

Best Regards!

Castilhor

@rafops
Copy link
Author

rafops commented Apr 4, 2012

One quick solution which I thought was:

module Custom
  module Payment
    class Request < ::Paypal::Payment::Request
      attr_optional :brand_name, :locale_code
      def to_params(index = 0)
        super(index).update({
          BRANDNAME: self.brand_name,
          LOCALECODE: self.locale_code
        }.delete_if { |k,v| v.blank? })
      end
    end
  end
end

Simple and beautiful!

@bdesmarez
Copy link

Hello @CastilhoR,
I have the same problem as you (LOCALCODE), where do you write this in your app to make it works?
Thanks ;)

@rafops
Copy link
Author

rafops commented May 6, 2012

Hi @bdesmarez

I created the class under my ./lib/custom/payment/request.rb, then used Custom::Payment::Request.new(locale_code: "yourlocalecode", ...) instead of Paypal::Payment::Request.new(...)

works like a charm ;)

@bdesmarez
Copy link

Thanks you @CastilhoR ! Indeed works like a charm.
Thanks again.

@nov nov closed this as completed in 580b8c4 May 16, 2012
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

3 participants