Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nasa.NebPay对象自带的方法不能调试测试网~ #10

Open
smallke opened this issue Jul 4, 2018 · 4 comments
Open

Nasa.NebPay对象自带的方法不能调试测试网~ #10

smallke opened this issue Jul 4, 2018 · 4 comments

Comments

@smallke
Copy link

smallke commented Jul 4, 2018

现在碰到一个在 testnet 遇见的 bug :
Nasa.NebPay 的原型中的 pay 和 queryPayInfo 等方法没有测试网的配置选项,在测试的时候不是很方便,希望和官方的文档保持一致.

我现在的解决方法是:
自己定义callback的 url ,区分开是在测试网还是在主网,官方是通过配置 debug 选项来区分的.

let nbp = new Nasa.NebPay();
window.NasaUrl = Nasa.env.get() !== "mainnet" ? "https://pay.nebulas.io/api/pay" : "https://pay.nebulas.io/api/mainnet/pay";
nbp.pay("n1MikYAYZTB9MRaVZy4Bg47RMxABiYLiET7", "0.01", {
  goods: {
    name: "打赏用户",
    desc: "打赏用户0.01NAS"
  },
  callback: NasaUrl
});
@smallke smallke changed the title Nasa.NebPay对象自带的方法希望和官方的保持一致 Nasa.NebPay对象自带的方法不能调试测试网~ Jul 4, 2018
@smallke
Copy link
Author

smallke commented Jul 4, 2018

毕竟是转账, 假如本地测试环境给别人转账用的是主网配置, 转账成功之后会很悲催~

@cssmagic
Copy link
Member

cssmagic commented Jul 6, 2018

好的,收到。稍后找你细聊。

@cssmagic
Copy link
Member

cssmagic commented Jul 13, 2018

明白你意思了。nebPay 从 v0.2 开始增加了 debug 选项。

稍后 Nasa.js 会升级内置的 nebPay 版本(从 v0.1.0 到 v0.2.x)。

@cssmagic
Copy link
Member

cssmagic commented Jul 13, 2018

谢谢反馈。不过我就不把这视为 bug 了哈。

0.5 NAS 奖金已送上! 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants