Initial commit
This commit is contained in:
15
app/services/payme_checkout.py
Normal file
15
app/services/payme_checkout.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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}"
|
||||
Reference in New Issue
Block a user