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"
in local development set same action get:
(i removed few characters session above url wont work) option make payments.
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
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
Post a Comment