Use Stripe test prices with the code below on Paywall for fire Subscribe event and send user to another page or show popup
<script>
AnalyticsManager.on('Stripe submit error', function(e) {
if (e.decline_code === "test_mode_live_card" || (e.message || '').indexOf('stripe.com/docs/testing') > -1){
let price=window.document.querySelector('.plan-popup__totals-sum').innerText.replace("$","")
price = parseFloat(price)
console.log(price)
AnalyticsManager.logEvent('Purchase', {value: price});
window.location.pathname='/mindflow-2-email';
// OR
// Open another popup
PopupInstance.open('#popup_id');
}
/* Error codes:
- card_declined
- incomplete_payment_method
- incorrect_number
- generic_decline
- invalid_zip
- incomplete_cvc
- incorrect_cvc
- invalid_number
- incomplete_expiry
- expired_card
- invalid_cvc
*/
});
</script>