意外错误 Braintree (ECONNREFUSED)

问题描述

在本地计算机 (Win 10 x64) 上使用用于 Nodejs (v14.15.0) 的 Braintree sdk 时出现此错误。

enter image description here

这是最小的代码:

private constructor(merchantId: string,publicKey: string,privateKey: string,env?: braintree.Environment) {
    this._gateway = new braintree.BraintreeGateway({
        merchantId,publicKey,privateKey,environment: env
    });
}

async CreateCustomer(firstName: string,lastName: string,email: string): Promise<BraintreeCreateCustomerResponse> {
    let data = await this._gateway.customer.create({
        firstName,lastName,email
    });
    return { Id: data.customer.id };
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)