Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS expired subscription verification return VerificationFailure #32

Open
catacs opened this issue Jan 15, 2019 · 0 comments
Open

IOS expired subscription verification return VerificationFailure #32

catacs opened this issue Jan 15, 2019 · 0 comments
Assignees

Comments

@catacs
Copy link

catacs commented Jan 15, 2019

When a user cancel a subscription and from server side I check the subscription later, I get VerificationFailure with code 21006 and message:

This receipt is valid but the subscription has expired. When this status code is returned to your server, the receipt data is also decoded and returned as part of the response.

The message is self explanatory, the subscription data should be parsed from the response. The result must contains a Receipt when call verify method and ReceiptCollection for verify_subscription method.

Changes must be done in the valid? method from class CandyCheck::AppStore::Verification and CandyCheck::AppStore::SubscriptionVerification in the same overridden method, valid?. It should allow to parse the response for code 21006 and not only for STATUS_OK = 0

Posible solution for CandyCheck::AppStore::Verification:

module CandyCheck
  module AppStore
    # Verifies a receipt block against a verification server.
    # The call return either an {Receipt} or a {VerificationFailure}
    class Verification
      STATUS_EXPIRED = 21006

      private

      def valid?
        @response && (@response['status'] == STATUS_OK || @response['status'] == STATUS_EXPIRED) && @response['receipt']
      end
    end
  end
end
@catacs catacs changed the title IOS expired subscription verification got VerificationFailure IOS expired subscription verification return VerificationFailure Jan 15, 2019
@jnbt jnbt self-assigned this May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants