From 01e1c24e06ddce612cb7b802dd7b70ca9ecfb02f Mon Sep 17 00:00:00 2001 From: wanlingt Date: Wed, 7 Feb 2024 10:52:50 +0800 Subject: [PATCH] feat: add payment content details to readme --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 31b8aa2..61d3c45 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ The underlying cryptosystem is `x25519-xsalsa20-poly1305` which is implemented b | encryptedContent | string | The encrypted submission in base64. | | created | string | Creation timestamp. | | attachmentDownloadUrls | Record | (Optional) Records containing field IDs and URLs where encrypted uploaded attachments can be downloaded. | +| paymentContent | Object (more details can be found [below](https://github.com/opengovsg/formsg-javascript-sdk?tab=readme-ov-file#format-of-payment-content)) | Details of payment made for the unique response ### Format of Decrypted Submissions @@ -178,6 +179,21 @@ Attachments are end-to-end encrypted in the same way as normal form submissions, _Warning:_ We do not have the ability to scan any attachments for malicious content (e.g. spyware or viruses), so careful handling is needed. +### Format of Payment Content +The payment content object will contain the following fields if a payment is associated with the fom. Otherwise, an empty object `{}`` will be returned. + +| Key | Type | Description | +| ----------- | -------- | -------------------------------------------------------------------------------------------------------- | +| type | string | The type of payment made e.g. payment_charge | +| status | string | The status of the payment | +| payer | string | The payer's email address | +| url | string | The invoice download url | +| paymentIntent | string | A unique identifier of payment | +| amount | string | Payment amount | +| productService | string | A breakdown of the product and quantity selected and paid through the form | +| dateTime | string | Payment timestamp | +| transactionFee | string | Transaction fee | + ## Verifying Signatures Manually You can use the following information to create a custom solution, although we recommend using this SDK.