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

Trying to validate a Google Play Subscription it return an error: subscriptionInvalidArgument #167

Closed
MichSimi opened this issue Sep 27, 2022 · 6 comments

Comments

@MichSimi
Copy link

Validating a subscription in test with validateSubscription() return an error "subscriptionInvalidArgument" with message "Your request is invalid for this subscription purchase".

Scope: https://www.googleapis.com/auth/androidpublisher

$response = $validator->setPackageName($packageName) ->setValidationModePurchase(false) ->setProductId($productId) ->setPurchaseToken($purchaseToken) ->validateSubscription();

The verification of a single purchase (validatePurchase) of the same application is ok

@Stafox
Copy link
Collaborator

Stafox commented Sep 30, 2022

Usually it means that you're trying to validation non-subscription purchase.

Could you share more details about the product? Maybe a screenshot from Google Play Console of the page with that product?

@MichSimi
Copy link
Author

The product that i'm trying to validate is a subscription, i'm sure, i have also some single product purchases in the same application so i know that the productId in the response is a valid subscription.
If i try to "acknowledge" the purchase i have an other error: The product purchase is not owned by the user.

@MichSimi
Copy link
Author

MichSimi commented Oct 18, 2022

Any idea? Still having the same error trying to validate a test subscription.
In your example you do not use "acknowledge" the subscription, is "validateSubscription" enough or it use internally the acknowledge at some point?

@Stafox
Copy link
Collaborator

Stafox commented Oct 18, 2022

The product purchase is not owned by the user.
It means you're trying to acknowledge subscription that was acknowledged before (maybe on client side).

By default acknowledge functionality does not used in validation process.

@MichSimi
Copy link
Author

I was able to validate the subscription by creating a function that uses v2 subscriptions service. There is the code:

public function validateSubscriptionV2() { return new SubscriptionResponse( $this->_androidPublisherService->purchases_subscriptionsv2->get( $this->_package_name, $this->_purchase_token ) ); }

@Stafox
Copy link
Collaborator

Stafox commented Oct 18, 2022

@MichSimi what version of billing do you use in application? Version 5?

Related to #161

@Stafox Stafox closed this as completed Nov 7, 2023
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