-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
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