Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
The simplest way to install SDK is to use PIP:
pip install paymentsgate
from paymentsgate import ApiClient, Credentials, Currencies
# minimal configuration
config = Credentials().fromFile('/path/to/credentials.json');
# create ApiClient
client = ApiClient(config, baseUrl='https://api.example.com');
# request quote
res = cli.Quote(
{
"amount": 10.10,
"currency_from": Currencies.EUR,
"currency_to": Currencies.AZN,
}
)
print(res);
The credentials.json
file is used to connect to the client and contains all necessary data to use the API. This file can be obtained in your personal cabinet, in the service accounts section. Follow the instructions in the documentation to issue new keys. If you already have keys, but you don't feel comfortable storing them in a file, you can use client initialization via variables. In this case, the key data can be stored in external storage instead of on the file system:
from paymentsgate import ApiClient, Credentials
config = Credentials(
account_id="00000000-4000-4000-0000-00000000000a"
public_key="LS0tLS1CRUdJTiBSU0EgUFJJVkFUNSUlFb3dJQk..."
)
client = ApiClient(config, baseUrl='https://api.example.com');
...
*It is important to note that the data format for key transfer is base46.
res = cli.PayIn(
{
"amount": 10.10,
"currency": Currencies.AZN,
"invoiceId": "INVOICE-112123124",
"clientId": "",
"successUrl": "https://example.com/success",
"failUrl": "https://example.com/fail",
"type": InvoiceTypes.m10
}
)
print(res);
res = cli.PayOut(
{
"amount": 5.12,
"currencyTo": Currencies.EUR,
"invoiceId": "INVOICE-112123124",
"clientId": "CLIENT-003010023004",
"baseCurrency": CurrencyTypes.fiat,
"feesStrategy": FeesStrategy.add,
"recipient": {
"account_number": "4000000000000012",
"account_owner": "CARD HOLDER",
"type": CredentialsTypes.card
}
}
)
print(res);
try:
res = cli.PayOut(
{
"amount": 5.12,
"currencyTo": Currencies.EUR,
"invoiceId": "INVOICE-112123124",
"clientId": "CLIENT-003010023004",
"baseCurrency": CurrencyTypes.fiat,
"feesStrategy": FeesStrategy.add,
"recipient": {
"account_number": "4000000000000012",
"account_owner": "CARD HOLDER",
"type": CredentialsTypes.card
}
}
)
print(res);
except APIAuthenticationError as err:
print(f"Authentication fail: {err.message}")
except APIResponseError as err:
print(f"Exception: {err.error}; Message: {err.message}")
FAQs
PaymentsGate's Python SDK for REST API
We found that paymentsgate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.