CoinPayments (CP)
Last updated
Was this helpful?
Last updated
Was this helpful?
This Lib make integration with in easy way.
Need to setup public and private key:
Go to this and generate new key.
Press on button "Edit Permissions" and add API Key Permissions:
Then on bot /setup
command:
/info
command:
/onInfo
command:
CoinPayments API do not have some methods. For example get balance by address, validate address, get transactions for address and etc.
Block.io is free if you do not use wallets there.
It is possible to receive payment for a temporary or permanent wallet.
Temporary wallet benefits:
Fixed amount
Can bind the payment to the ordered product
Status and checkout page
QR code for payment
one address for one payment
Permanent wallet benefits:
Any amount
One address for several payments
User can transfer funds at any time
Your IPN Secret is a string of your choosing. Recommended to be a random string of letters, numbers, and special characters.
CoinPayments will not send any IPNs unless you have an IPN Secret set.
Once more! You need input any text (random text) as IPN secret in Merchant Settings page
We use command "create_transaction" with IPN.
Yes, you can write it via Libs.CoinPayments.apiCall
method too. But there is an easier way.
/pay
/onCreatePayment
/onPaymentCompleted
This command will be executed on successful payment
Now you can receive payments
Please note: CoinPayments do not send you extra payments. CoinPayments send just email to buyer (or you) about refund for that extra.
Also no any information about such extra in CP Panel or IPN. Be careful
You can check payment status
command: /on_txn_id:
command /onIPN
You can get info from IPN. Really it is not needed in simple. Just use onPaymentCompleted option on createTransaction.
command onError
We use command "get_callback_address" with IPN.
Yes, you can write it via Libs.CoinPayments.apiCall
method too. But there is an easier way.
/createWallet
/onWalletCreate
/onIncome
command onError
Do not use same CoinPayment account for receiving and transfering funds.
Try to resend IPN - see Debuging
Also you can resend IPN by checkin "Resend" checkbox and button "Re-send checked IPN(s)"
Also it is possible make test onPaymentCompleted event. It is good if you do not want make test payment.
Also it is possible make test callTestPermanentWalletIncome event. It is good if you do not want make test payment.
It is strongly recommended to pay attention to safety when using this library.
Do not use default names for secure commands such as /onIncome
, /onPaymentCompleted
Anybody can run any command by names. So need to check that security command runned by CoinPayment Lib only!
Do not use any non official libs now.
Any lib can run command with options.
Any libs can read properties (and read your API Keys from other lib)
We have not way to protect this now. Just not use NON official libs with CP lib. Well, that now there are no such libraries
Grant only the really necessary permissions for the Api key. If yor bot do not need "create_withdrawal" or etc methods - turn theys off.
Any API commands can have errors: API errors, timeout errors, network errors, and other errors.
You need to withdraw, make deposit income only on success!
Because if you get an error, such a conclusion, replenishment of the deposit, etc. - will always be!
All CoinPayments API method available .
For example for method we need 2 commands: /info
and /onInfo
In fields you can pass all fields from CoinPayments api. Just read .
Use Block.io with CP Lib together!
See . Available in the Store.
The first step is to go to the page > Merchant Settings and set a IPN Secret.
See
Please see for details.
Since the method onPaymentCompleted
completely covers the IPN and solves the problem with
It is possible to define buyer email in fields for options ( code for command /pay )
Please see for details.
Since the method onIncome
completely covers the IPN and solves the problem with
Go to . This list must have history with completed income transaction(s)
Verify that you have
You can view IPN History by link
Read more about security