🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

northstart-sdk

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

northstart-sdk

Python client and payment helpers for the Northstar API

pipPyPI
Version
0.2.2
Weekly downloads
0
Maintainers
1
Weekly downloads
 

northstart-sdk

Python client and payment helpers for the Northstar API.

Install

python -m pip install northstart-sdk

API client

from northstart_sdk import NorthstarClient

client = NorthstarClient(
    base_url="https://api.example.com",
    sdk_secret="your-sdk-secret",
)

for asset in client.list_assets(status="active"):
    print(asset.id, asset.name)

sdk_secret may also be provided through the NORTHSTAR_SDK_SECRET environment variable. When no secret is configured, requests are sent without the Northstar signature headers.

Payment request

from northstart_sdk import PaymentClient

payments = PaymentClient(
    appid="your-app-id",
    app_private_key_string=open("app_private_key.pem").read(),
    gateway_public_key_string=open("gateway_public_key.pem").read(),
    gateway_url="https://gateway.example.com/gateway.do",
)

request = payments.create_payment_order(
    out_trade_no="order-1001",
    total_amount="19.99",
    subject="Example order",
)
print(request.url)

RSA2 uses RSA PKCS#1 v1.5 signatures with SHA-256. PEM keys and unwrapped base64 key bodies are both accepted.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts