add default org

This commit is contained in:
2026-01-20 14:39:57 -03:00
parent d88c84146c
commit b3e60aea65
11 changed files with 65 additions and 17 deletions

View File

@@ -101,6 +101,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
key=KeyPair(order_id, 'TRANSACTION#STATS'),
update_expr='SET #count = if_not_exists(#count, :zero) + :one, \
last_attempt_succeeded = :succeeded, \
created_at = if_not_exists(created_at, :now), \
updated_at = :now',
expr_attr_names={
'#count': 'payment_attempts',
@@ -109,7 +110,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
':succeeded': charge['success'],
':zero': 0,
':one': 1,
':now': now(),
':now': now_,
},
)

View File

@@ -87,9 +87,6 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
)
if 'credit_card' in r:
transact.delete(
key=KeyPair(order_id, 'CREDIT_CARD#PAYMENT_INTENT'),
)
transact.put(
item={
'id': order_id,
@@ -102,6 +99,9 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
},
cond_expr='attribute_not_exists(sk)',
)
transact.delete(
key=KeyPair(order_id, 'CREDIT_CARD#PAYMENT_INTENT'),
)
if test_mode:
transact.put(