Skip to content
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

Open
wants to merge 3 commits into
base: CLEAN-65/payment-gateway-apis
Choose a base branch
from

Conversation

Mikmik28
Copy link
Collaborator

Tickets

Changes

  • [x]
  • [ ]

Testing Instructions

Screenshots

@Mikmik28 Mikmik28 self-assigned this Jan 14, 2025
Comment on lines +237 to +239
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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need to figure out the best way to fill out these three fields. The data we receive from the payment device doesn't have the data to fill them out.

from the payment device, these are the data that we receive:
image

Copy link
Contributor

@PaoloLlenado PaoloLlenado Jan 23, 2025

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 the amount is the price 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
Copy link
Collaborator Author

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?

Copy link
Contributor

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

Copy link
Contributor

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

@Mikmik28 Mikmik28 requested a review from PaoloLlenado January 14, 2025 10:53
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
Copy link
Collaborator Author

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

Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants