alxmsl/

appstoreclient

用于iTunes购买收据验证的应用商店客户端

v1.2.3 2015-12-14 15:17 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:47:35 UTC


README

用于iTunes购买收据验证的应用商店客户端

安装

要完全安装库,您需要包含require配置

"alxmsl/appstoreclient": "1.1.0"

自动续订订阅收据验证

use alxmsl\AppStore\Client;
use alxmsl\AppStore\Exception\ExpiredSubscriptionException;

/**
 * Define needed constants
 */
const PASSWORD = 'secredsharedpassword',
      SANDBOX = true,
      RECEIPT = 'MySECReT5u8sCR1Pti0NRece1Pt=';

// Create App Store client for production or sandbox
$AppStore = new Client();
$AppStore->setPassword(PASSWORD)
    ->setSandbox(SANDBOX);

// Verify subscription receipt
try {
    var_dump($AppStore->verifyReceipt(RECEIPT));
} catch (ExpiredSubscriptionException $ex) {
    var_dump($ex->getStatus());
}

购买收据验证

use alxmsl\AppStore\Client;

/**
 * Define needed constants
 */
const SANDBOX = true,
      RECEIPT = 'MySECReTRece1Pt=';

// Create App Store client for production or sandbox
$AppStore = new Client();
$AppStore->setSandbox(SANDBOX);

// Verify purchase receipt
var_dump($AppStore->verifyReceipt(RECEIPT));