I need a small customization in my stripe javascript. I have a php value as $invid and I want to pass it as a hidden field to next page of stripe card submission, so I will have both $stripeToken and $invid on next page after card submission, which changes do I need to do in my stripe code:
function stripeResponseHandler(status, response) {
var $form = $('#payment-form');
if (response.error) {
// Show the errors on the form
$form.find('.payment-errors').text(response.error.message);
$form.find('button').prop('disabled', false);
} else {
// response contains id and card, which contains additional card details
var token = response.id;
// Insert the token into the form so it gets submitted to the server
$form.append($('<input type="hidden" name="stripeToken" />').val(token));
$form.append($('<input type="hidden" name="invid" value="<?=$invid?>" />'));
// and submit
$form.get(0).submit();
}
};
should be something correct? or how?