Receipt is null (Amazon Appstore DevTest for IAP)

I have the following case:

I set up Amazon Appstore DevTest for IAP

Subscriptions from the store come and user data comes. I use useIapProductData and useIapUserData hooks from the package
@amzn/keplerscript-appstore-iap-lib.

However, when I want to subscribe, I get this response

{
    "receipt": null,
    "requestId": {
        "requestIdStr": "85a27696-e268-4681"
    },
    "responseCode": 4,
    "userData": {
        "userId": "EK8u",
        "marketplace": "FR",
        "lwaConsentStatus": 1,
        "userProfileAccessConsentStatus": 1
    }
}

Here is my part of the code

export const startPurchase = createAppAsyncThunk<
  void,
  { productId: string; variantId: string }
>(
  'iap/startPurchase',
  async ({ productId, variantId }, { dispatch, rejectWithValue }) => {
    try {
      dispatch(setPurchaseFlowStart({ productId }));
      console.log('πŸš€ ~ productId:', productId);

      let raw: PurchaseResponse;
      try {
        raw = await PurchasingService.purchase({
          sku: productId,
        });
      } catch (error) {
        console.log('πŸš€ ~ error:', error);
        throw error;
      }
      console.log('πŸš€ ~ raw:', raw);

      const res = await IAPSDKResponseHandler.handlePurchaseResponse(raw);
      console.log('πŸš€ ~ res:', res);

    } catch (e: unknown) {
      console.log('πŸš€ ~ startPurchase e:', e);
      const messageKey = IAP_GENERIC_ERROR;
      dispatch(setPurchaseFlowError({ error: messageKey }));
      return rejectWithValue({ code: 'PURCHASE_EXCEPTION', messageKey });
    }
  },
);

Please tell me why this can happen?

I have the same issue
cc @Vitalii_Rurenko

add @jogashu for visibility .

Hey @Yevhenii_Borisevich and @Viktor_Kravchuk

Please give me some time to check this issue and come back to you with a response.

Warm Regards,
Ivy

Hi @Yevhenii_Borisevich and @Viktor_Kravchuk

Could you guys check which version of @amzn/keplerscript-appstore-iap-lib you are using?
If possible can you upgrade to the latest version of this API and check again?

Warm regards,
Ivy

@Ivy_Mahajan I have upgrated β€œ@amzn/keplerscript-appstore-iap-lib”: β€œ2.12.13”,
Then I can see the same β€œreceipt”: null,

Understood @Viktor_Kravchuk , let me look into this in more depth.

Warm regards,
Ivy

1 Like

@Ivy_Mahajan FYI Threre are my logs filtered by [AmazonIAPSDK]

console-1763555607377.log (1.1 ΠšΠ‘)

Thanks @Viktor_Kravchuk for the logs.

Can we also get journalctl logs to check the issue further ?

Also, we have seen similar issue is past and it was resolved by adding the AppstoreAuthenticationKey.pem file for the receipt verification to succeed.
Could you please confirm if you have this config?
You can follow steps here.

Let me know if this works.

Warm regards,
Ivy

Thanks @Ivy_Mahajan for clarification. I have saved the AppstoreAuthenticationKey.pem file. Then pasted it into the assests/raw folder.
However the same response β€œreceipt”: null.
But I tested on the debug mode and I made signature my build

kepler exec vpt push --signature ./cert/tmp/updated_digest.sig ./build/armv7-debug/firetv_armv7.vpkg

There is my journalctl
Terminal Saved Output.txt (4.4 ΠœΠ‘)

Maybe I will see different responce on the LAT? Or should be the same response on LAT and debug mode?

Understood @Viktor_Kravchuk I’ll check with internal teams about your question.
In the meantime, please share journalctl logs for us to look into this in more depth.

Warm regards,
Ivy

Hi @Viktor_Kravchuk

We have noticed from your logs, a loop getting created to verify the purchase, which fails after 14 attempts.
In order to look into this issue more in depth, please share logs for the full E2E purchase.
That would help us help you better.

Warm regards,
Ivy

@Viktor_Kravchuk

Please share logs for the full E2E purchase so that we can look into your issue.

Warm regards,
Ivy