docusign-esign-php-client
docusign-esign-php-client copied to clipboard
How can we add Payment Item field in document?
trafficstars
Hello, How can we add a Payment Item Field in the document?
in the above Image, they provide payment item fields.
using below code
` $this->authenticate();
$envelopeApi = new EnvelopesApi($this->apiClient);
$document = new Document([
'document_base64' => base64_encode(file_get_contents($documentPath)),
'name' => 'myDoc.pdf',
'file_extension' => 'pdf',
'document_id' => '1'
]);
$signHere = new SignHere([
'document_id' => '1',
'page_number' => '9',
'x_position' => '200',
'y_position' => '200'
]);
$nameTab = new \DocuSign\eSign\Model\Text([
'document_id' => '1',
'page_number' => '9',
'x_position' => '200',
'y_position' => '255',
'tab_label' => 'Printed Name',
'value' => $recipientName,
'font' => 'helvetica',
'font_size' => 'Size12',
'bold' => 'false',
'italic' => 'false',
'underline' => 'false',
'font_color' => 'Black'
]);
$tabs = new Tabs([
'sign_here_tabs' => [$signHere],
'text_tabs' => [$nameTab]
]);
$signer = new Signer([ 'email' => $recipientEmail, 'name' => $recipientName, 'recipient_id' => '1', 'tabs' => $tabs, 'client_user_id' => $token ]);
$envelopeDefinition = new EnvelopeDefinition([
'email_subject' => 'Please sign document',
'documents' => [$document],
'recipients' => ['signers' => [$signer]],
'status' => 'sent'
]);
$result = $envelopeApi->createEnvelope($this->accountId, $envelopeDefinition);
`
I put the signed and name field in a document. now How can we add a Payment Item Field in the document like a text field and signed field? I want only to save the credit card details of the signer. stripe Payment method