Current section

Files

Jump to
docusign lib docusign model payment_details.ex
Raw

lib/docusign/model/payment_details.ex

# NOTE: This file is auto generated by OpenAPI Generator
# https://openapi-generator.tech
# Do not edit this file manually.
defmodule DocuSign.Model.PaymentDetails do
@moduledoc """
When a formula tab has a `paymentDetails` property, the formula tab is a payment item. See [Requesting Payments Along with Signatures][paymentguide] in the Docusign Support Center to learn more about payments. [paymentguide]: https://support.docusign.com/s/document-item?bundleId=juu1573854950452&topicId=fyw1573854935374.html
"""
alias DocuSign.Deserializer
alias DocuSign.Model.Money
alias DocuSign.Model.PaymentLineItem
alias DocuSign.Model.PaymentSignerValues
alias DocuSign.Model.PropertyMetadata
defstruct [
:allowedPaymentMethods,
:chargeId,
:currencyCode,
:currencyCodeMetadata,
:customMetadata,
:customMetadataRequired,
:customerId,
:gatewayAccountId,
:gatewayAccountIdMetadata,
:gatewayDisplayName,
:gatewayName,
:lineItems,
:paymentOption,
:paymentSourceId,
:signerValues,
:status,
:subGatewayName,
:total
]
@doc false
defimpl Jason.Encoder, for: __MODULE__ do
def encode(struct, opts) do
struct
|> Map.from_struct()
|> Enum.reject(fn {_k, v} -> is_nil(v) end)
|> Map.new()
|> Jason.Encode.map(opts)
end
end
@type t :: %__MODULE__{
:allowedPaymentMethods => [String.t()] | nil,
:chargeId => String.t() | nil,
:currencyCode => String.t() | nil,
:currencyCodeMetadata => PropertyMetadata.t() | nil,
:customMetadata => String.t() | nil,
:customMetadataRequired => boolean() | nil,
:customerId => String.t() | nil,
:gatewayAccountId => String.t() | nil,
:gatewayAccountIdMetadata => PropertyMetadata.t() | nil,
:gatewayDisplayName => String.t() | nil,
:gatewayName => String.t() | nil,
:lineItems => [PaymentLineItem.t()] | nil,
:paymentOption => String.t() | nil,
:paymentSourceId => String.t() | nil,
:signerValues => PaymentSignerValues.t() | nil,
:status => String.t() | nil,
:subGatewayName => String.t() | nil,
:total => Money.t() | nil
}
def decode(value) do
value
|> Deserializer.deserialize(
:currencyCodeMetadata,
:struct,
PropertyMetadata
)
|> Deserializer.deserialize(
:gatewayAccountIdMetadata,
:struct,
PropertyMetadata
)
|> Deserializer.deserialize(
:lineItems,
:list,
PaymentLineItem
)
|> Deserializer.deserialize(
:signerValues,
:struct,
PaymentSignerValues
)
|> Deserializer.deserialize(
:total,
:struct,
Money
)
|> then(&struct(__MODULE__, &1))
end
end