You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Support for BlockBee
- Fetch all supported cryptocurrencies and cache them
- Updated API Helper
- Added conversion endpoint
- Added support for BlockBee API Key
- Added UI for payments
- Added store application to provide examples on how to implement
- General improvements
- Fixed bugs
``coin`` is the ticker of the coin you wish to use, any of our supported coins (https://cryptapi.io/pricing/). You need to have a ``Provider`` set up for that coin.
123
+
124
+
``coin`` is the ticker of the coin you wish to use, any of our supported coins (https://cryptapi.io/cryptocurrencies/). You need to have a ``Provider`` set up for that coin.
125
+
122
126
``value`` is an integer of the value of your order, either in satoshi, litoshi, wei, piconero or IOTA
This library has a couple of helpers to help you get started
213
+
This library has a couple of helpers to help you get started. They are present in the file``utils.py``.
172
214
173
215
``cryptapi.valid_providers()``is a method that returns a list of tuples of the active providers that you can just feed into the choices of a ``form.ChoiceField``
174
216
175
-
``cryptapi.get_order_invoices(order_id)`` returns a list of ``cryptapi.models.Request`` objects of your order (you can have multiple objects for the same order if the user mistakenly initiated the payment with another coin)
217
+
``cryptapi.get_order_invoices(order_id)`` returns a list of ``cryptapi.models.Request`` objects of your order (you can have multiple objects for the same order if the user mistakenly initiated the payment with another coinorif he mistakenly didn't send the full payment)
176
218
219
+
``cryptapi.callback_url(_r, params)`` build your callback URL to provide to ``get_request``. Should be used inside a view since ``_r= request``
177
220
178
-
### Template Tags
179
-
There's also some template tags which you can import to help you with conversions and the protocols.
180
-
You just need to load ``cryptapi_helper`` on your template and use the following tags / filters:
221
+
181
222
182
-
*#### QR code (with `cryptapi.models.Request` object)
183
-
If you want the library to generate and display a clickable QR code for you, just use our `generate_qrcode_for_request`, like this:
223
+
### CryptAPI Helper
184
224
185
-
```djangotemplate
186
-
{% generate_qrcode_for_request payment_request %}
187
-
```
225
+
This is the helper responsible for the connections ot the API itself. All these functions are in the ``cryptapi.py``file.
188
226
189
-
You just need to feed it the `payment_request`object created with`invoice.request()`
227
+
``get_info(coin)`` returns the information of all cryptocurrencies or just if``coin=''``or a specific cryptocurrency if``coin='ltc'``for example. [docs](https://docs.cryptapi.io/#operation/info)
190
228
191
-
The QR code that can also be clicked on mobile devices to launch the user's wallet.
229
+
``get_supported_coins()`` returns all the support cryptocurrencies. You can consult them in this [list](https://cryptapi.io/fees/).
192
230
193
-
*#### QR code (with address, coin and value)
194
-
If you want the library to generate and display a clickable QR code for you, just use our `generate_qrcode`, like this:
231
+
``get_logs(coin, callback_url)`` returns all the callback logs related to a request. ``callback_url`` should be the callback provided to our API. [docs](https://docs.cryptapi.io/#operation/logs)
``get_qrcode(coin, address, value, size)`` returns a PNG of a QR Code with the address for payment. [docs](https://docs.cryptapi.io/tag/Bitcoin#operation/btcqrcode)
234
+
235
+
``get_conversion(origin, to, value)`` returns the converted value in the parameter ``value_coin`` to the currency you wish, FIATor Cryptocurrency.
236
+
237
+
``get_estimate(coin)`` returns the estimation of the blockchain fees for the cryptocurrency specified in the parameter ``coin``. E.g: ``get_estimate('trc20_usdt')`` [docs](https://docs.cryptapi.io/#operation/estimate)
238
+
239
+
``get_address(coin, address_out, callback_url, pending, api_key)`` requests a payment address to CryptAPI. If you don't wish to use [BlockBee](https://dash.blockbee.io/), you can leave ``api_key`` empty. [docs](https://docs.cryptapi.io/#operation/create)
199
240
200
-
It takes 3 arguments: the coin, the payment address and the value in the main denomination of the coin, and it will output a neat QR code for your page.
241
+
201
242
202
-
The QR code that can also be clicked on mobile devices to launch the user's wallet.
243
+
### How to use the QR code (with address, coin and value)
203
244
204
-
##### Example:
245
+
To generate a QR Code you must use ``get_qrcode``in your view and feed the parameters to your template. To generate a QR Code image you must place content of the API response after ``data:image/png;base64,{{qr_code}}`` so the browser generates the QR Code.
<img src="data:image/png;base64,{{ qrcode.qr_code }}"alt="Payment QR Code"/>
255
+
</a>
221
256
```
222
257
223
-
It will output: `bitcoin:1PE5U4temq1rFzseHHGE2L8smwHCyRbkx3?amount=0.001`
258
+
You can also add a value to the QR Code setting the ``value`` parameter to the value of your order (e.g ``0.2LTC``). This may not function correctly in some wallets. **Use at your own risk.**
224
259
225
-
Same arguments asforthe QR code
260
+
## What is the Store application?
226
261
227
-
*#### Helpers
262
+
We made the ``store`` application to provide you with code examples on how to implement our service. It also has the code for our suggested UI (both CSSandHTML).
228
263
229
-
``{% convert_value coin value %}`` where the coin is the coin ticker and the value is the value in satoshi, litoshi, wei orIOTA, will convert to the main coin unit.
230
264
265
+
## Help
231
266
232
-
``{{ coin|coin_name }}`` will output the properly formatted cryptocurrency name.
267
+
Need help?
268
+
Contact us @ https://cryptapi.io/contacts/
233
269
234
270
235
-
## Help
271
+
### Changelog
236
272
237
-
Need help?
238
-
Contact us @ https://cryptapi.io/contact/
273
+
#### 0.1.2
274
+
* Version bump
275
+
276
+
#### 0.1.3
277
+
* Pending transactions (through the `payment_pending` signal)
278
+
* Monero
279
+
280
+
#### 0.1.5
281
+
* Fixed bug with MySQL database varchar length limitations
282
+
* Added build payment URI tag, to help you generate payment URIs to feed into anyQR Code generator
283
+
284
+
#### 0.2.0
285
+
* Added ERC-20 token support
286
+
* Added payment QR code
287
+
* Improved documentation
288
+
* Fixed bugs
289
+
290
+
#### 0.2.7
291
+
* Added coin info helper
292
+
293
+
#### 0.3.1
294
+
* New APIURL
295
+
* New general info API
296
+
297
+
#### 0.4.0
298
+
* Support for BlockBee
299
+
* Fetch all supported cryptocurrencies and cache them
300
+
* Updated API Helper
301
+
* Added conversion endpoint
302
+
* Added support for BlockBee API Key
303
+
* Added UIfor payments
304
+
* Added store application to provide examples on how to implement
0 commit comments