rajsekar
rajsekar

Reputation: 79

How to call ResolveCustomer and GetEntitlements from aws-marketplace in PHP?

I am using PHP Laravel, I can find PHP SDK, But I can't find any examples.

I need to call ResolveCustomer (produces a token for the product and user) and GetEntitlements (gives a list of rights for the product and the user).

Has anyone used this service?

Upvotes: 1

Views: 334

Answers (1)

Rashad Aliyev
Rashad Aliyev

Reputation: 57

I write this code works.

<?php
require 'aws/aws-autoloader.php';

use Aws\AwsClient;
use Aws\Credentials\Credentials;
use Aws\MarketplaceMetering;

$config = [
    'credentials'  => new Credentials('key', 'secret'),
    'region'       => 'us-east-1',
    'version'      => 'latest'
];
$client = new MarketplaceMetering\MarketplaceMeteringClient($config);
$x_amzn_marketplace_token = 'token';

$result = $client->resolveCustomer(['RegistrationToken' => $x_amzn_marketplace_token]);

echo "<pre>";
print_r($result);

Upvotes: 2

Related Questions