【发布时间】:2021-04-14 11:05:18
【问题描述】:
我们需要使用 salesforce 创建客户并将他们的信用卡信息保存在 Square 中,我们必须稍后通过 apex 代码(在 salesforce 中)向客户收取费用。因此,为此,我们作为开发人员阅读并理解 Square API 文档。 阅读此链接https://developer.squareup.com/reference/square/customers-api/create-customer 后,我们能够使用 Square API 创建从 salesforce 到 square 的客户。 Square API 文档很容易阅读。 但是当我们开始实现为客户 Square 保存信用卡的功能时,我们陷入了困境,因为在 Square 中创建/保存客户卡时,需要“customer_id”和“card_nonce”两件事。所以我们有客户 ID,因为我们已经在 Square 中使用 salesforce 中的顶点代码创建了客户。但是我们没有“nonce”What does a Square nonce represent?,根据 Square API 文档生成 nonce 的唯一方法是“Square Payment Form”https://developer.squareup.com/docs/payment-form/payment-form-walkthrough、How to get Nonce for Card using Square API from Backend 所以我花了更多时间寻找解决方法,但所有的努力都出错了。我还尝试创建 VF 页面,并将我们在 salesforce 对象中已有的所有客户和卡信息从 apex 代码传递给 Square 支付表单,但 JS 没有执行,Square 支付表单仅适用于 JS SDK。
有没有人知道我们如何从支持(顶点代码)生成“nonce”来为 Square 中的客户保存卡片?
【问题讨论】:
标签: salesforce apex square