Hi,
I keep getting this error when trying to test Stripe subscriptions.
"a similar object exists in test mode, but a live mode key was used to make this request."
In my .env file I have both my live and test keys stored.
In my service.php I am referencing both my Test Key and Secret Test Key.
But in the error I got it still shows Cashier and Token.php referencing my live key. I even tried deleting my stripe reference all together from service.php and the same error came up. Does laravel cashier store these keys anywhere else that it may be stored.
Also on the front end I am just using the basic JS that is referenced in the stripe documentation. Here it is:
jQuery(document).ready(function($) {
Stripe.setPublishableKey('pk_test_OVtP7wR47ry9b3szLbmAd9e8');
$('#payment-form').submit(function(event) {
event.preventDefault();
console.log('testing');
var $form = $(this);
$form.find('button').prop('disabled', true);
Stripe.card.createToken($form, stripeResponseHandler);
return false;
});
function stripeResponseHandler(status, response) {
var $form = $('#payment-form');
if (response.error) {
$form.find('.payment-errors').text(response.error.message);
$form.find('button').prop('disabled', false);
} else {
var token = response.id;
$form.append($('').val(token));
$form.get(0).submit();
}
};
});