Skip to main content

Nomad Broker

Project description

nomad-broker-cli

Make payments, and customs declaration for orders.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.3.3
  • Package version: 1.3.3
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python >= 3.6

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import nomad_broker_cli

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import nomad_broker_cli

Getting Started

Please follow the installation procedure and then run the following:

import time
import nomad_broker_cli
from pprint import pprint
from nomad_broker_cli.api import customs_api
from nomad_broker_cli.model.api_response import ApiResponse
from nomad_broker_cli.model.customs_request import CustomsRequest
from nomad_broker_cli.model.customs_response import CustomsResponse
from nomad_broker_cli.model.error_api_response import ErrorApiResponse
# Defining the host is optional and defaults to https://nomad.samarkand-global.cn/broker
# See configuration.py for a list of all supported configuration parameters.
configuration = nomad_broker_cli.Configuration(
    host = "https://nomad.samarkand-global.cn/broker"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: authorization
configuration.api_key['authorization'] = 'YOUR_API_KEY'

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['authorization'] = 'Bearer'


# Enter a context with an instance of the API client
with nomad_broker_cli.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = customs_api.CustomsApi(api_client)
    customs_request = CustomsRequest(
        report_id="A0987654321",
        payment_method="wechatpay",
        trx_id="TX1234567890",
        sub_order=[
            CustomsRequestSubOrder(
                sub_order_ref="O123456789S1",
                product=[
                    PayProduct(
                        name="Everyday Hair Conditioner",
                        url="https://myshop.com/everyday-hair-conditioner",
                    ),
                ],
                total_fee=1050,
                logsitics_fee=50,
            ),
        ],
    ) # CustomsRequest |  (optional)

    try:
        # PostCustoms
        api_response = api_instance.post_customs(customs_request=customs_request)
        pprint(api_response)
    except nomad_broker_cli.ApiException as e:
        print("Exception when calling CustomsApi->post_customs: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://nomad.samarkand-global.cn/broker

Class Method HTTP request Description
CustomsApi post_customs POST /declare PostCustoms
PayApi pay_post POST /pay
PaymentApi close_payment POST /payment/close/{merchant}/{order_ref} ClosePayment
PaymentApi create_payment POST /payment/{merchant} CreatePayment
PaymentApi invoke_payment POST /payment/invocation/{merchant} InvokePayment
PaymentApi query_payment GET /payment/query/{merchant}/{order_ref} QueryPayment
YouzanApi declare_order_youzan_post POST /declare-order/youzan
YouzanApi query_order_youzan_post POST /query-order/youzan

Documentation For Models

Documentation For Authorization

authorization

  • Type: API key
  • API key parameter name: app-api-key
  • Location: URL query string

Author

manwei@samarkand.global

Notes for Large OpenAPI documents

If the OpenAPI document is large, imports in nomad_broker_cli.apis and nomad_broker_cli.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1: Use specific imports for apis and models like:

  • from nomad_broker_cli.api.default_api import DefaultApi
  • from nomad_broker_cli.model.pet import Pet

Solution 1: Before importing the package, adjust the maximum recursion limit as shown below:

import sys
sys.setrecursionlimit(1500)
import nomad_broker_cli
from nomad_broker_cli.apis import *
from nomad_broker_cli.models import *

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

nomad-broker-cli-1.3.3.tar.gz (48.8 kB view details)

Uploaded Source

File details

Details for the file nomad-broker-cli-1.3.3.tar.gz.

File metadata

  • Download URL: nomad-broker-cli-1.3.3.tar.gz
  • Upload date:
  • Size: 48.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.62.3 CPython/3.6.13

File hashes

Hashes for nomad-broker-cli-1.3.3.tar.gz
Algorithm Hash digest
SHA256 ddeafbcaafe203da5d6f1a56446e1999565fec6774a565c144cf99fb02293f8e
MD5 31f61680fd76c641ea9ff37f89c56267
BLAKE2b-256 1ba9e7695ed157b7317887395289900a4aef19504d8f803ec71929a9a11d46ab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page