Paypal express checkout works locally but not in production in rails. Returns an error called No Token Passed -


using express checkout , activemerchant gem in rails created wallet feature in can add funds wallet through paypal(express checkout). works locally not in production.

in production click paypal checkout button redirected following url no token(as can see)

https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=

the thing on blank page here "no token passed"

here log production in heroku enter image description here

in local development set same action get:

https://www.sandbox.paypal.com/in/cgi-bin/merchantpaymentweb?cmd=_flow&session=-ubdpzpappbkghfszshlh8pr4jhmxwqybcjt5wlq2tcj8satu0iw3vysmhq&dispatch=50a222a57771920b6a3d7b606239e4d529b525e0b7e69bf0fb0124e9b61f737ba21b0819848475f0da5465a2ea26eae033cbe3bda

(i removed few characters session above url wont work) option make payments.

here screenshot of dev log enter image description here

the following relevant code:

def express_checkout     response = express_gateway.setup_purchase(bigdecimal.new(params[:amount])*100,         ip: request.remote_ip,         return_url: new_payment_url,         cancel_return_url: wallet_url,         currency: "usd",         allow_guest_checkout: true,         items: [{name: "add money", description: "adds money wallet ", amount: bigdecimal.new(params[:amount])*100}]     )     redirect_to express_gateway.redirect_url_for(response.token) end 

the following code related it. code split following filenames titles - activemerchant.rb, payments_controller.rb, payment.rb , wallet.html.erb

http://pastebin.com/caagd2st

can tell me why works in dev , not in production , should it?

i believe missing yml configuration production environment. usually, these 3rd party integrations require yml file config / settings per environment. specially paypal, when have different ids, secrets, etc.

based on comment, seems environment variables not being loaded production environment.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -