bantupay-sdk


Namebantupay-sdk JSON
Version 0.0.10 PyPI version JSON
download
home_pagehttps://github.com/bantublockchain/bantupay-sdk-python
SummaryBantuPay SDK
upload_time2021-04-14 15:01:29
maintainer
docs_urlNone
authorBantu Blockchain Foundation
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # BantuPay SDK

## Installation

Using pip to include bantupay-sdk in your own project:

```shell
 $ pip install bantupay-sdk

```

## Getting started

### Use the following code to create key pair.

```python
from bantupay_sdk import account

keyPair = account() # keyPair will now contain this structure {secret: '', publicKey: ''}
```

### Use the folowing code to sign http data

```python
from bantupay_sdk import signHttp

httpSign = signHttp(
  uri='/v2/user/',
  body='{username: "proxie"}',
  secretKey'SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI'
); # Secret key gotten from the create account method.
```

### Use this to Sign a transaction

```python
from bantupay_sdk import signTxn

signTxn = bantuSDK.signTxn(
  secretKey="SDBG73M4LPCPCQ6NQ4CP4LCF7MOOQGUFJRRBD26P6QKIHW2ESP5R7DDN",
  transactionXDR="AAAAAOKtdgWGQ02FzacmAD1WhAhI5Dp7kPRojOGjNQj3FBWvAAAAZAAcmBgAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAANQmFudHUuTmV0d29yawAAAAAAAAAAAAAAAAAAAA==",
  networkPhrase="Bantu Testnet"
);
```

# To make payment

> The expressPay method is designed for making payments from bots or any other API like bulk payment engines, that does not need any userfeedback

---

```python
from bantupay_sdk import expressPay

# Example for making XBN payment
# Please NOTE: - if you are making payment to Bantu's naitive assest you  MUST leave assetCode and assetIssuer empty, your request will look like this.

expressPay(
    username="proxie",
    destination="long",
    memo="Test 0",
    amount="1",
    secretKey="SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI",
    baseURL="https://api.bantupay.org" # or https://api-alpha.dev.bantupay.org for testnet
)


# Let's make a BNR payment
# for mainnet, BNR issuer is GARO4SCJCPO4QPW27EZQBDV5KY4GXXBH6FOLUQ73K73VC4NP5PGBANTU,
# for testnet BNR issuer is GBNRQ56XX4JA3HKXP7EACLLXYPHCYCWBWOQZYSPGUIJSR5JSAD22EZXG
# Please ensure that you use the right issuer
expressPay(
    username="proxie",
    destination="long",
    memo="Test 0",
    amount="1",
    secretKey="SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI",
    baseURL="https://api.bantupay.org" # or https://api-alpha.dev.bantupay.org for testnet
    assetIssuer="GARO4SCJCPO4QPW27EZQBDV5KY4GXXBH6FOLUQ73K73VC4NP5PGBANTU"
    assetCode="BNR"
    )
```

### Another way to make payment

```python
from bantupay_sdk import confirmPaymentDetail, makePayment

firstCall = confirmPaymentDetail(
    username="proxie",
    destination="long",
    memo="Test 0",
    amount="1",
    secretKey="SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI",
    baseURL="https://api.bantupay.org" # or https://api-alpha.dev.bantupay.org for testnet
)
data = firstCall.json() # to extract json data from the  response.
```

## Note!

> Pass the response of the first call in to the makePayment function.

> confirmPayment will return the respnse gotten from the server, this contains, firstName, lastName, destinationThumbnail, which can be used in stuff like your mobile apps and the likes, networkPhrase, transaction which will be returned in the makePayment and lastly message with will contain info like extra fees or charges that may acrue.

---

```python

if data.status_code == 202: # all is right, you can move on to the next step

  payment = makePayment(
    username="proxie",
    serverResponse=firstCall,
    secretKey="SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI",
    baseURL="https://api.bantupay.org" # or https://api-alpha.dev.bantupay.org for testnet
  )
else:
  # handle payment here.
  pass

# Let's make a BNR payment
# for mainnet, BNR issuer is GARO4SCJCPO4QPW27EZQBDV5KY4GXXBH6FOLUQ73K73VC4NP5PGBANTU,
# for testnet BNR issuer is GBNRQ56XX4JA3HKXP7EACLLXYPHCYCWBWOQZYSPGUIJSR5JSAD22EZXG
# Please ensure that you use the right issuer

firstCall = confirmPaymentDetail(
    username="proxie",
    destination="long",
    memo="Test 0",
    amount="1",
    secretKey="SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI",
    baseURL="https://api.bantupay.org" # or https://api-alpha.dev.bantupay.org for testnet
    assetIssuer="GARO4SCJCPO4QPW27EZQBDV5KY4GXXBH6FOLUQ73K73VC4NP5PGBANTU"
    assetCode="BNR"
)

data = firstCall.json()

# If all is well, your status code will 200, then pass the response of the first call in to the makePayment function
if data.status_code == 202:
  payment = makePayment(
    username="proxie",
    serverResponse=firstCall,
    secretKey="SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI",
    baseURL="https://api.bantupay.org" # or https://api-alpha.dev.bantupay.org for testnet
  )
else:
  # handle your errors here
  print(data)

```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bantublockchain/bantupay-sdk-python",
    "name": "bantupay-sdk",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Bantu Blockchain Foundation",
    "author_email": "adevops@bantufoundation.org",
    "download_url": "https://files.pythonhosted.org/packages/92/e1/9eb904b70b618848e46311488ab59d5c9714282696151b92fd304da24060/bantupay-sdk-0.0.10.tar.gz",
    "platform": "",
    "description": "# BantuPay SDK\n\n## Installation\n\nUsing pip to include bantupay-sdk in your own project:\n\n```shell\n $ pip install bantupay-sdk\n\n```\n\n## Getting started\n\n### Use the following code to create key pair.\n\n```python\nfrom bantupay_sdk import account\n\nkeyPair = account() # keyPair will now contain this structure {secret: '', publicKey: ''}\n```\n\n### Use the folowing code to sign http data\n\n```python\nfrom bantupay_sdk import signHttp\n\nhttpSign = signHttp(\n  uri='/v2/user/',\n  body='{username: \"proxie\"}',\n  secretKey'SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI'\n); # Secret key gotten from the create account method.\n```\n\n### Use this to Sign a transaction\n\n```python\nfrom bantupay_sdk import signTxn\n\nsignTxn = bantuSDK.signTxn(\n  secretKey=\"SDBG73M4LPCPCQ6NQ4CP4LCF7MOOQGUFJRRBD26P6QKIHW2ESP5R7DDN\",\n  transactionXDR=\"AAAAAOKtdgWGQ02FzacmAD1WhAhI5Dp7kPRojOGjNQj3FBWvAAAAZAAcmBgAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAANQmFudHUuTmV0d29yawAAAAAAAAAAAAAAAAAAAA==\",\n  networkPhrase=\"Bantu Testnet\"\n);\n```\n\n# To make payment\n\n> The expressPay method is designed for making payments from bots or any other API like bulk payment engines, that does not need any userfeedback\n\n---\n\n```python\nfrom bantupay_sdk import expressPay\n\n# Example for making XBN payment\n# Please NOTE: - if you are making payment to Bantu's naitive assest you  MUST leave assetCode and assetIssuer empty, your request will look like this.\n\nexpressPay(\n    username=\"proxie\",\n    destination=\"long\",\n    memo=\"Test 0\",\n    amount=\"1\",\n    secretKey=\"SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI\",\n    baseURL=\"https://api.bantupay.org\" # or https://api-alpha.dev.bantupay.org for testnet\n)\n\n\n# Let's make a BNR payment\n# for mainnet, BNR issuer is GARO4SCJCPO4QPW27EZQBDV5KY4GXXBH6FOLUQ73K73VC4NP5PGBANTU,\n# for testnet BNR issuer is GBNRQ56XX4JA3HKXP7EACLLXYPHCYCWBWOQZYSPGUIJSR5JSAD22EZXG\n# Please ensure that you use the right issuer\nexpressPay(\n    username=\"proxie\",\n    destination=\"long\",\n    memo=\"Test 0\",\n    amount=\"1\",\n    secretKey=\"SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI\",\n    baseURL=\"https://api.bantupay.org\" # or https://api-alpha.dev.bantupay.org for testnet\n    assetIssuer=\"GARO4SCJCPO4QPW27EZQBDV5KY4GXXBH6FOLUQ73K73VC4NP5PGBANTU\"\n    assetCode=\"BNR\"\n    )\n```\n\n### Another way to make payment\n\n```python\nfrom bantupay_sdk import confirmPaymentDetail, makePayment\n\nfirstCall = confirmPaymentDetail(\n    username=\"proxie\",\n    destination=\"long\",\n    memo=\"Test 0\",\n    amount=\"1\",\n    secretKey=\"SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI\",\n    baseURL=\"https://api.bantupay.org\" # or https://api-alpha.dev.bantupay.org for testnet\n)\ndata = firstCall.json() # to extract json data from the  response.\n```\n\n## Note!\n\n> Pass the response of the first call in to the makePayment function.\n\n> confirmPayment will return the respnse gotten from the server, this contains, firstName, lastName, destinationThumbnail, which can be used in stuff like your mobile apps and the likes, networkPhrase, transaction which will be returned in the makePayment and lastly message with will contain info like extra fees or charges that may acrue.\n\n---\n\n```python\n\nif data.status_code == 202: # all is right, you can move on to the next step\n\n  payment = makePayment(\n    username=\"proxie\",\n    serverResponse=firstCall,\n    secretKey=\"SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI\",\n    baseURL=\"https://api.bantupay.org\" # or https://api-alpha.dev.bantupay.org for testnet\n  )\nelse:\n  # handle payment here.\n  pass\n\n# Let's make a BNR payment\n# for mainnet, BNR issuer is GARO4SCJCPO4QPW27EZQBDV5KY4GXXBH6FOLUQ73K73VC4NP5PGBANTU,\n# for testnet BNR issuer is GBNRQ56XX4JA3HKXP7EACLLXYPHCYCWBWOQZYSPGUIJSR5JSAD22EZXG\n# Please ensure that you use the right issuer\n\nfirstCall = confirmPaymentDetail(\n    username=\"proxie\",\n    destination=\"long\",\n    memo=\"Test 0\",\n    amount=\"1\",\n    secretKey=\"SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI\",\n    baseURL=\"https://api.bantupay.org\" # or https://api-alpha.dev.bantupay.org for testnet\n    assetIssuer=\"GARO4SCJCPO4QPW27EZQBDV5KY4GXXBH6FOLUQ73K73VC4NP5PGBANTU\"\n    assetCode=\"BNR\"\n)\n\ndata = firstCall.json()\n\n# If all is well, your status code will 200, then pass the response of the first call in to the makePayment function\nif data.status_code == 202:\n  payment = makePayment(\n    username=\"proxie\",\n    serverResponse=firstCall,\n    secretKey=\"SBVNK4S2NU2QSBDZBKQCGR7DX5FTQFDJVKGWVCZLIEOV4QMANLQYSLNI\",\n    baseURL=\"https://api.bantupay.org\" # or https://api-alpha.dev.bantupay.org for testnet\n  )\nelse:\n  # handle your errors here\n  print(data)\n\n```\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "BantuPay SDK",
    "version": "0.0.10",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "720eb553e685ac9cb243acd08eaeede3",
                "sha256": "31ede9b759f51a28c8ab3f1a7e17b70747451170dcc611df143682b4dbdbc01d"
            },
            "downloads": -1,
            "filename": "bantupay_sdk-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "720eb553e685ac9cb243acd08eaeede3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 5041,
            "upload_time": "2021-04-14T15:01:27",
            "upload_time_iso_8601": "2021-04-14T15:01:27.628919Z",
            "url": "https://files.pythonhosted.org/packages/38/10/335cd67c5a9ea6707e0a4eb793ae66ed956aa38f67e6e7756610d6288dd2/bantupay_sdk-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "2153265d62286117141c052682cf73af",
                "sha256": "dcf2bad8dfe024abe072f9a86240cda8eea9f3c53d897a0e15fb772bd0a7fca8"
            },
            "downloads": -1,
            "filename": "bantupay-sdk-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "2153265d62286117141c052682cf73af",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 5625,
            "upload_time": "2021-04-14T15:01:29",
            "upload_time_iso_8601": "2021-04-14T15:01:29.016053Z",
            "url": "https://files.pythonhosted.org/packages/92/e1/9eb904b70b618848e46311488ab59d5c9714282696151b92fd304da24060/bantupay-sdk-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-04-14 15:01:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "bantublockchain",
    "error": "Could not fetch GitHub repository",
    "lcname": "bantupay-sdk"
}
        
Elapsed time: 0.39979s