I implemented a Stripe payment system on a product selling Rails app; in development, everything works fine, even the webhook's to conclude the purchase.
But when after deployed to heroku, when i try to make the purchase process, it gets stuck after clicking the "Buy" button.... On Heroku logs it displays the following Fatal message:
" Stripe::AuthenticationError (No API key provided. Set your API key using "Stripe.api_key = ". You can generate API keys from the Stripe web interface."
But everything was pushed and migrated.
Any hints?
Thank you
Assuming you used a gem like "dotenv" for the API keys and other keys in development, you need to pass the keys to heroku like so:
heroku config:set STRIPE_KEY=abcdefg...
Related
I have an app that uses stripe payments and I am trying to allow users' cards to be charged. I have successfully changed the pk_test to pk_live but I am having issues changing sk_test to sk_live. I had paid someone to install stripe for me, and the only reference I can see to sk is inside of node.js as
const stripe = require('stripe')(functionConfig().stripesecretkeys.key);
This leads me to believe that the individual used terminal to reference the sk_test. My question is, how can I change this to be live instead of test.
I see this on firebase Doc,
firebase functions:config:set stripe.secret=<YOUR STRIPE LIVE SECRET KEY>
EDIT:
I have managed to add the secret key in through terminal, but when I create a new customer they are still being created under test mode on stripe? am I missing something?
So, I've been developing my app locally for sometime now and I decided today that I would like to deploy it on Heroku to start getting initial feedback for the app. I went through the guide on Heroku to help deploy my Rails 5 app to heroku.
Deployment was smooth and I was shown my login page. I clicked on Login Via FB and I was returned a white page with the following error response
The parameter app_id is required
Now, my obvious plan of action was to follow the trail, refer SO and hopefully come up with a solution for this. I tried every plausible resource on the web but I still get this error.
I've even updated my APP_ID and APP_SECRET variables on heroku. I've even updated Valid OAuth Redirect URIs section in my fb developer settings with the appropriate Heroku URL.
The funny bit is that everything works smoothly on my localhost but fails on heroku which is strange.
I strongly believe that Facebook would through appropriate errors and that app_id is in fact not being sent to fb. If this is the case, how do I solve this?
If you need code snippets to look at, do ask what might be needed to be looked at and I shall update my post accordingly.
Thank you!
the solution turned out to be a pretty simple one. In my application.yml file I had saved my Facebook vars as facebook_app_id and facebook_secret_key. But in my Heroku config vars I had included them as FACEBOOK_APP_ID and FACEBOOK_SECRET_KEY. I was under the impression keys aren't case sensitive. When I changed them to lowercase for Heroku, it worked.
I have a RoR app that reads emails from my inbox using the gmail gem. I've deployed to Heroku and everything works fine, except connecting to gmail.
On my local machine it connects with no issues (after I allowed access for less secure apps).
Using the basic gmail login method;
Gmail.connect!('my_email#gmail.com','password')
I get the following error in production only.
Gmail::Client::AuthorizationError: Couldn't login to given Gmail account: my_email#gmail.com (Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure))
And then I'll go to https://www.google.com/accounts/DisplayUnlockCaptcha (as other answers have suggested) and it will work fine for a short time period and then suddenly stop working again.
I'm using Ruby v2.4.1, RoR v5.1.1 and the gmail gem v0.6.0 (https://github.com/gmailgem/gmail)
Any help would be great.
Are you deploying to a domain? It could be caused by the fact that:
Heroko will not give you even a range of IP addresses - they can, may and will move dynos between Amazon zones as needs require.
Your only option would be some sort of proxy node with a static IP that they talk to that securely communicates to your Heroku app - or consider if Heroku is the right fit for you here altogether.
Source: Get a finite list of IP addresses for my Heroku App?
It seems like you sign into Google and whitelist what an IP (as far as they're concerned) and then the dyno switches a bit later for whatever reason so then Google no longer has your dyno's IP in the whitelist for this app.
Everything works fine in a development/localhost environment.
When deploying to heroku, using sandbox/test credentials on a new app, and creating a new payment I am getting
A PayPal::SDK::Core::Exceptions::UnauthorizedAccess occurred in orders#create:
Failed. Response code = 401. Response message = Unauthorized.
Again, everything thing works in a development environment
Should I permit any specific domains (like in Facebook integration)?
If you are running a Rails application on a public server, there is quite a chance that the Rails environment is set to "production".
If you further use the config/initializers/paypal.rb and config/paypal.yml generated by the Paypal API SDK's standard generator, then:
the initializer loads configuration for the current Rails environment, which is "production"
and in the production configuration one important line presumes that you want to run on the live API
So most probably you are attempting to communicate with the live API without knowing it. Changing the line to mode: sandbox should make you happy.
I had this problem and I called Paypal. It was a config problem in my account.
To resolve I went to https://developer.paypal.com, logged in, Then clicked on Dashboard Then on my account (left) The Direct credit cards has a grey x next to it so you have to click the link next to it that reads Enable live credentials Once you do this you have to answer some verification questions then they approve your account then your live and the unauthorized error goes away.
We are using Heroku to host our Rails app, and are looking to send out our mail via ActionMailer. I just signed up for SendGrid, paid, and have a fully provisioned account ready to start firing off these emails. How should i go about implementing? through Heroku as an "add-on", or via the Rails documentation found on SendGrid's site?
If you use the add-on, a new SendGrid account will be created with a randomly assigned username and password. Since you already have an account, you will need to reset the relevant Heroku environment variables to your existing credentials if you use the addon. Other than that, there should be no difference between letting Heroku generate the settings or doing it by hand.
Edit: Another difference is that if you use the addon, billing works a little differently. Heroku cannot currently bill overages, so if you are on a 40,000 email credits / month plan, that 40,000 is a hard limit. If your account is via SendGrid.com, it's a soft limit that allows you to pay overages if you send more mail.