DocuSign Payments睡觉接口创建选项卡并保存付款方式 [英] DocuSign Payments REST API create Tab and Save Payment Method

查看:19
本文介绍了DocuSign Payments睡觉接口创建选项卡并保存付款方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用DocuSign睡觉API并尝试创建一个Payment选项卡,该选项卡将保存签名人的支付方式。

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

以下代码摘自另一个关于堆栈溢出的问题,它用于设置收取付款的选项卡,但同样不会使用保存带条纹的付款方式以备将来收费:

"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
}]

如何修改此代码以便既收取付款又保存付款方式以备将来计费?

提前感谢

推荐答案

您需要传递"paymentOption": "save_and_authorize"来收取一次性付款,并将付款方式保存在条带上。另外,您还需要添加一个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"
}

这篇关于DocuSign Payments睡觉接口创建选项卡并保存付款方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆