Alexander Santiago
Alexander Santiago

Reputation: 61

check if it has already been paid or not, from coinbase commerce

receive a payment by API and check if it has already been paid or not, from coinbase commerce,

I already consume the coinbase commerce API I only need to check if it has been paid or not from my client side. I just need to check if the transaction has been completed successfully or if it has failed

Upvotes: 0

Views: 472

Answers (1)

shn
shn

Reputation: 875

I recommend you use the webhooks to trigger a request back to your server. These webhooks can be configured to run on any successful payment, and you can create an endpoint on your server to check whether the payment has been completed and process it accordingly.

The flow could be as shown below:

  1. Payment created by customer (save payment in your system as pending)
  2. Coinbase Commerce makes webhook request to your server on payment update. a. Verify that payment is actually pending b. Check back with Coinbase Commerce API to make sure payment way completed c. Mark payment as completed in your system
  3. Perform task within your system now that payment is completed.

This is an example as to how you could safely check that a payment is completed.

Upvotes: 0

Related Questions