PHP code example of sn01615 / google-iap-php

1. Go to this page and download the library: Download sn01615/google-iap-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sn01615 / google-iap-php example snippets



use sn01615\iap\google\Verify;

tPublicKey设置public key,然后输入data和sign,返回验证结果
$vv = $cc->setPublicKey('key')->verify('data', 'signature');

# Returns 1 if the signature is correct, 0 if it is incorrect, and -1 on error.
# 如果$vv 等于1代表成功 0 代表失败 -1 表示错误
var_dump($vv);

bash
composer