-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLEAN-65 / report transaction #22
base: CLEAN-65/payment-gateway-apis
Are you sure you want to change the base?
CLEAN-65 / report transaction #22
Conversation
transaction_data["product_name"] = "Sample Product" # Input Product Name here | ||
transaction_data["price"] = "1" # Input Product Price here | ||
transaction_data["quantity"] = "1" # Input Product Quantity here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to randomly query a previous order, I think we just follow the old format since there are orders already in the db
"message": "Transaction found",
"data": {
"id": 156,
"order_number": "123",
"order_date_time": "2025-01-13T12:13:00.374416Z",
"amount": "100.00",
"status": "idle",
"refund": false,
"payment_method": "wechat",
"order_person": null,
"retail_store_address": "Hong Kong, workplace",
"product_name": "Unknown",
"price": "100.00",
"quantity": 1,
"store": 4,
"vending_machine": 4
}
}
- For
product_name
, we can use the description field - For
quantity
, I think it's always going to be 1, maybe we can just make that the default value - For
price
, that seems to be the base price of the product, while theamount
is theprice x quantity
so for our purposes, price will always equal amount
# Add require field for the transaction data | ||
transaction_data["order_number"] = transaction_data["transactionNo"] | ||
transaction_data["order_date_time"] = datetime.datetime.now().isoformat() | ||
transaction_data["amount"] = transaction_data["payAmount"] # Sample amount: 000000000100 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we retain this amount format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably process it since we don't need to send it back to Kpay anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the format that they are using is string with 2 decimal places
transaction_data["order_number"] = transaction_data["transactionNo"] | ||
transaction_data["order_date_time"] = datetime.datetime.now().isoformat() | ||
transaction_data["amount"] = transaction_data["payAmount"] # Sample amount: 000000000100 | ||
transaction_data["status"] = "Completed" # ORDER STATUSES: Completed, Pending, Refunded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to discuss with the team the scenarios when the other statuses will occur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to ask KPay team for this?
Tickets
Changes
Testing Instructions
Screenshots