You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

eversend

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eversend

Eversend Python SDK


Maintainers
1

Readme

Eversend Python SDK

PyPI version Build Status Dependencies

Python SDK for Eversend payments API

Table of Contents

  1. Installation
  2. Initialization
  3. Usage
  4. Contribution Guidelines
  5. License

Installation

$ pip install -U eversend

Initialization

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

Usage

Wallets

Get all wallets

wallets = eversendClient.Wallets.list();

Get one wallet

wallets = eversendClient.Wallets.getOne('USD');

Transactions

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"
);

Exchange

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
);

Beneficiaries

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
);

Collections

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
);

Payouts

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 represent sourceWallet (SOURCE) or destinationCurrency (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"
);

Contribution Guidelines

Contributions are welcome and encouraged. Learn more about our contribution guidelines here

License

MIT © Eversend

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc