Skip to main content

Smartpay SDK Python

Project description

Smartpay Python SDK

The Smartpay Python SDK offers easy access to Smartpay API from applications written in Python.

Prerequisites

Python v3+

Installation

pip install --save smartpay

Usage

The package needs to be configured with your own API keys, you can find them on your dashboard.

from smartpay import Smartpay

smartpay = Smartpay('<YOUR_SECRET_KEY>', public_key='<YOUR_PUBLIC_KEY>');

If you would like to know how Smartpay payment works, please see the payment flow for more details.

Create Checkout session

payload = {
  items: [
    {
      name: "レブロン 18 LOW",
      amount: 250,
      currency: "JPY",
      quantity: 1,
    },
  ],

  shipping: {
    line1: "line1",
    locality: "locality",
    postalCode: "123",
    country: "JP",
  },

  # Your internal reference of the order
  reference: "order_ref_1234567",

  # Callback URLs
  successUrl: "https://docs.smartpay.co/example-pages/checkout-successful",
  cancelUrl: "https://docs.smartpay.co/example-pages/checkout-canceled",

  test: true,
};

session = smartpay.create_checkout_session(payload);

To retreive the session URL

sessionURL = smartpay.get_session_url(session);

We also prepare a more real-world example for you to refer to.

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

smartpay-0.8.1.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

smartpay-0.8.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file smartpay-0.8.1.tar.gz.

File metadata

  • Download URL: smartpay-0.8.1.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.16

File hashes

Hashes for smartpay-0.8.1.tar.gz
Algorithm Hash digest
SHA256 8e251389304b099404e1bdfd83e7090846638806e82b7ecbd2175f19863b241b
MD5 c1766ac1bc8ec9e4986067a903456eca
BLAKE2b-256 a0510d82672ab576baf8c08b112988eaebabde6ca71e83522356efebe9d43ce1

See more details on using hashes here.

File details

Details for the file smartpay-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: smartpay-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.16

File hashes

Hashes for smartpay-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ed1d50457992b15a3345c6f14955bc0a6e86600206ae61ede95a1fd3c89568c7
MD5 2f329517aa050db8e799892a4fba0c13
BLAKE2b-256 11e89ea09c4b5a608fe962741eea6e1e3e0ced04de71a2f6ccdd4210f4f385d7

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