-
Set up COINBASE_API_KEY and COINBASE_API_SECRET for 3 environmensts
- Will call it at config/initializers/coinbase.rb
-
Set up SECRET_TOKEN_APP for app - 3 environments
- To help verify callback for app
- Can set SECRET_TOKEN_APP at pays_controller to filter action callback
-
Set up callback_url, success_url, cancel_url for 3 enviroments
- Do same thing with step 1 or 2
- And go to pays_controller.rb to updated for them follow ENV['...']
- Create button with option data
- See more details https://www.coinbase.com/api/doc/1.0/buttons/create.html
-
Need to recheck
- Please see more details "Example Callbacks" https://www.coinbase.com/docs/merchant_tools/callbacks
Some case need check : Order Callback Example - Payout Callback Example .
-
Callback when payment is successful - pay_callback
- Step 1 will be filter by SECRET_TOKEN_APP
- Recheck status of payment: completed, mispaid, expired. Not doing when expired.
- When status is completed or mispaid - save data to Payment
- May be need to recheck for one case Payout Callback Example. Please see this link for more deatils https://www.coinbase.com/docs/merchant_tools/callbacks
-
Callback when payment is cancel - pay_cancel
.....