Security is our top priority. This guide outlines best practices for securely integrating with the DashX platform and protecting your application and users.
# .env file
DASHX_API_KEY=your_api_key_here
DASHX_MERCHANT_ID=your_merchant_id_here
# Server-side code
import os
from dotenv import load_dotenv
load_dotenv()
api_key = os.getenv('DASHX_API_KEY')
merchant_id = os.getenv('DASHX_MERCHANT_ID')import hmac
import hashlib
def verify_webhook_signature(payload, signature, secret):
expected_signature = hmac.new(
secret.encode('utf-8'),
payload.encode('utf-8'),
hashlib.sha256
).hexdigest()
return hmac.compare_digest(signature, expected_signature)