【问题标题】:DocuSign Payments REST API create Tab and Save Payment MethodDocuSign Payments REST API 创建选项卡并保存付款方式
【发布时间】:2019-07-23 22:40:16
【问题描述】:

我正在使用 Docusign REST API 并尝试创建一个支付选项卡,该选项卡将使用 Stripe 保存签名者的支付方式。

Docusign API 指南和 StackOverflow 上有一些信息,解释了如何使用 API收取付款,但我没有找到任何资源来解释如何保存和授权 未来计费的付款方式,尽管在 Docusign 网站上手动创建信封时可以使用此功能。 (要在 Docusign 网站上执行此操作,您只需单击标准字段--> 付款项目--> 付款类型--> 保存付款方式。)由于该功能在网站上可用,因此也应该可以通过API 也是如此。

以下代码取自 stackoverflow 上的另一个问题,它适用于为 collecting 付款设置标签,但同样没有 保存 Stripe 的付款方式未来收费:

"numberTabs": [{
    "xPosition": 268,
    "yPosition": 142,
    "documentId": "12345",
    "recipientId": "1",
    "pageNumber": 1,
    "value": 250,
    "maxLength": 4000,
    "width": 80,
    "height": 16,
    "tabLabel": "PaymentFixed 646b5192-a101-4cdc-a7e5-5e9bd1b80612",
    "paymentItemName": "Test Item Name",
    "paymentItemCode": "54321",
    "paymentItemDescription": "Test Item Details"
}],
"formulaTabs": [{
    "paymentDetails": {
        "currencyCode": "USD",
        "gatewayAccountId": "8cfb9a83-1f4c-40b1-b7a9-dd382ee0ca7d",
        "lineItems": [{
            "amountReference": "PaymentFixed 646b5192-a101-4cdc-a7e5-5e9bd1b80612",
            "name": "Test Item Name",
            "description": "Test Item Details",
            "itemCode": "54321"
        }]
    },
    "formula": "([PaymentFixed 646b5192-a101-4cdc-a7e5-5e9bd1b80612]) * 100",
    "recipientId": "1",
    "documentId": "12345",
    "tabLabel": "PaymentReceipt e47eed9a-85ca-4094-8d0f-50e51d5d1ee0",
    "xPosition": 0,
    "yPosition": 0,
    "pageNumber": 1,
    "required": true,
    "locked": true,
    "hidden": true
}]

如何修改此代码,以便收款和保存付款方式以备将来结算?

提前致谢

【问题讨论】:

    标签: docusignapi


    【解决方案1】:

    您需要通过"paymentOption": "save_and_authorize" 来收取一次性付款并在Stripe 上保存付款方式。您还需要添加一个 TextTab 以在签名屏幕上显示保存付款方式,收集一次性付款和保存付款方式的完整代码如下所示:

    {
        "compositeTemplates": [
            {
                "document": {
                    "documentBase64": "<Base64>",
                    "documentId": "1",
                    "fileExtension": "docx",
                    "name": "Doc1"
                },
                "inlineTemplates": [
                    {
                        "recipients": {
                            "signers": [
                                {
                                    "email": "email@gmail.com",
                                    "name": "John Doe",
                                    "recipientId": "88089475",
                                    "tabs": {
                                        "textTabs": [
                                            {
                                                "tabLabel": "PaymentFuture 53d3ce8e-a043-4d0a-93ff-37eee94d3555",
                                                "documentId": "1",
                                                "pageNumber": 1,
                                                "recipientId": "88089475",
                                                "xPosition": 201,
                                                "yPosition": 219,
                                                "locked": true
                                            }
                                        ],
                                        "numberTabs": [
                                            {
                                                "tabLabel": "PaymentFixed 91684e58-85c6-4441-be08-efebac5476b8",
                                                "value": 10,
                                                "maxLength": 4000,
                                                "width": 84,
                                                "height": 22,
                                                "pageNumber": 1,
                                                "documentId": "1",
                                                "recipientId": "88089475",
                                                "paymentItemName": "Name1",
                                                "paymentItemCode": "Code1",
                                                "paymentItemDescription": "Details1",
                                                "xPosition": 201,
                                                "yPosition": 158
                                            }
                                        ],
                                        "formulaTabs": [
                                            {
                                                "tabLabel": "PaymentReceipt 7a59b203-d9e8-4e3b-8b4d-776d8869cc30",
                                                "roundDecimalPlaces": 0,
                                                "formula": "([PaymentFixed 91684e58-85c6-4441-be08-efebac5476b8]) * 100",
                                                "hidden": true,
                                                "pageNumber": 1,
                                                "paymentDetails": {
                                                    "currencyCode": "USD",
                                                    "gatewayAccountId": "1d0702f5-f317-4af7-835d-1c8769434fae",
                                                    "gatewayName": "Stripe",
                                                    "paymentOption": "save_and_authorize",
                                                    "lineItems": [
                                                        {
                                                            "amountReference": "PaymentFixed 91684e58-85c6-4441-be08-efebac5476b8",
                                                            "name": "Name1",
                                                            "description": "Details1",
                                                            "itemCode": "Code1"
                                                        },
                                                        {
                                                            "amountReference": "PaymentFuture 53d3ce8e-a043-4d0a-93ff-37eee94d3555",
                                                            "name": "Monthly Payment $50",
                                                            "description": "Monthly Payment Desc",
                                                            "itemCode": "505050"
                                                        }
                                                    ]
                                                },
                                                "recipientId": "88089475",
                                                "documentId": "1",
                                                "xPosition": 0,
                                                "yPosition": 0
                                            }
                                        ]
                                    }
                                }
                            ]
                        },
                        "sequence": "2"
                    }
                ]
            }
        ],
        "status": "sent",
        "emailSubject": "Payment Authorize"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-05
      • 1970-01-01
      • 2017-01-21
      • 1970-01-01
      • 2011-09-15
      • 2021-09-30
      • 2014-05-24
      • 2018-01-03
      相关资源
      最近更新 更多