Skip to main content

Saweria QRIS code generator

Project description

Saweria QRIS code generator

PyPI - Version PyPI Downloads Discord GitHub License

[!CAUTION] Using any kind of automation programs on your account can result in your account getting permanently banned by Saweria. Use at your own risk.

Installation

$ pip install saweriaqris Install this package

Usage:

use this within your code example below

creating a code

from saweriaqris import create_payment_qr, paid_status

myqr = create_payment_qr("nindtz", 10000, "Budi", "budi@saweria.co", "Semangat!")
qrcode = myqr[0]
transaction_id = myqr[1]

# Just feed the qrcode to your favourite qr code generator
# transaction_id for matching purpose to your webhook calls

checking transaction status

from saweriaqris import create_payment_qr, paid_status

is_paid = paid_status(transaction_id)

# is_paid is bool value

[!Tip] Best Practice: You are supposed to use Saweria's Webhook Integration to get realtime payment notification to your API.

  1. Set your Saweria Integration to point to your API (found in Integrations -> Webhook)
  2. You issue a payment code to your client.
  3. After successful payment, Saweria will do POST request (Webhook) to your API. Below example POST from Saweria Webhook:
{
	"version": "2022.01",
	"created_at": "2021-01-01T12:00:00+00:00",
	"id": "00000000-0000-0000-0000-000000000000",
	"type": "donation",
	"amount_raw": 69420,
	"cut": 3471,
	"donator_name": "Someguy",
	"donator_email": "someguy@example.com",
	"donator_is_user": false,
	"message": "THIS IS A FAKE MESSAGE! HAVE A GOOD ONE",
	"etc": {
		"amount_to_display": 69420
	}
}
  1. Parse the JSON from the POST and challenge the id given from Saweria Webhook with the paid_status function.
  2. Only after it returns True, then you can update accordingly.

Example use case:

Discord bot Donate QRIS
image

Thank you

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

saweriaqris-0.2.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

saweriaqris-0.2.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file saweriaqris-0.2.0.tar.gz.

File metadata

  • Download URL: saweriaqris-0.2.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for saweriaqris-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e4527c59973596cccc9f280bd7ff7836b1d3cba670aec6b1216454a3c8b40602
MD5 e42837fdc3ff1b7c4fc3fea45c2a7f77
BLAKE2b-256 858a67eabcf2e2f48dafed8b9d9cd496cfceaffbc3d98a8c7da14fb04ca2f7b2

See more details on using hashes here.

File details

Details for the file saweriaqris-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: saweriaqris-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.24

File hashes

Hashes for saweriaqris-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f37eee1238e0d299dfd2f6261c77ede2e584c9299f0562acc3bab84cdb1a9353
MD5 c6390c63d255e8f3ace448e5f248f296
BLAKE2b-256 0a32014cc168b9c1a1d6613e77a8049c83db1513cc857a4e552a00ec507f6fda

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