Skip to content

Commit

Permalink
Update message to send SKU by platform
Browse files Browse the repository at this point in the history
  • Loading branch information
U-lis committed Aug 1, 2024
1 parent 632f29e commit 986018f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions iap/api/purchase.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ def request_product(receipt_data: ReceiptSchema,
"agent_addr": receipt.agent_addr,
"avatar_addr": receipt.avatar_addr,
"planet_id": receipt_data.planetId.decode(),
"package_name": receipt.package_name,
}))
logger.info(f"Voucher message: {resp['MessageId']}")

Expand Down
9 changes: 7 additions & 2 deletions worker/worker/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from common import logger
from common._crypto import Account
from common._graphql import GQL
from common.enums import TxStatus
from common.enums import TxStatus, PackageName
from common.models.product import Product
from common.models.receipt import Receipt
from common.utils.actions import create_unload_my_garages_action_plain_value
Expand Down Expand Up @@ -106,7 +106,12 @@ def process(sess: Session, message: SQSMessageRecord, nonce: int = None) -> Tupl
planet_id: PlanetID = PlanetID(bytes(message.body["planet_id"], 'utf-8'))
agent_address = message.body.get("agent_addr")
avatar_address = message.body.get("avatar_addr")
memo = json.dumps({"iap": {"g_sku": product.google_sku, "a_sku": product.apple_sku}})
package_name = PackageName(message.body.get("package_name"))
memo = json.dumps({"iap":
{"g_sku": product.google_sku,
"a_sku": product.apple_sku_k if package_name == PackageName.NINE_CHRONICLES_K
else product.apple_sku}
})
# Through bridge
if planet_id != CURRENT_PLANET:
agent_address = planet_dict[planet_id]["agent"]
Expand Down

0 comments on commit 986018f

Please sign in to comment.