【问题标题】:Bixby : Cannot coerce payInfo.currency to StringBixby:无法将 payInfo.currency 强制转换为字符串
【发布时间】:2020-02-05 21:06:57
【问题描述】:

我正在胶囊中实施支付系统。但是在端点的 SPS 支付方式中使用货币时出错。

payment { 
    amount (50)
    currency (payInfo.currency)
    item {
        name ("abcd")
        amount (50)
        count (1)
    }
    tax {
       amount (0)
    }
}

目前我们使用的是静态金额、物品详情等

货币结构:

enum (Currency) {
 symbol (USD)
 symbol (EUR)
 symbol (VUV)
}

PayInfo 结构:

structure (payInfo) {
  property (currency) {
     type (Currency)
     min (Optional)
     max (One)
  }
}

我使用的 Bixby 参考:

https://bixbydevelopers.com/dev/docs/dev-guide/developers/actions.payments

https://bixbydevelopers.com/dev/docs/reference/type/endpoints.action-endpoints.action-endpoint.payment-methods.sps.payment.currency

----------------------------问题2----------------- ----------------------

我们做了一个结构信息为

structure (Information){
  property (amount) {
    type (Amount)
    min (Optional)
    max (Many)
  }
  property (currency) {
    type (Currency)
    min (Optional)
    max (Many)
  }
}

将货币结构为

enum (Currency) {
  symbol (USD)
  symbol (EUR)
  symbol (VUV)
}

在 Action PaymentAction 之后,我们将结构信息定义为输入支付的类型。

action (PaymentAction) {
  type(Commit)
  collect {
    input (payInfo) {
      type (Information)
      min (Optional)
    }
  }
  output (makepayment)
}

并在训练中添加了一个话语:

[g:PaymentAction] 付款

通过这个我们的错误得到解决,但是当我们在模拟器中运行代码时,得到 Capsule Execution Error as Com.google.common.base.VerifyException: '' is not a valid ISO 4217 currency code。

【问题讨论】:

    标签: bixby bixbystudio


    【解决方案1】:

    我认为错误消息意味着找不到payInfo。它应该是作为输入的概念,而不是结构名称。另外我建议将结构重命名为 PayInfo 而不是 payInfo。

    请参阅随附的屏幕截图。

    【讨论】:

    • 感谢您的回复,通过我们的错误得到解决,但是当我们在模拟器中运行代码时,将 Capsule Execution Error 作为 Com.google.common.base.VerifyException: '' is not a valid ISO 4217 货币代码。我按照说明更新了我的问题,但仍然无法正常工作。
    • 请使用 Bixby IDE 中的“联系支持”提出支持票,并同步您的胶囊。支付是 Bixby 的高级主题。如果没有实际的胶囊,我无法提供有用或准确的 cmets。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-11-16
    • 2023-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多