Skip to content

I get an error approving Android in-app subscriptions #1692

Description

@Serkan-Karacelikler

My php code:

$packageName = "some packageName";
$productId = "some productId ";
$token = "some token here";

require 'vendor/autoload.php';
$client = new \Google_Client();
$client->setAuthConfig('ts.json');
$client->addScope('https://www.googleapis.com/auth/androidpublisher');
$service = new \Google_Service_AndroidPublisher($client);

$postBody = "test";
$para = "test";

$purchase = $service->purchases_subscriptions->acknowledge($packageName, $productId, $token,$postBody,$para);

//echo json_encode($purchase);

Error:

Fatal error: Uncaught TypeError: Argument 4 passed to Google_Service_AndroidPublisher_Resource_PurchasesSubscriptions::acknowledge() must be an instance of Google_Service_AndroidPublisher_SubscriptionPurchasesAcknowledgeRequest, string given, called in /home/serkanka/public_html/dgr/onayla.php on line 17 and defined in /home/serkanka/public_html/dgr/vendor/google/apiclient-services/src/Google/Service/AndroidPublisher/Resource/PurchasesSubscriptions.php:40 Stack trace: #0 /home/serkanka/public_html/dgr/onayla.php(17): Google_Service_AndroidPublisher_Resource_PurchasesSubscriptions->acknowledge('com.text.spec.s...', 'com.text.spec.s...', 'jlkehndmfjoaenc...', 'test', 'test') #1 {main} thrown in /home/serkanka/public_html/dgr/vendor/google/apiclient-services/src/Google/Service/AndroidPublisher/Resource/PurchasesSubscriptions.php on line 40

Metadata

Metadata

Labels

type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions