0

I'd like to learn how to allow end users on my website to pay for goods using cryptocurrency.

Questions I have:

1 - How would I confirm the transaction has been received ?
2 - How would I confirm the value of the transaction is correct ?
3 - Are there any API's I could use to achieve what I'm looking for ?
4 - If I had to refund a user how would I do this ?

1

To check payment: you can use blockchain api to do so: https://blockchain.info/q

which is

https://blockchain.info/q/getreceivedbyaddress/[BITCOIN ADDRESS]?confirmations=6

confirmations can be any but minimum 6 is recommended

to accept bitcoin, I suggest u host a bitcoin core and use something like Easy Bitcoin PHP Library to do so

0

How would I confirm the transaction has been received ?

How would I confirm the value of the transaction is correct ?

There are two ways:

  1. Set up and run your own full somecoin* node, and write a payment module for your site\store to interact with it. That module should provide a way to query info about a transaction, request an address for payments and so on.

* somecoin - bitcoin or any altcoin

Are there any API's I could use to achieve what I'm looking for ?

  1. You can use third-party service. They're owning full-nodes and provides API. You can create payment module on top of that API.

If I had to refund a user how would I do this ?

It's depend on the payment module realization, you need a method to create a refund transaction to the user address.

0

You can use the insticce.com api. There is no sign up required. Use it to generate unique addresses for your website. It will hit a callback url of your choice when payment is received.

It also forwards all payments immediately to a forwarding address of your choice. You have the option to wait for a confirmation before getting notified if you want.

If you accept zero conf you will not only be notified but also receive the payment at your forwarding address within seconds of the customer hitting "send".

It works on testnet, mainnet and uses cashaddr format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.