Skip to main content

A helper class/SDK to enable developers easily integrate Paga Collect API

Project description

Paga Collect Python library

The Paga Collect API allows anyone to initiate a payment request to a third party and automatically get notified when the payment request is fulfilled. This library makes it easier and faster for developers to integrate the API

1. Installation

Make sure you have pip installed, then run the command below

pip install paga-collect

2. Usage

Once installed to use the library see sample code below:

from paga_collect import Collect;

principal = "public_key"
credentials = "private"
hash_key = "hash_key"

collect = Collect(principal, credentials, hash_key, False)

Paga Collect API Operations

Now that you have created a collect api object you easily call its operations


Request Payment

Register a new request for payment between a payer and a payee. Once a payment request is initiated successfully, the payer is notified by the platform (this can be suppressed) and can proceed to authorize/execute the payment. Once the payment is fulfilled, a notification is sent to the supplied callback URL. See the callback notification section for more details.
To make a payment request see sample code below:

payment_request_payload = {
    "referenceNumber": "6020000011z",
    "amount": "100",
    "currency": "NGN",
    "payer": {
        "name": "John Doe",
        "phoneNumber": "07033333333",
        "bankId": "3E94C4BC-6F9A-442F-8F1A-8214478D5D86"
    },
    "payee": {
        "name": "Payee Tom",
        "accountNumber": "1188767464",
        "bankId": "40090E2F-7446-4217-9345-7BBAB7043C4C",
        "bankAccountNumber": "0000000000",
        "financialIdentificationNumber": "03595843212"
    },
    "expiryDateTimeUTC": "2021-05-27T00:00:00",
    "isSuppressMessages": "true",
    "payerCollectionFeeShare": "0.5",
    "recipientCollectionFeeShare": "0.5",
    "isAllowPartialPayments": "true",
    "callBackUrl": "http://localhost:9091/test-callback",
    "paymentMethods": ["BANK_TRANSFER", "FUNDING_USSD"]
}

response = collect.payment_request(payment_request_payload)

Register Persistent Payment Account

An operation for business to create Persistent Payment Account Numbers that can be assigned to their customers for payment collection.
To create a persistent payment account see sample code below:

register_persistent_payment_account_payload = {
    "referenceNumber": "test123451",
    "phoneNumber": "07022222222",
    "accountName": "Joh Doe",
    "firstName": "John",
    "lastName": "Doe",
    "email": "john@doe.com",
    "accountReference": "22222222222220",
    "financialIdentificationNumber": "22182799077",
    "callbackUrl": "http://localhost:9091/test-callback"
}

response = collect.register_persistent_payment_account(register_persistent_payment_account_payload)

Query Status

Query the current status of a submitted request
To check the status of a submitted request see sample code below:

status_payload = {"referenceNumber": "82000001109", }

response = collect.get_status(status_payload)

Query History

Get payment requests for a period between given start and end dates. The period window should not exceed 1 month.
See sample code below:

history_payload = {
    "referenceNumber": "82000001109",
    "startDateTimeUTC" : "2021-05-13T19:15:22",
    "endDateTimeUTC" : "2021-05-20T19:15:22"
}

response = collect.get_history(history_payload)

Get Banks

Retrieve a list of supported banks and their complementary unique ids on the bank. This is required for populating the payer (optional) and payee objects in the payment request model.
See usage sample code below:

banks_payload = {"referenceNumber": "0001109"}

response = collect.get_banks(status_payload)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paga-collect-1.0.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

paga_collect-1.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file paga-collect-1.0.1.tar.gz.

File metadata

  • Download URL: paga-collect-1.0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for paga-collect-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5a1fbbe442e60185ab42aefe2b27eb9cbe2df041b06bcbd654bb41c08d922d15
MD5 847f08944652fc420d894b8beb061e92
BLAKE2b-256 77867b717ec308a4843b8cff847dfab54391eba7c6d7e23ff96e48389e977f9b

See more details on using hashes here.

File details

Details for the file paga_collect-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: paga_collect-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for paga_collect-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51979fc65c13d41bbdcf15007f0bdb2c3808936f18345669597ba61af8cc41ad
MD5 661449ec696d20cb3212af4ef1b7957f
BLAKE2b-256 5d99231535849ceeadca1a7375d90f060f098bead4fa9b29f4cb4d3373247af3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page