Package: bitmast-paystack
Bitmast PayStackA PayStack payment Solution implemented in pythonThe PyPayStack API is a python implementation of the PayStack payment gateway,www.paystack.co. See developer's documentationhere. The current edition is built to
support transaction in Naira.
The driving goal of this project remains to have an easy to integrate payment solution for python based projects.MotivationThe existing implementation of PayStack API in python supports a subset of the payment gateway features. Support
for features such as BVN (Bank Verification Number) verification and many other features are not readily available
. Furthermore, the use of Python's language rich object model is not largely adopted. In a bid of meeting this
need, PyPayStack has been designed and built to allow developers focus on business application logic while the
payment of their application or online service remain the major concern of PyPayStack. Aside this, most online
resource of the PayStack gateway were written for PHP with a lot of plugins for PHP based web frameworks like
WordPress, Magento, PrestaShop etc. The PyPayStack was designed to be a simple framework that can be
integrated with Python based frameworks such as Django, Flask etc.DescriptionPyPayStack is built to provide one primary service: process online payment in Nigeria e-commerce space using the
PayStack payment gateway without need for detail understanding of PayStack payment system. Such knowledge is
beneficial but not mandatory while using PyPayStack.Some of the key innovative feature of the design is support for the features of PayStack gateway in an intuitive
manner. Others include:Use of design patterns for meeting key programming needs that will simplify code base and make for easy
application testing. Example, all PayStack API request can be executed as a callable objects which are implemented using the
Command Design Pattern. Hence, to initiate a PayStack Transaction, simply follow the steps:# Initiate a payment transactionfrompaystack.utilimportBusinessDataObjectfrompaystack.transactionimportinitialize_transaction,verify_transaction# Create business data object from HTTP Request with validated form fieldstransaction_object_from_request=BusinessDataObject(**kwargs)initialize=initialize_transaction(transaction_instance=transaction_object_from_request)server_response=initialize()ifserver_response:# do workpass# Verify a payment transaction# Create business data object from HTTP Request with validated form fieldstransaction_object_from_server=BusinessDataObject(**kwargs)verify=verify_transaction(transaction_instance=transaction_object_from_server)verify_server_response=verify()All callable functions are implemented as Command object which wraps a function for executing given command. This
function can be dynamically updated or replaced with any other function/lambda expression by the developer.Data across layers are passed by a mapping object (BusinessDataObject) which is immutable ensuring that
transaction data is not wrongly manipulated or altered unintentionally by application calls. This dictionary like
object can be parsed into JSON or other format for rendering.Application features are grouped into processes with related/subprocesses being under the same categories. Example all subaccount features can be accessed through thepaystack.subaccountpackage.Application specific requirement and account details can be managed from a centralized configuration system. This will enable developers extend the project for their peculiar needs.Application features are grouped into processes with related/subprocesses being under the same categories. Example
all subaccount features can be accessed through thepaystack.subaccountpackage.Application specific requirement and account details of the merchant can be managed from a centralized configuration
system. This will enable developers extend the project for their peculiar needs.Rich set of data validation is provided for every request object/data being passed to the PayStack api. Furthermore, the default REGEX patterns and data validation can be replaced by the developer to suit their target  need. It is believed, however, that default validators meets the requirements for most online cases.Aparserpackage is provided with the alpha edition. This package is considered secondary as responses from the
server can be converted into BusinessDataObject or passed along to calling function for further processing.Integration with a communication and database layer can be achieved using the Mediator Design Pattern. This will
enable system
send information to third party application using a single channel or given interface. Default Mediator
implementation is available in thetoolkitpackage.All HTTP requests are made through the PythonrequestsAPI. See documentationherefor more information.DependenciesThe PyPayStack requirestoolkitwhich can be downloadedhereThe target Python language for current implmentation is Python 3.6.8Build StatusVersion: 0.1.0Current development of PyPayStack is version 0.1.0. This is considered the Alpha Edition. Future releases will
support export of application data to communication interface to enable information exchange between payment systems.FeaturesSupport PayStack features includes:Initialize TransactionVerify TransactionList TransactionsFetch TransactionChange AuthorizationView Transaction TimelineTransaction TotalsExport TransactionsRequest ReauthorizationCheck AuthorizationCreate CustomerList CustomersFetch CustomerUpdate CustomerCustomer Access ControlDeactivate AuthorizationCreate SubaccountList SubaccountsFetch SubaccountUpdate SubaccountCreate PlanList PlansFetch PlanUpdate PlanCreate SubscriptionList SubscriptionsFetch SubscriptionDisable SubscriptionEnable SubscriptionCreate ProductList ProductsFetch ProductUpdate ProductCreate PageList PagesFetch PageUpdate PageCheck Slug AvailabilityAdd ProductsCreate InvoiceList InvoicesView InvoiceVerify InvoiceSend NotificationInvoice MetricsFinalize DraftFetch InvoiceUpdate InvoiceArchive InvoiceMark As PaidFetch SettlementsCreate Transfer RecipientList Transfer RecipientsUpdate Transfer RecipientDelete Transfer RecipientInitiate TransferList TransfersFetch TransferFinalize TransferInitiate Bulk TransferCheck BalanceResend Transfer OtpDisable Otp RequirementFinalize Disabling OtpEnable Otp RequirementInitiate Bulk ChargeList Bulk ChargesFetch Bulk Charge BatchFetch Bulk Charges In BatchPause Bulk Charge BatchResume Bulk Charge BatchFetch Payment Session TimeoutUpdate Payment Session TimeoutChargeSubmit PINSubmit OTPSubmit PhoneSubmit BirthdayCheck Pending ChargeCreate RefundList RefundsFetch RefundResolve BVNBvn MatchResolve Account NumberResolve Card BINResolve Phone NumberList BanksSample UsagePyPayStack is designed to provide support for all PayStack gateway feature. It can also be adopted to provide full
financial services like payment settlement etc. for various business model. This tool does ot provide accounting
packages or financial asset management etc. It simply does one core thing: process and management payment as
prescribed by PayStack.Sample test run:
Initiating TransactionContributingPlease visit application repo for further information on extending project. Ideas and comments will be reasonably
appreciated.AuthorCurrent development is by Aniefiok Friday@frier17.LicenseApache LicenseVersion 2.0, January 2004http://www.apache.org/licenses/For details read license contracthereCopyright 2019 @frier17Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.