2017 © Pedro Peláez
 

library googlewalletdigitalgoods

GoogleWalletDigitalGoods is a PHP library that helps you to use google wallet.

image

kesar/googlewalletdigitalgoods

GoogleWalletDigitalGoods is a PHP library that helps you to use google wallet.

  • Friday, March 14, 2014
  • by kesar
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

GoogleWalletDigitalGoods

A PHP library for interacting with Google Wallet for Digital Goods ., (*1)

Composer Installation

GoogleWalletDigitalGoods can be installed with Composer (http://getcomposer.org/). Add the following to your composer.json file. Composer will handle the autoloading., (*2)

{
    "require": {
        "kesar/googlewalletdigitalgoods": "dev-master"
    }
}

Usage

use \GoogleWalletDigitalGoods\SellerInfo;
use \GoogleWalletDigitalGoods\Payload;
use \GoogleWalletDigitalGoods\JWT;

$payload = new Payload();
$payload->setIssuedAt(time());
$payload->setExpiration(time() + 3600);
$payload->addProperty("name", "Piece of Cake");
$payload->addProperty(
    "description",
    "Virtual chocolate cake to fill your virtual tummy"
);
$payload->addProperty("price", "10.50");
$payload->addProperty("currencyCode", "USD");
$payload->addProperty(
    "sellerData",
    "user_id:1224245,offer_code:3098576987,affiliate:aksdfbovu9j"
);

// Creating payload of the product.
$Token = $payload->createPayload(SellerInfo::$issuerId);

// Encoding payload into JWT format.
$jwtToken = JWT::encode($Token, SellerInfo::$secretKey);

Testing

To test the library itself, run the PHPUnit tests:, (*3)

phpunit --configuration phpunit.xml.dist

The Versions

14/03 2014

dev-master

9999999-dev

GoogleWalletDigitalGoods is a PHP library that helps you to use google wallet.

  Sources   Download

MIT

The Requires

  • php >=5.3.3

 

google wallet goods