Skip to content

Commit

Permalink
Allow override of cmd to enable forcing _express-checkout-mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjrice committed Aug 5, 2014
1 parent f49645c commit 0faa169
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/paypal/express/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Response < NVP::Response
def initialize(response, options = {})
super response
@pay_on_paypal = options[:pay_on_paypal]
@mobile = options[:mobile]
end

def redirect_uri
Expand All @@ -24,8 +25,9 @@ def popup_uri

def query(with_cmd = false)
_query_ = {:token => self.token}
_query_.merge!(:cmd => '_express-checkout') if with_cmd
_query_.merge!(:useraction => 'commit') if pay_on_paypal
_query_.merge!(:cmd => '_express-checkout') if with_cmd
_query_.merge!(:cmd => '_express-checkout-mobile') if mobile
_query_.merge!(:useraction => 'commit') if pay_on_paypal
_query_
end
end
Expand Down

0 comments on commit 0faa169

Please sign in to comment.