Stripe Simple Checkout integration with cancel button
I am trying to integrate Stripe with my website with "Simple" checkout as described at https://stripe.com/docs/checkout . I have created a summary page on which I have added script tag. This shows the Pay With Card and it works fine.
However, I need a "Cancel" or "Back" button on this summary page so as to give user chance to go back to previous page or cancel online booking. But even when this other button is clicked, the Payment pop-up is opened and it is not raising the back button event.
What am I missing? Why even other buttons are hijacked by Stripe JS. Please help.
c# asp.net webforms stripe-payments
add a comment |
I am trying to integrate Stripe with my website with "Simple" checkout as described at https://stripe.com/docs/checkout . I have created a summary page on which I have added script tag. This shows the Pay With Card and it works fine.
However, I need a "Cancel" or "Back" button on this summary page so as to give user chance to go back to previous page or cancel online booking. But even when this other button is clicked, the Payment pop-up is opened and it is not raising the back button event.
What am I missing? Why even other buttons are hijacked by Stripe JS. Please help.
c# asp.net webforms stripe-payments
add a comment |
I am trying to integrate Stripe with my website with "Simple" checkout as described at https://stripe.com/docs/checkout . I have created a summary page on which I have added script tag. This shows the Pay With Card and it works fine.
However, I need a "Cancel" or "Back" button on this summary page so as to give user chance to go back to previous page or cancel online booking. But even when this other button is clicked, the Payment pop-up is opened and it is not raising the back button event.
What am I missing? Why even other buttons are hijacked by Stripe JS. Please help.
c# asp.net webforms stripe-payments
I am trying to integrate Stripe with my website with "Simple" checkout as described at https://stripe.com/docs/checkout . I have created a summary page on which I have added script tag. This shows the Pay With Card and it works fine.
However, I need a "Cancel" or "Back" button on this summary page so as to give user chance to go back to previous page or cancel online booking. But even when this other button is clicked, the Payment pop-up is opened and it is not raising the back button event.
What am I missing? Why even other buttons are hijacked by Stripe JS. Please help.
c# asp.net webforms stripe-payments
c# asp.net webforms stripe-payments
edited Nov 11 at 18:46
asked Nov 11 at 18:30
Milind Thakkar
89211118
89211118
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Simple Checkout allows the user to enter their credit card, then creates a token, then immediately submits the <form></form>
which encloses it. If you need more customizability than that, you'll need to use the Custom Checkout integration.
With the Custom integration, the user is presented with Checkout, Stripe generates a token, then it is up to you to decide what to do next --- you could write JS in the token creation callback to append a hidden field with the token and then immediately submit the form, or you could land the user back on your summary page and wait for the user to give an additional confirmation before submitting your form, or 'go back.'
var handler = StripeCheckout.configure(
key: 'pk_test_xxxyyyyzz',
token: function(token)
// You can access the token ID with `token.id`.
// Do something with that token (append a hidden input + submit the form?)
);
Thanks for the response. Yes, I can go with custom integration. However, I fail to understand why my other button on the page where there is Stripe Checkout JS is integrated is not posting to server just like normal asp.net button. Why even that is opening the payment pop-up? Stripe JS should only bind with the input created by it i.e. Pay With Card button...
– Milind Thakkar
Nov 12 at 13:13
Huh, I haven't seen that behavior before when integrating Stripe --- another button on the page opening a Stripe Checkout simple integration. If you're seeing that could be worth emailing a link or example code to Stripe.
– duck
Nov 12 at 17:32
Thanks, will write to stripe support.
– Milind Thakkar
Nov 12 at 19:11
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53251856%2fstripe-simple-checkout-integration-with-cancel-button%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Simple Checkout allows the user to enter their credit card, then creates a token, then immediately submits the <form></form>
which encloses it. If you need more customizability than that, you'll need to use the Custom Checkout integration.
With the Custom integration, the user is presented with Checkout, Stripe generates a token, then it is up to you to decide what to do next --- you could write JS in the token creation callback to append a hidden field with the token and then immediately submit the form, or you could land the user back on your summary page and wait for the user to give an additional confirmation before submitting your form, or 'go back.'
var handler = StripeCheckout.configure(
key: 'pk_test_xxxyyyyzz',
token: function(token)
// You can access the token ID with `token.id`.
// Do something with that token (append a hidden input + submit the form?)
);
Thanks for the response. Yes, I can go with custom integration. However, I fail to understand why my other button on the page where there is Stripe Checkout JS is integrated is not posting to server just like normal asp.net button. Why even that is opening the payment pop-up? Stripe JS should only bind with the input created by it i.e. Pay With Card button...
– Milind Thakkar
Nov 12 at 13:13
Huh, I haven't seen that behavior before when integrating Stripe --- another button on the page opening a Stripe Checkout simple integration. If you're seeing that could be worth emailing a link or example code to Stripe.
– duck
Nov 12 at 17:32
Thanks, will write to stripe support.
– Milind Thakkar
Nov 12 at 19:11
add a comment |
Simple Checkout allows the user to enter their credit card, then creates a token, then immediately submits the <form></form>
which encloses it. If you need more customizability than that, you'll need to use the Custom Checkout integration.
With the Custom integration, the user is presented with Checkout, Stripe generates a token, then it is up to you to decide what to do next --- you could write JS in the token creation callback to append a hidden field with the token and then immediately submit the form, or you could land the user back on your summary page and wait for the user to give an additional confirmation before submitting your form, or 'go back.'
var handler = StripeCheckout.configure(
key: 'pk_test_xxxyyyyzz',
token: function(token)
// You can access the token ID with `token.id`.
// Do something with that token (append a hidden input + submit the form?)
);
Thanks for the response. Yes, I can go with custom integration. However, I fail to understand why my other button on the page where there is Stripe Checkout JS is integrated is not posting to server just like normal asp.net button. Why even that is opening the payment pop-up? Stripe JS should only bind with the input created by it i.e. Pay With Card button...
– Milind Thakkar
Nov 12 at 13:13
Huh, I haven't seen that behavior before when integrating Stripe --- another button on the page opening a Stripe Checkout simple integration. If you're seeing that could be worth emailing a link or example code to Stripe.
– duck
Nov 12 at 17:32
Thanks, will write to stripe support.
– Milind Thakkar
Nov 12 at 19:11
add a comment |
Simple Checkout allows the user to enter their credit card, then creates a token, then immediately submits the <form></form>
which encloses it. If you need more customizability than that, you'll need to use the Custom Checkout integration.
With the Custom integration, the user is presented with Checkout, Stripe generates a token, then it is up to you to decide what to do next --- you could write JS in the token creation callback to append a hidden field with the token and then immediately submit the form, or you could land the user back on your summary page and wait for the user to give an additional confirmation before submitting your form, or 'go back.'
var handler = StripeCheckout.configure(
key: 'pk_test_xxxyyyyzz',
token: function(token)
// You can access the token ID with `token.id`.
// Do something with that token (append a hidden input + submit the form?)
);
Simple Checkout allows the user to enter their credit card, then creates a token, then immediately submits the <form></form>
which encloses it. If you need more customizability than that, you'll need to use the Custom Checkout integration.
With the Custom integration, the user is presented with Checkout, Stripe generates a token, then it is up to you to decide what to do next --- you could write JS in the token creation callback to append a hidden field with the token and then immediately submit the form, or you could land the user back on your summary page and wait for the user to give an additional confirmation before submitting your form, or 'go back.'
var handler = StripeCheckout.configure(
key: 'pk_test_xxxyyyyzz',
token: function(token)
// You can access the token ID with `token.id`.
// Do something with that token (append a hidden input + submit the form?)
);
answered Nov 11 at 20:00
duck
1,749613
1,749613
Thanks for the response. Yes, I can go with custom integration. However, I fail to understand why my other button on the page where there is Stripe Checkout JS is integrated is not posting to server just like normal asp.net button. Why even that is opening the payment pop-up? Stripe JS should only bind with the input created by it i.e. Pay With Card button...
– Milind Thakkar
Nov 12 at 13:13
Huh, I haven't seen that behavior before when integrating Stripe --- another button on the page opening a Stripe Checkout simple integration. If you're seeing that could be worth emailing a link or example code to Stripe.
– duck
Nov 12 at 17:32
Thanks, will write to stripe support.
– Milind Thakkar
Nov 12 at 19:11
add a comment |
Thanks for the response. Yes, I can go with custom integration. However, I fail to understand why my other button on the page where there is Stripe Checkout JS is integrated is not posting to server just like normal asp.net button. Why even that is opening the payment pop-up? Stripe JS should only bind with the input created by it i.e. Pay With Card button...
– Milind Thakkar
Nov 12 at 13:13
Huh, I haven't seen that behavior before when integrating Stripe --- another button on the page opening a Stripe Checkout simple integration. If you're seeing that could be worth emailing a link or example code to Stripe.
– duck
Nov 12 at 17:32
Thanks, will write to stripe support.
– Milind Thakkar
Nov 12 at 19:11
Thanks for the response. Yes, I can go with custom integration. However, I fail to understand why my other button on the page where there is Stripe Checkout JS is integrated is not posting to server just like normal asp.net button. Why even that is opening the payment pop-up? Stripe JS should only bind with the input created by it i.e. Pay With Card button...
– Milind Thakkar
Nov 12 at 13:13
Thanks for the response. Yes, I can go with custom integration. However, I fail to understand why my other button on the page where there is Stripe Checkout JS is integrated is not posting to server just like normal asp.net button. Why even that is opening the payment pop-up? Stripe JS should only bind with the input created by it i.e. Pay With Card button...
– Milind Thakkar
Nov 12 at 13:13
Huh, I haven't seen that behavior before when integrating Stripe --- another button on the page opening a Stripe Checkout simple integration. If you're seeing that could be worth emailing a link or example code to Stripe.
– duck
Nov 12 at 17:32
Huh, I haven't seen that behavior before when integrating Stripe --- another button on the page opening a Stripe Checkout simple integration. If you're seeing that could be worth emailing a link or example code to Stripe.
– duck
Nov 12 at 17:32
Thanks, will write to stripe support.
– Milind Thakkar
Nov 12 at 19:11
Thanks, will write to stripe support.
– Milind Thakkar
Nov 12 at 19:11
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53251856%2fstripe-simple-checkout-integration-with-cancel-button%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown