Skip to main content

Official Python SDK for the 0Gate ramp API. Stripe-style ergonomics — secret keys, sessions, signed webhooks.

Project description

@0bit/gate

Unified official SDK for the 0Gate ramp API — Node server, browser embed, React components, and Python.

Renamed from @0bit/0gate (npm) / 0bit-0gate (PyPI). Install the new names below.

Install

Surface Command
Node (server) npm install @0bit/gate
Browser (bundler) npm install @0bit/gateimport { GateRamp } from '@0bit/gate/browser'
React npm install @0bit/gateimport { RampCheckout } from '@0bit/gate/react'
Python pip install 0bit-gatefrom zerobit.gate import GateClient

Python framework extras

pip install "0bit-gate[django]"
pip install "0bit-gate[fastapi]"
pip install "0bit-gate[flask]"

Quick start — Node

import { GateClient } from '@0bit/gate';

const client = new GateClient({ apiKey: process.env.GATE_KEY! });

const session = await client.sessions.create({
   amount: '100.00',
   currency: 'EUR',
   return_url: 'https://myapp.example/done',
});

console.log(session.client_secret);

Quick start — Browser

import { GateRamp } from '@0bit/gate/browser';

const ramp = new GateRamp({
   publishableKey: 'pk_test_...',
   clientSecret: session.client_secret,
});
await ramp.mount('#gate-container');

CDN (IIFE):

<script src="https://cdn.jsdelivr.net/npm/@0bit/gate/dist/browser/0gate.iife.js"></script>
<script>
  const ramp = new GateJS.GateRamp({ publishableKey: 'pk_test_...', clientSecret: 'gsec_...' });
  ramp.mount('#container');
</script>

Quick start — React

import { RampCheckout } from '@0bit/gate/react';

<RampCheckout
   publishableKey={import.meta.env.VITE_GATE_KEY}
   clientSecret={session.client_secret}
   onSuccess={({ txId }) => router.push('/done')}
/>

Quick start — Python

from zerobit.gate import GateClient

client = GateClient(api_key="sk_test_...")
session = client.sessions.create({
    "amount": "100.00",
    "currency": "EUR",
    "return_url": "https://myapp.example/done",
})
print(session["client_secret"])

SDK naming policy

Surface 0Gate Future products
npm @0bit/gate @0bit/0pools, @0bit/0base
PyPI 0bit-gate 0bit-0pools, 0bit-0base
Python import zerobit.gate zerobit.pools, zerobit.base

Development

cd 0Bit_apps/0Gate/0Gate_Sdk
npm ci && npm run build && npm test
pip install -e ".[dev,django,fastapi,flask]"
pytest

License

MIT. Part of the 0Bit / 0Gate ramp platform.

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

0bit_gate-0.1.4.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

0bit_gate-0.1.4-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file 0bit_gate-0.1.4.tar.gz.

File metadata

  • Download URL: 0bit_gate-0.1.4.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for 0bit_gate-0.1.4.tar.gz
Algorithm Hash digest
SHA256 63deae9b20ce712c8288112294fd1fc75fef04177f6abf63a2e3d0c87b994744
MD5 1f16d460e9e5e500a5330814edabb877
BLAKE2b-256 a3218272c0dfc4cae9a4fee487c6f5dcfed0527f0616b3cfad71df6bbaac3140

See more details on using hashes here.

Provenance

The following attestation bundles were made for 0bit_gate-0.1.4.tar.gz:

Publisher: publish-0bit-sdks.yml on 0Bit-org/0bit_core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file 0bit_gate-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: 0bit_gate-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for 0bit_gate-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d5e1dbb43ba2c08d6316185b08750acbffeaf3933547fca0b2babb38bf3f0b4a
MD5 84a26e48a3d1ee3cd4bae0543821e546
BLAKE2b-256 eac0195043cd29af003fe4377c5149535fff7b8895c49e1f2c0b47a19d504b7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for 0bit_gate-0.1.4-py3-none-any.whl:

Publisher: publish-0bit-sdks.yml on 0Bit-org/0bit_core

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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