我已经在PHP中设置了bitpay API,我创建了一个商家令牌。为了测试目的,我已经设置了比特币核心测试网钱包。但是当我创建支付以将比特币发送到我的testnet钱包时,我给了我一个例外,“这个端点不支持merchant
门面”。我创建密钥的代码
$storageEngine = new \Bitpay\Storage\EncryptedFilesystemStorage('mypassword');
$privateKey = $storageEngine->load('bitpay.pri');
$publicKey = $storageEngine->load('bitpay.pub');
$client = new \Bitpay\Client\Client();
$network = new \Bitpay\Network\Testnet();
$adapter = new \Bitpay\Client\Adapter\CurlAdapter();
$client->setPrivateKey($privateKey);
$client->setPublicKey($publicKey);
$client->setNetwork($network);
$client->setAdapter($adapter);
$sin = \Bitpay\SinKey::create()->setPublicKey($publicKey)->generate();
try {
$token = $client->createToken(
array(
'facade' => 'merchant',
'label' => 'Demo',
'id' => (string) $sin,
)
);
$pairingCode = $token->getPairingCode();
$createdToken = $token->getToken();
$this->ci->dashboard->addSettings('bit_token', $createdToken);
echo $pairingCode;
} catch (\Exception $e) {
return $response;
}
但是当我为支付提供支持时,它会让我例外。