【问题标题】:How to create customer card in Square using Apex in salesforce?如何在 Salesforce 中使用 Apex 在 Square 中创建客户卡?
【发布时间】: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-walkthroughHow to get Nonce for Card using Square API from Backend 所以我花了更多时间寻找解决方法,但所有的努力都出错了。我还尝试创建 VF 页面,并将我们在 salesforce 对象中已有的所有客户和卡信息从 apex 代码传递给 Square 支付表单,但 JS 没有执行,Square 支付表单仅适用于 JS SDK。

有没有人知道我们如何从支持(顶点代码)生成“nonce”来为 Square 中的客户保存卡片?

【问题讨论】:

    标签: salesforce apex square


    【解决方案1】:

    如果不使用 Square Payment Form,就无法创建 nonce。您也不能将原始数据传递给 Square Payment Form,因为它不包含填写卡数据的功能(邮政编码除外)。有人需要手动将该信息输入到使用托管 Square Payment Form 的 HTTPS 的站点中,以生成合法的

    【讨论】:

    • 感谢您的帮助,您说得对,我在方形文档中搜索了这些东西,它们目前提供的内容不同。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-08
    • 1970-01-01
    • 1970-01-01
    • 2021-11-03
    • 1970-01-01
    相关资源
    最近更新 更多