PayIsland Python SDK
Official Python SDK for integrating with PayIsland payment APIs.
Installation
pip install payisland
Initialization
from payisland import PayIsland
payisland = PayIsland(secret_key="test_xxx")
The SDK uses https://ags.payislands.com by default. Sandbox or live mode is
determined by the API key you provide; there is no separate environment flag in
the SDK.
Transaction Initialization
from payisland import PayIsland
payisland = PayIsland(secret_key="test_xxx")
response = payisland.transactions.initialize(
{
"callback_url": "https://example.com/webhooks/payislands",
"payment_item_id": "6",
"transaction_reference": "order_12345",
"channel": "card",
"amount": "1000",
"customer_info": {
"email": "ada@example.com",
"phone_number": "08011112222",
"first_name": "Ada",
"last_name": "Lovelace",
},
}
)
print(response["data"]["authorization_url"])
For card transactions, the customer may need to complete 3DS authentication after initialization. Treat the transaction as pending until you verify the transaction reference and receive a successful final status from PayIsland.
Transaction Verification
response = payisland.transactions.verify("order_12345")
print(response)
This calls:
GET /api/v1/transactions/in/check-transaction-status/{reference}
Webhook Verification
is_valid = payisland.webhooks.verify_signature(
payload=raw_payload,
signature=signature,
secret=webhook_secret,
)
Webhook signatures are verified using HMAC SHA256 and constant-time comparison. Always verify the webhook signature and verify the transaction reference before fulfilling an order.
Error Handling
API errors raise PayIslandAPIError and include the status code and response
body when available.
from payisland import PayIsland, PayIslandAPIError
payisland = PayIsland(secret_key="test_xxx")
try:
response = payisland.transactions.verify("order_12345")
except PayIslandAPIError as exc:
print(exc.message)
print(exc.status_code)
print(exc.response_data)
Development
python -m pip install -e ".[dev]"
pytest
ruff check .
python -m build
twine check dist/*
License
MIT
Metadata
Release files for payisland 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| payisland-0.1.0.tar.gz | 7.4 kB | Without provenance | Details for payisland-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| payisland-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for payisland-0.1.0-py3-none-any.whl |
Total release size: 14.5 kB
Release files / payisland-0.1.0.tar.gz
| Download URL | payisland-0.1.0.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
500a0c79172d966ace0a5e03e52b83f5c288260ed2f3e18b807cc3dd54be3775
|
|
BLAKE2b-256 checksum How to use checksums |
411a92da3c28b172f348bfc0963ba24f6cfce6f64ebaff67ac185c8a7af88d4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / payisland-0.1.0-py3-none-any.whl
| Download URL | payisland-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06b0125be7a506a0e46516fa0f11594b459369de876943ad8728d553ac34aafa
|
|
BLAKE2b-256 checksum How to use checksums |
ddaf5979b66c8db4c6f200ca1dd92aab6a6ae0ec1f4b096de070b6791474a444
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for payisland 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.