iosiphonein-app-purchaseapp-store-connectauto-renewable

How to read iOS in app purchase receipt


I'm able to read the receipts for in app purchase(in sandbox). I want to validate them for auto renewable subscription. But problem is that when I read the receipt I got the same date for purchase_date and expires_date. Below is response which I got:

{
    "expires_date" = "2018-03-26 09:34:11 Etc/GMT";
    "expires_date_ms" = 1522056851000;
    "expires_date_pst" = "2018-03-26 02:34:11 America/Los_Angeles";
    "is_in_intro_offer_period" = false;
    "is_trial_period" = false;
    "original_purchase_date" = "2018-03-26 09:29:15 Etc/GMT";
    "original_purchase_date_ms" = 1522056555000;
    "original_purchase_date_pst" = "2018-03-26 02:29:15 America/Los_Angeles";
    "original_transaction_id" = 1000000385357059343435656;
    "product_id" = <product id>;
    "purchase_date" = "2018-03-26 09:29:11 Etc/GMT";
    "purchase_date_ms" = 1522056551000;
    "purchase_date_pst" = "2018-03-26 02:29:11 America/Los_Angeles";
    quantity = 1;
    "transaction_id" = 1000000385357059343435656;
    "web_order_line_item_id" = 1000000385357059343435656;
}

Please let me know if I'm doing something wrong. Any help is appreciated.

PS: Subscription is for one month and I purchased this today (i.e.26March18). So I think expires_date should be 22April2018.


Solution

  • Everything is correct: in Sandbox durations are different, so instead of 1 month you receive 5 minutes. See official docs for details: https://help.apple.com/itunes-connect/developer/#/dev7e89e149d

    Also, like @jaba-odishelashvili pointed out, you should use different URLs for verification of Sandbox/Production receipt.