月度归档:2020年06月

JavaScript function* 函数

function* 这种声明方式(function关键字后跟一个星号)会定义一个生成器函数 (generator function),它返回一个  Generator  对象。

function* generator(i) {
  yield i;
  yield i + 10;
}

const gen = generator(10);

console.log(gen.next().value);
// expected output: 10

console.log(gen.next().value);
// expected output: 20
console.log(gen.next().value);
// expected output: undefined
console.log(gen.next().value);
// expected output: undefined

iOS凭据(小票)验证库(PHP版)

ios-iap-php

iOS支付验证

install

composer require sn01615/apple-iap-php

use

use sn01615\iap\ios\Verify;

include "../vendor/autoload.php";

$cc = new Verify();

$receipt = ".."; // 凭据

$cc->endpoint(true);// 可选切,换到沙盒环境

$cc->setPassword('123');// 可选,如果是连续订阅需要密码

$vv = $cc->query($receipt);

// 打印结果
var_dump($vv);

GITHUB: https://github.com/sn01615/apple-iap-php