Files
Payme-Shopify-Integration/app/services/payme_checkout.py
Abdulaziz Axmadaliyev 92165edbe6 Initial commit
2026-02-26 16:35:47 +05:00

15 lines
379 B
Python

import base64
import json
from app.core.config import settings
def generate_payme_checkout_url(order_id: int, amount: str):
data = {
"m": settings.PAYME_MERCHANT_ID,
"ac.order": str(order_id),
"a": int(float(amount) * 100),
}
encoded = base64.b64encode(json.dumps(data).encode()).decode()
return f"https://checkout.paycom.uz/{encoded}"