Class PaymentBuilder
Example to create an instance using the builder pattern
Payment payment = Payment.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.amountPlanned(amountPlannedBuilder -> amountPlannedBuilder)
.paymentMethodInfo(paymentMethodInfoBuilder -> paymentMethodInfoBuilder)
.paymentStatus(paymentStatusBuilder -> paymentStatusBuilder)
.plusTransactions(transactionsBuilder -> transactionsBuilder)
.plusInterfaceInteractions(interfaceInteractionsBuilder -> interfaceInteractionsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionRepresents information exchange with the payment service, for example, a PSP.addTransactions
(Function<TransactionBuilder, Transaction> builder) Financial transactions of the Payment.amountPlanned
(CentPrecisionMoney amountPlanned) Money value the Payment intends to receive from the customer.Money value the Payment intends to receive from the customer.anonymousId
(String anonymousId) Anonymous session associated with the Payment.build()
builds Payment with checking for non-null required valuesbuilds Payment without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Payment was initially created.IDs and references that created the Payment.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the Payment.custom
(CustomFields custom) Custom Fields for the Payment.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields for the Payment.customer
(CustomerReference customer) Reference to a Customer associated with the Payment.Reference to a Customer associated with the Payment.Money value the Payment intends to receive from the customer.Anonymous session associated with the Payment.Date and time (UTC) the Payment was initially created.IDs and references that created the Payment.Custom Fields for the Payment.Reference to a Customer associated with the Payment.getId()
Unique identifier of the Payment.Identifier used by the payment service that processes the Payment (for example, a PSP).Represents information exchange with the payment service, for example, a PSP.getKey()
User-defined unique identifier of the Payment.Date and time (UTC) the Payment was last updated.IDs and references that last modified the Payment.Information regarding the payment interface (for example, a PSP), and the specific payment method used.Current status of the Payment.Financial transactions of the Payment.Current version of the Payment.Unique identifier of the Payment.interfaceId
(String interfaceId) Identifier used by the payment service that processes the Payment (for example, a PSP).interfaceInteractions
(CustomFields... interfaceInteractions) Represents information exchange with the payment service, for example, a PSP.interfaceInteractions
(List<CustomFields> interfaceInteractions) Represents information exchange with the payment service, for example, a PSP.User-defined unique identifier of the Payment.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Payment was last updated.lastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the Payment.IDs and references that last modified the Payment.static PaymentBuilder
of()
factory method for an instance of PaymentBuilderstatic PaymentBuilder
create builder for Payment instancepaymentMethodInfo
(PaymentMethodInfo paymentMethodInfo) Information regarding the payment interface (for example, a PSP), and the specific payment method used.Information regarding the payment interface (for example, a PSP), and the specific payment method used.paymentStatus
(PaymentStatus paymentStatus) Current status of the Payment.Current status of the Payment.plusInterfaceInteractions
(CustomFields... interfaceInteractions) Represents information exchange with the payment service, for example, a PSP.Represents information exchange with the payment service, for example, a PSP.plusTransactions
(Transaction... transactions) Financial transactions of the Payment.Financial transactions of the Payment.Represents information exchange with the payment service, for example, a PSP.setTransactions
(Function<TransactionBuilder, Transaction> builder) Financial transactions of the Payment.transactions
(Transaction... transactions) Financial transactions of the Payment.transactions
(List<Transaction> transactions) Financial transactions of the Payment.Current version of the Payment.Money value the Payment intends to receive from the customer.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the Payment.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields for the Payment.Reference to a Customer associated with the Payment.Represents information exchange with the payment service, for example, a PSP.IDs and references that last modified the Payment.Information regarding the payment interface (for example, a PSP), and the specific payment method used.Current status of the Payment.Financial transactions of the Payment.
-
Constructor Details
-
PaymentBuilder
public PaymentBuilder()
-
-
Method Details
-
id
Unique identifier of the Payment.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the Payment.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Payment was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the Payment was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the Payment.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
IDs and references that last modified the Payment.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the Payment.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the Payment.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the Payment.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the Payment.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
customer
Reference to a Customer associated with the Payment.
- Parameters:
builder
- function to build the customer value- Returns:
- Builder
-
withCustomer
Reference to a Customer associated with the Payment.
- Parameters:
builder
- function to build the customer value- Returns:
- Builder
-
customer
Reference to a Customer associated with the Payment.
- Parameters:
customer
- value to be set- Returns:
- Builder
-
anonymousId
Anonymous session associated with the Payment.
- Parameters:
anonymousId
- value to be set- Returns:
- Builder
-
interfaceId
Identifier used by the payment service that processes the Payment (for example, a PSP). The combination of
interfaceId
and thepaymentInterface
field on PaymentMethodInfo must be unique.- Parameters:
interfaceId
- value to be set- Returns:
- Builder
-
amountPlanned
public PaymentBuilder amountPlanned(Function<CentPrecisionMoneyBuilder, CentPrecisionMoneyBuilder> builder) Money value the Payment intends to receive from the customer. The value typically matches the Cart or Order gross total.
- Parameters:
builder
- function to build the amountPlanned value- Returns:
- Builder
-
withAmountPlanned
public PaymentBuilder withAmountPlanned(Function<CentPrecisionMoneyBuilder, CentPrecisionMoney> builder) Money value the Payment intends to receive from the customer. The value typically matches the Cart or Order gross total.
- Parameters:
builder
- function to build the amountPlanned value- Returns:
- Builder
-
amountPlanned
Money value the Payment intends to receive from the customer. The value typically matches the Cart or Order gross total.
- Parameters:
amountPlanned
- value to be set- Returns:
- Builder
-
paymentMethodInfo
public PaymentBuilder paymentMethodInfo(Function<PaymentMethodInfoBuilder, PaymentMethodInfoBuilder> builder) Information regarding the payment interface (for example, a PSP), and the specific payment method used.
- Parameters:
builder
- function to build the paymentMethodInfo value- Returns:
- Builder
-
withPaymentMethodInfo
public PaymentBuilder withPaymentMethodInfo(Function<PaymentMethodInfoBuilder, PaymentMethodInfo> builder) Information regarding the payment interface (for example, a PSP), and the specific payment method used.
- Parameters:
builder
- function to build the paymentMethodInfo value- Returns:
- Builder
-
paymentMethodInfo
Information regarding the payment interface (for example, a PSP), and the specific payment method used.
- Parameters:
paymentMethodInfo
- value to be set- Returns:
- Builder
-
paymentStatus
Current status of the Payment.
- Parameters:
builder
- function to build the paymentStatus value- Returns:
- Builder
-
withPaymentStatus
Current status of the Payment.
- Parameters:
builder
- function to build the paymentStatus value- Returns:
- Builder
-
paymentStatus
Current status of the Payment.
- Parameters:
paymentStatus
- value to be set- Returns:
- Builder
-
transactions
Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.
- Parameters:
transactions
- value to be set- Returns:
- Builder
-
transactions
Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.
- Parameters:
transactions
- value to be set- Returns:
- Builder
-
plusTransactions
Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.
- Parameters:
transactions
- value to be set- Returns:
- Builder
-
plusTransactions
Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.
- Parameters:
builder
- function to build the transactions value- Returns:
- Builder
-
withTransactions
Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.
- Parameters:
builder
- function to build the transactions value- Returns:
- Builder
-
addTransactions
Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.
- Parameters:
builder
- function to build the transactions value- Returns:
- Builder
-
setTransactions
Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.
- Parameters:
builder
- function to build the transactions value- Returns:
- Builder
-
interfaceInteractions
Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.
- Parameters:
interfaceInteractions
- value to be set- Returns:
- Builder
-
interfaceInteractions
Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.
- Parameters:
interfaceInteractions
- value to be set- Returns:
- Builder
-
plusInterfaceInteractions
Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.
- Parameters:
interfaceInteractions
- value to be set- Returns:
- Builder
-
plusInterfaceInteractions
public PaymentBuilder plusInterfaceInteractions(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.
- Parameters:
builder
- function to build the interfaceInteractions value- Returns:
- Builder
-
withInterfaceInteractions
public PaymentBuilder withInterfaceInteractions(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.
- Parameters:
builder
- function to build the interfaceInteractions value- Returns:
- Builder
-
addInterfaceInteractions
Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.
- Parameters:
builder
- function to build the interfaceInteractions value- Returns:
- Builder
-
setInterfaceInteractions
Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.
- Parameters:
builder
- function to build the interfaceInteractions value- Returns:
- Builder
-
custom
Custom Fields for the Payment.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields for the Payment.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the Payment.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Payment.
- Parameters:
key
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Payment.
- Returns:
- id
-
getVersion
Current version of the Payment.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Payment was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Payment was last updated.
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the Payment.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Payment.
- Returns:
- createdBy
-
getCustomer
Reference to a Customer associated with the Payment.
- Returns:
- customer
-
getAnonymousId
Anonymous session associated with the Payment.
- Returns:
- anonymousId
-
getInterfaceId
Identifier used by the payment service that processes the Payment (for example, a PSP). The combination of
interfaceId
and thepaymentInterface
field on PaymentMethodInfo must be unique.- Returns:
- interfaceId
-
getAmountPlanned
Money value the Payment intends to receive from the customer. The value typically matches the Cart or Order gross total.
- Returns:
- amountPlanned
-
getPaymentMethodInfo
Information regarding the payment interface (for example, a PSP), and the specific payment method used.
- Returns:
- paymentMethodInfo
-
getPaymentStatus
Current status of the Payment.
- Returns:
- paymentStatus
-
getTransactions
Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.
- Returns:
- transactions
-
getInterfaceInteractions
Represents information exchange with the payment service, for example, a PSP. An interaction may be a request sent, or a response or notification received from the payment service.
- Returns:
- interfaceInteractions
-
getCustom
Custom Fields for the Payment.
- Returns:
- custom
-
getKey
User-defined unique identifier of the Payment.
- Returns:
- key
-
build
builds Payment with checking for non-null required values -
buildUnchecked
builds Payment without checking for non-null required values- Returns:
- Payment
-
of
factory method for an instance of PaymentBuilder- Returns:
- builder
-
of
create builder for Payment instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-