Skip to main content

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

Metadata

Release files for saweriaqris 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for saweriaqris 0.2.1
File Size Uploaded
saweriaqris-0.2.1.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for saweriaqris 0.2.1
File Interpreter ABI Platform
saweriaqris-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / saweriaqris-0.2.1.tar.gz

Download URL saweriaqris-0.2.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9adef15be45935591fd9a082b0b60d63c0d02864a3d6cbafb8c97b2bf608450d
BLAKE2b-256 checksum
How to use checksums
704434c484e4fb0afedab802b3067d1d017024cdade3545599f3da3496aef9eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / saweriaqris-0.2.1-py3-none-any.whl

Download URL saweriaqris-0.2.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d2c23f6d784e34b41ca7588c0c9885b6a7db65b3c7ebf17bb8514062c3a36f5
BLAKE2b-256 checksum
How to use checksums
3cfc8443e8a1057567bb4adfb689fb7e9dfa7540c3189a0a0075ccb7ddcd2714
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page