Skip to content
This repository has been archived by the owner on Apr 29, 2023. It is now read-only.

TelePay-cash/telepay-java

Repository files navigation

Java SDK for the TelePay API

TelePay Python

Official TelePay client library for the Python language, so you can easily process cryptocurrency payments using the REST API.

License: MIT Last commit GitHub commit activity Github Stars Github Forks Github Watchers GitHub contributors Telegram Blog

Installation

Coming soon (Installation with Maven or Graddle): For now copy the .jar file and import it to your project

Dependencies

The SDK has 2 dependencies of the libraries:

  • java.net.http
  • org.json

Using the library

Initialize the TelePay client using your secret API key, located in your merchant dashboard.

TelePayClient client = new TelePayClient(YOUR_SECRET_KEY);

Get your current merchant Read docs

JSONObject me = client.getMe();
System.out.println(me);

Get your balance Read docs

JSONObject balance = client.getBalance();
System.out.println(balance);

Get the assets Get assets supported by TelePay. Read docs

JSONObject assets = client.getAssets();
System.out.println(assets);

Get invoices Get the merchant's invoices. Read docs

JSONObject invoices = client.getInvoices();
System.out.println(invoices);

Get invoice You can also get a single invoice in particular by invoice number Read docs

String invoiceNumber = "75";
JSONObject invoice = client.getInvoice();
System.out.println(invoice);

Get webhooks Get the merchant's webhooks. Read docs

JSONObject webhooks = client.getWebhooks();
System.out.println(webhook);

Get webhook You can also get a single webhook in particular and its details passing the Webhook ID Read docs

String webhookId = "T45A7810";
JSONObject invoice = client.getWebhook(webhookId);
System.out.println(invoice);

Get balance Get the balance of an specific asset of the merchant Read docs

String asset = "TON";
String blockchain = "TON";
String network = "mainnet";
JSONObject balance = client.getBalance(asset, blockchain, network);
System.out.println(balance);

Create Invoice Create an new invoice with an specified amount Read docs

String asset = "TON";
String blockchain = "TON";
String network = "mainnet";
double amount = 10;
JSONObject invoice = client.createInvoice(asset, blockchain, network, amount);
System.out.println(invoice);

Delete Invoice Delete an invoice Read docs

String invoiceNumber
JSONObject delete = client.deleteInvoice(invoiceNumber);
System.out.println(delete);

Cancel Invoice Cancel an invoice Read docs

String invoiceNumber
JSONObject cancel = client.cancelInvoice(invoiceNumber);
System.out.println(delete);

Transfer Transfer funds between wallets Read docs

String asset = "TON";
String blockchain = "TON";
String network = "mainnet";
double amount = 10;
String username = "jrgf"
JSONObject transfer = client.transfer(asset, blockchain, network, amount, transfer);
System.out.println(transfer);

Run the tests

We use JUnit to test the API endpoints before publishing new versions of this library. To run the tests, you must define the TELEPAY_SECRET_API_KEY environment variable in your IDE before running the LibraryTest class.

Contributors ✨


José Rafael García

💻

Carlos Lugones

🧑‍🏫

This project follows the all-contributors specification. Contributions of any kind welcome!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages