我已经在 PHP 中设置了 bitpay API,我创建了一个商家令牌。出于测试目的,我设置了比特币核心测试网钱包。但是当我创建支付以将比特币发送到我的测试网钱包时,我给了我一个例外“这个端点不支持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;
}
但是,当我进行支付时,它给了我例外。