首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >@philly25/react-native-paytm Paytm.Events.PAYTM_RESPONSE响应未定义

@philly25/react-native-paytm Paytm.Events.PAYTM_RESPONSE响应未定义
EN

Stack Overflow用户
提问于 2021-07-07 18:49:11
回答 2查看 28关注 0票数 0

当我使用@philly25/react-native-paytm中的代码时,我在控制台中没有定义

请帮助

代码语言:javascript
复制
  componentDidMount() {
    Paytm.addListener(Paytm.Events.PAYTM_RESPONSE, this.onPayTmResponse());
  }

  componentWillUnmount() {
    Paytm.removeListener(Paytm.Events.PAYTM_RESPONSE, this.onPayTmResponse());
  }

  onPayTmResponse = (resp) => {
    console.log("hi " + resp);  // here getting undefined
}
EN

回答 2

Stack Overflow用户

发布于 2021-07-07 18:56:39

我认为代码应该如下所示:

代码语言:javascript
复制
 componentDidMount() {
    Paytm.addListener(Paytm.Events.PAYTM_RESPONSE, this.onPayTmResponse);
  }

  componentWillUnmount() {
    Paytm.removeListener(Paytm.Events.PAYTM_RESPONSE, this.onPayTmResponse);
  }

  onPayTmResponse = (resp) => {
    console.log("hi " + resp);  // here getting undefined
  }

有关更多信息,请查看官方软件包文档。

https://github.com/opsway/react-native-paytm#readme

票数 0
EN

Stack Overflow用户

发布于 2021-07-29 08:25:00

这不是Paytm官方代码,请使用Paytm github链接上的插件。欲了解更多信息,请访问Paytm开发者门户

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68284624

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档