Skip to main content

A simple implementation of HBL card payment integration in Python.

Project description

HBL Card Payment

Implementation of HBL PACO Core APIs for Card Payment with jose request.

APIs included:
✅ Payment
❌ Inquiry
❌ Void request
❌ Settlement
❌ Refund

Requirements

To get started, hit the 'clear' button at the top of the editor!

  • Python 3.x
  • Dependencies: PyJWT, requests, python-jose

Installation

You can install the package via pip:

pip install hbl-card-payment

Usage

Importing the Module

from simple_hbl_card_payment import HBLCardPayment

Initialization

Create an instance of HBLCardPayment with the required parameters:

payment = HBLCardPayment(
    merchant_id='your_merchant_id',
    api_key='your_api_key',
    encryption_key='your_encryption_key',
    callback_url='your_callback_url',
    merchant_signing_private_key='merchant_signing_private_key',
    paco_encryption_public_key='paco_encryption_public_key',
    merchant_decryption_private_key='merchant_decryption_private_key',
    paco_signing_public_key='paco_signing_public_key'
)

Making a Payment Request

Use the request method to make a payment request:

response = payment.request(
    order_no='123456789',
    product_desc='Product Description',
    amount=100.0
)

print(response)

Setting Additional Payload Values

If you need to set additional values in the request payload, use the set_value method:

payment.set_value('purchaseItems',
  [
      [
          "purchaseItemType" => "ticket",
          "referenceNo" => "2322460376026",
          "purchaseItemDescription" => "Bundled insurance",
          "purchaseItemPrice" => [
              "amountText" => "000000002000",
              "currencyCode" => "NPR",
              "decimalPlaces" => 2,
              "amount" => 1
          ],
          "subMerchantID" => "string",
          "passengerSeqNo" => 1
      ]
  ]
)

payment.set_value('customFieldList',
  [
      "fieldName" => "TestField",
      "fieldValue" => "This is test"
  ]
)

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

hbl-card-payment-0.0.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hbl_card_payment-0.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file hbl-card-payment-0.0.1.tar.gz.

File metadata

  • Download URL: hbl-card-payment-0.0.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.1

File hashes

Hashes for hbl-card-payment-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d93eb0eb9f9500511b9c3bb0d2f6b996a1134b3ff20e8e21f2dab2f15a490d39
MD5 29ffa3373a0015323bb15099f1e0a523
BLAKE2b-256 585c0ab418811ef50127ea268b384349d52bf1af86e412aa4c3b33d441c870b1

See more details on using hashes here.

File details

Details for the file hbl_card_payment-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hbl_card_payment-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc95a16da5784d17cb7371de30dfd7afd8bfafd7e223af91decc77762d8b6990
MD5 94f906a6833e268e797caee658504076
BLAKE2b-256 6520148c2c5d99dc2aa7f3474e759fa2b34fa2a31b0529addba53ede0eb5ec4c

See more details on using hashes here.

Supported by

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