I am upgrading from Laravel 5.4 to Laravel 5.8 and the Spark from @dev to ~8.0. I am now encountering an issue where the anytime I try to use any Spark feature that tries to use Stripe, it throws the Invalid Stripe Key/Secreterror even though the keys are correct.
I managed to find out where the exception is being thrown from. There is a mixin for creating a card field in the front end with the following code:
module.exports = {
/**
* The mixin's data.
*/
data() {
return {
stripe: Spark.stripeKey ? Stripe(Spark.stripeKey) : null
}
},
methods: {
/**
* Create a Stripe Card Element.
*/
createCardElement(container){
if (!this.stripe) {
throw "Invalid Stripe Key/Secret";
}
var card = this.stripe.elements().create('card', {
hideIcon: true,
hidePostalCode: true,
style: {
base: {
'::placeholder': {
color: '#aab7c4'
},
fontFamily: 'Whitney, Lato, -apple-system, BlinkMacSystemFont,"Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol"',
color: '#495057',
fontSize: '15px'
}
}
});
card.mount(container);
return card;
}
},
};
The this.stripe is coming up as undefined even though the keys are properly set and I am trying to find where the Stripe function used to create thethis.stripe object is located but I can't seem to find it anywhere. Is there something obvious I am missing that need to look into?
Thanks