fix: update production app configuration
This commit is contained in:
@@ -82,10 +82,8 @@ class _FakeVerifier:
|
||||
*,
|
||||
expected_bundle_id: str,
|
||||
expected_product_id: str,
|
||||
expected_environment: str,
|
||||
) -> VerifiedTransaction | VerificationError:
|
||||
del signed_transaction_info, expected_bundle_id, expected_product_id
|
||||
del expected_environment
|
||||
return self._result
|
||||
|
||||
|
||||
@@ -290,6 +288,32 @@ class TestPaymentServiceSuccessfulGrant:
|
||||
assert len(points_repo.appended_ledger) == 1
|
||||
assert len(payment_repo.inserted_transactions) == 1
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_grants_production_transaction_from_verified_payload(self) -> None:
|
||||
payment_repo = _FakePaymentRepository()
|
||||
service = PaymentService(
|
||||
payment_repo=payment_repo,
|
||||
points_repo=_FakePointsRepository(),
|
||||
verifier=_FakeVerifier(
|
||||
result=_make_verified_transaction(environment="Production")
|
||||
),
|
||||
)
|
||||
request = VerifyTransactionRequest(
|
||||
productCode="starter_pack",
|
||||
appStoreProductId="com.meeyao.qianwen.starter_pack",
|
||||
transactionId="2000000123456789",
|
||||
signedTransactionInfo="fake_jws",
|
||||
)
|
||||
|
||||
result = await service.verify_and_grant(
|
||||
user_id=uuid4(),
|
||||
user_email="test@example.com",
|
||||
request=request,
|
||||
)
|
||||
|
||||
assert result.status == "granted"
|
||||
assert payment_repo.inserted_transactions[0].environment == "Production"
|
||||
|
||||
|
||||
class TestPaymentServiceStarterPackIneligible:
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user