You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes our users get impatient when they're paying for their leagues and click the "Pay" button twice, which causes them to pay for the league twice. We should probably approach this from a two angles.
On the front-end, we should try to prevent this from happening in the first place, see here for some info on how others have solved this problem.
Our back-end code should try to ensure that it is only executing a payment once.
Payment front-end can be found in the Registration Controller's Pay view, while processing code can be found in the Payments Controller.
To get this working in a local environment, you'll need a Braintree sandbox account. Those keys can be placed in the .env file, like so:
braintree_environment: development
braintree_merchant_id: MERCHANT_ID_HERE
braintree_public_key: PUB_KEY_HERE
braintree_private_key: PRIVATE_KEY_HERE
braintree_cse_key: HUGE_LONG_CSE_KEY_HERE
The text was updated successfully, but these errors were encountered:
toomuchpete
changed the title
Keep people from clicking "pay" twice
Prevent double-submission of a payment form
Jan 14, 2017
A recent commit added an order_id to the payments controller, thereby making it much more difficult to double-pay, but we'll still want to make sure double-clicking doesn't cause problems.
For example, if a user double-clicks, does their payment go through (because of the first click), but then get shown an error because of the last one?
Sometimes our users get impatient when they're paying for their leagues and click the "Pay" button twice, which causes them to pay for the league twice. We should probably approach this from a two angles.
Payment front-end can be found in the Registration Controller's Pay view, while processing code can be found in the Payments Controller.
To get this working in a local environment, you'll need a Braintree sandbox account. Those keys can be placed in the
.env
file, like so:The text was updated successfully, but these errors were encountered: