I am working with Python and Flask.
This is how I set the meta field the the payload before initializing a payment:
payload = {
"tx_ref": "rave-" + generate_random_string(8), # This should be a unique reference
"amount": str(amount),
"currency": "NGN",
"redirect_url": "https://trendit3.vercel.app/homepage",
"meta": {
"user_id": user_id,
"payment_type": payment_type,
},
"customer": {
"email": user_email,
"username": Trendit3_user.username,
},
}
auth_headers ={
"Authorization": "Bearer {}".format(Config.FLUTTER_SECRET_KEY),
"Content-Type": "application/json"
}
# Initialize the transaction
response = requests.post(Config.FLUTTER_INITIALIZE_URL, headers=auth_headers, data=json.dumps(payload))
response_data = response.json()
However, the response sent to my webhook doesn’t include the meta field.