Skip to content

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

Description

@smallke

现在碰到一个在 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
});

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions