Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Python SDK for Eversend payments API
$ pip install -U eversend
from eversend import Eversend
eversendClient = Eversend(clientId= 'clientId', clientSecret= 'clientSecret', version='v1')
wallets = eversendClient.Wallets.list();
You can get your clientId and clientSecret from the settings section in the dashboard
Get all wallets
wallets = eversendClient.Wallets.list();
Get one wallet
wallets = eversendClient.Wallets.getOne('USD');
Get all transactions
transactions = eversendClient.Transactions.list(
page = 1,
limit = 10
);
If page
and limit
are not set, the default of 1
and 10
are used respectively.
Get one transaction
transaction = eversendClient.Transactions.getOne(
transactionId= "EVS12345678"
);
To exchange from one wallet to another, you first have to generate a quotation. This returns a token with a 30s timeout that you can use to make the exchange.
Get exchange quotation
quotation = eversendClient.Exchange.getQuotation(
source = "USD",
destination = "UGX",
amount = 10.0
);
Exchange currency
exchange = eversendClient.Exchange.exchange(
token = "dhhsggajjshhdhdhd",
transactionRef = "EVS-12345678", # optional field
);
Get beneficiaries
beneficiaries = eversendClient.Beneficiaries.list(
page = 1,
limit = 10
);
If page
and limit
are not set, the default of 1
and 10
are used respectively.
Get single beneficiary
beneficiary = eversendClient.Beneficiaries.getOne(
beneficiaryId = 100
);
Create a beneficiary
beneficiary = eversendClient.Beneficiaries.create(
firstName = "John",
lastName = "Okello",
country = "UG", # Alpha-2 country code
phoneNumber = "+256712345678", # Should be in international format
bankAccountName = "John Okello",
bankAccountNumber = "12345678",
bankName = "Stanbic Bank",
bankCode = 1234 # You can get the bank code from payouts.getDeliveryBanks()
);
Note that all bank fields are optional if bank payments will not be required
Edit a beneficiary
beneficiary = eversendClient.Beneficiaries.update(
beneficiaryId = 100,
firstName = "John",
lastName = "Okello",
country = "UG", # Alpha-2 country code
phoneNumber = "+256712345678", # Should be in international format
bankAccountName = "John Okello",
bankAccountNumber = "12345678",
bankName = "Stanbic Bank",
bankCode = 1234 # You can get the bank code from payouts.getDeliveryBanks()
);
Note that all bank fields are optional if bank payments will not be required
Delete a beneficiary
eversendClient.Beneficiaries.delete(
beneficiaryId = 100
);
Get collection fees
collectionFees = eversendClient.Collections.getFees(
amount = 1000,
currency = "KES",
method = "momo"
);
Get collection OTP
Required when initiating mobile money collections
collectionOTP = eversendClient.Collections.getOTP(
phone = "+256712345678"
);
Initiate Mobile Money collection
collection = eversendClient.Collections.initiate(
method = "momo",
phone = "+256712345678",
amount = 1000,
country = "UG",
currency = "UGX",
pin = 123456, # From phone number passed in Get Collection OTP
pinId = "dg524fhsgfde", # From Get Collection OTP
transactionRef = "EVS-12345678", # Optional transaction ref generated by you
customer = { name = "John Okello" } # Optional customer object with your metadata
);
Get payout quotation
quotation = eversendClient.Payouts.getQuotation(
sourceWallet = "USD",
amount = 100,
type = "momo",
destinationCountry = "KE",
destinationCurrency = "KES",
amountType = "SOURCE", # amountType can be SOURCE or DESTINATION
);
amountType
refers to whether you want amount to representsourceWallet
(SOURCE) ordestinationCurrency
(DESTINATION)
Pay existing beneficiary
payout = eversendClient.Payouts.initiate(
beneficiaryId = 100,
quotationToken = "token",
transactionRef = "EVS-12345678" # Optional transaction ref generated by you
);
Pay new beneficiary
payout = eversendClient.Payouts.initiate(
firstName = "John",
lastName = "Okello",
country = "UG", # Alpha-2 country code
phoneNumber = "+256712345678", # Should be in international format
bankAccountName = "John Okello",
bankAccountNumber = "12345678",
bankName = "Stanbic Bank",
bankCode = 1234, # You can get the bank code from payouts.getDeliveryBanks()
quotationToken = "token",
transactionRef = "EVS-12345678" # Optional transaction ref generated by you
);
Get delivery countries
countries = eversendClient.Payouts.countries()
Get delivery banks
banks = eversendClient.Payouts.banks(
country = "UG"
);
Contributions are welcome and encouraged. Learn more about our contribution guidelines here
MIT © Eversend
FAQs
Eversend Python SDK
We found that eversend 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.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.