Class PaymentBuilder
- All Implemented Interfaces:
io.vrap.rmf.base.client.Builder<Payment>
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.amountAuthorized
(TypedMoney amountAuthorized) Deprecated because its value can be calculated from the total amounts saved in the Transactions.amountAuthorized
(Function<TypedMoneyBuilder, io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder) Deprecated because its value can be calculated from the total amounts saved in the Transactions.amountPaid
(TypedMoney amountPaid) Deprecated because its value can be calculated from the total amounts saved in the Transactions.amountPaid
(Function<TypedMoneyBuilder, io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder) Deprecated because its value can be calculated from the total amounts saved in the Transactions.amountPlanned
(CentPrecisionMoney amountPlanned) Money value the Payment intends to receive from the customer.Money value the Payment intends to receive from the customer.amountRefunded
(TypedMoney amountRefunded) Deprecated because its value can be calculated from the total amounts saved in the Transactions.amountRefunded
(Function<TypedMoneyBuilder, io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder) Deprecated because its value can be calculated from the total amounts saved in the Transactions.anonymousId
(String anonymousId) Anonymous session associated with the Payment.authorizedUntil
(String authorizedUntil) Deprecated because this field is of little practical value, as it is either not reliably known, or the authorization time is fixed for a PSP.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.Present on resources created after 1 February 2019 except for events not tracked.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) Present on resources created after 1 February 2019 except for events not tracked.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.externalId
(String externalId) Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).Deprecated because its value can be calculated from the total amounts saved in the Transactions.Deprecated because its value can be calculated from the total amounts saved in the Transactions.Money value the Payment intends to receive from the customer.Deprecated because its value can be calculated from the total amounts saved in the Transactions.Anonymous session associated with the Payment.Deprecated because this field is of little practical value, as it is either not reliably known, or the authorization time is fixed for a PSP.Date and time (UTC) the Payment was initially created.Present on resources created after 1 February 2019 except for events not tracked.Custom Fields for the Payment.Reference to a Customer associated with the Payment.Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).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.Present on resources created after 1 February 2019 except for events not tracked.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) Present on resources created after 1 February 2019 except for events not tracked.Present on resources created after 1 February 2019 except for events not tracked.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) Present on resources created after 1 February 2019 except for events not tracked.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.Present on resources created after 1 February 2019 except for events not tracked.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
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
createdBy
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
Present on resources created after 1 February 2019 except for events not tracked.
- 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
-
externalId
Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).
- Parameters:
externalId
- 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
-
amountAuthorized
Deprecated because its value can be calculated from the total amounts saved in the Transactions.
- Parameters:
amountAuthorized
- value to be set- Returns:
- Builder
-
amountAuthorized
public PaymentBuilder amountAuthorized(Function<TypedMoneyBuilder, io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder) Deprecated because its value can be calculated from the total amounts saved in the Transactions.
- Parameters:
builder
- function to build the amountAuthorized value- Returns:
- Builder
-
authorizedUntil
Deprecated because this field is of little practical value, as it is either not reliably known, or the authorization time is fixed for a PSP.
- Parameters:
authorizedUntil
- value to be set- Returns:
- Builder
-
amountPaid
Deprecated because its value can be calculated from the total amounts saved in the Transactions.
- Parameters:
amountPaid
- value to be set- Returns:
- Builder
-
amountPaid
public PaymentBuilder amountPaid(Function<TypedMoneyBuilder, io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder) Deprecated because its value can be calculated from the total amounts saved in the Transactions.
- Parameters:
builder
- function to build the amountPaid value- Returns:
- Builder
-
amountRefunded
Deprecated because its value can be calculated from the total amounts saved in the Transactions.
- Parameters:
amountRefunded
- value to be set- Returns:
- Builder
-
amountRefunded
public PaymentBuilder amountRefunded(Function<TypedMoneyBuilder, io.vrap.rmf.base.client.Builder<? extends TypedMoney>> builder) Deprecated because its value can be calculated from the total amounts saved in the Transactions.
- Parameters:
builder
- function to build the amountRefunded value- 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
Present on resources created after 1 February 2019 except for events not tracked.
- Returns:
- lastModifiedBy
-
getCreatedBy
Present on resources created after 1 February 2019 except for events not tracked.
- Returns:
- createdBy
-
getCustomer
Reference to a Customer associated with the Payment.
- Returns:
- customer
-
getAnonymousId
Anonymous session associated with the Payment.
- Returns:
- anonymousId
-
getExternalId
Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).
- Returns:
- externalId
-
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
-
getAmountAuthorized
Deprecated because its value can be calculated from the total amounts saved in the Transactions.
- Returns:
- amountAuthorized
-
getAuthorizedUntil
Deprecated because this field is of little practical value, as it is either not reliably known, or the authorization time is fixed for a PSP.
- Returns:
- authorizedUntil
-
getAmountPaid
Deprecated because its value can be calculated from the total amounts saved in the Transactions.
- Returns:
- amountPaid
-
getAmountRefunded
Deprecated because its value can be calculated from the total amounts saved in the Transactions.
- Returns:
- amountRefunded
-
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- Specified by:
build
in interfaceio.vrap.rmf.base.client.Builder<Payment>
- Returns:
- Payment
-
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
-