Python

Collecting online payments can be very easy with PayKun. You can provide multiple payment options to your customer and a great checkout experience. Also, they will get all sorts of payment option that will make them buy on the spot.

Prerequisite

Following things will be required before you can begin integration:

Installation

  1. You can download the zip file from below given link PayKun_Python_zip file

  2. Unzip the given file

  3. Set all the required credentials as follows: • From the extracted zip open the file 'paykunCheckout/views.py' • In views.py file find the method with the name 'payNow' • In 'payNow' replace all the dummy detail with real one provided from Paykun • Detail like order, customer, shipping, billing should be set by your own.

How to run the app?

  1. After extracting the downloaded zip

  2. From command line navigate to the mysite directory in extracted directory

  3. Fire command 'python manage.py runserver

  4. Now open the given URL in Browser e.g 'http://127.0.0.1:8000/' and at the end of the url add 'payNow/'

  5. Now click on Paynow button and you would see Paykun checkout page

Test your Integration (sandbox)

If you need it for testing purposes you can use our sandbox mode by sending “isLive” parameter to false.

If you need it for testing purposes you should login in Paykun dashboard using sandbox mode and get your testing merchant Id and Device API key(access token).

To test your integration in sandbox environment before going like, you can use our test environment (See how to create one) and use your test credentials, You just have to use isLive=false in your integration, You can use test card details provided here for testing purpose.

  1. Navigate to Account drop down (Top Right corner) and select "Test Mode"

  2. Select "Generate Sandbox Account" to activate your sandbox account

  3. After activating sandbox account,you can click on "Sandbox Login" button to go to sandbox dashboard and use generated username and password login.

  4. Now you have to generate your Device API key from sandbox account from Setting-Security tab.

  5. You can get you Merchant Id clicking on profile icon from top right corner.

  6. Now you have to use this API key and Merchant Id in your Demo project for testing purposes. Note: Remember that you can login in Sandbox account from your Live account.

For Live environment

If you want to do real transaction than set "isLive" parameter to true and use your Live MerchantId and AccessToken from Paykun dashboard.

License

The Paykun Python SDK is released under the MIT License.

For any Assistance

In case of any query, please contact to tech@paykun.com