Class MyPaymentBuilder
Example to create an instance using the builder pattern
MyPayment myPayment = MyPayment.builder()
.id("{id}")
.version(0.3)
.amountPlanned(amountPlannedBuilder -> amountPlannedBuilder)
.paymentMethodInfo(paymentMethodInfoBuilder -> paymentMethodInfoBuilder)
.plusTransactions(transactionsBuilder -> transactionsBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddTransactions
(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 MyPayment with checking for non-null required valuesbuilds MyPayment without checking for non-null required valuescustom
(CustomFields custom) Custom Fields defined for the Payment.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields defined 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.Custom Fields defined for the Payment.Reference to a Customer associated with the Payment.getId()
Unique identifier of the Payment.Information regarding the payment interface (for example, a PSP), and the specific payment method used.Financial transactions of the Payment.Current version of the Payment.Unique identifier of the Payment.static MyPaymentBuilder
of()
factory method for an instance of MyPaymentBuilderstatic MyPaymentBuilder
create builder for MyPayment 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.plusTransactions
(Transaction... transactions) Financial transactions of the Payment.Financial transactions of the Payment.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.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields defined for the Payment.Reference to a Customer associated with the Payment.Information regarding the payment interface (for example, a PSP), and the specific payment method used.Financial transactions of the Payment.
-
Constructor Details
-
MyPaymentBuilder
public MyPaymentBuilder()
-
-
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
-
customer
public MyPaymentBuilder customer(Function<CustomerReferenceBuilder, CustomerReferenceBuilder> builder) Reference to a Customer associated with the Payment. Set automatically with a password flow token. Either
customer
oranonymousId
is present.- Parameters:
builder
- function to build the customer value- Returns:
- Builder
-
withCustomer
Reference to a Customer associated with the Payment. Set automatically with a password flow token. Either
customer
oranonymousId
is present.- Parameters:
builder
- function to build the customer value- Returns:
- Builder
-
customer
Reference to a Customer associated with the Payment. Set automatically with a password flow token. Either
customer
oranonymousId
is present.- Parameters:
customer
- value to be set- Returns:
- Builder
-
anonymousId
Anonymous session associated with the Payment. Set automatically with a token for an anonymous session. Either
customer
oranonymousId
is present.- Parameters:
anonymousId
- value to be set- Returns:
- Builder
-
amountPlanned
public MyPaymentBuilder 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 MyPaymentBuilder 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 MyPaymentBuilder 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 MyPaymentBuilder 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
-
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
-
custom
Custom Fields defined for the Payment.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields defined for the Payment.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields defined for the Payment.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Payment.
- Returns:
- id
-
getVersion
Current version of the Payment.
- Returns:
- version
-
getCustomer
Reference to a Customer associated with the Payment. Set automatically with a password flow token. Either
customer
oranonymousId
is present.- Returns:
- customer
-
getAnonymousId
Anonymous session associated with the Payment. Set automatically with a token for an anonymous session. Either
customer
oranonymousId
is present.- Returns:
- anonymousId
-
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
-
getTransactions
Financial transactions of the Payment. Each Transaction has a TransactionType and a TransactionState.
- Returns:
- transactions
-
getCustom
Custom Fields defined for the Payment.
- Returns:
- custom
-
build
builds MyPayment with checking for non-null required values -
buildUnchecked
builds MyPayment without checking for non-null required values- Returns:
- MyPayment
-
of
factory method for an instance of MyPaymentBuilder- Returns:
- builder
-
of
create builder for MyPayment instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-