Giter Club home page Giter Club logo

hbl_card_payment's Introduction

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 hbl_card_payment.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"
  ]
)

hbl_card_payment's People

Contributors

suzanpradhan avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.