CreatePaymentTransactionMethod
PayoneBanktransferInAdvancePaymentTransactionMethodProvider
, PayoneCreditCardCreatePaymentTransactionMethodProvider
, PayoneKlarnaCreatePaymentTransactionMethodProvider
, PayoneRedirectCreatePaymentTransactionMethodProviderBase
public abstract class PayoneCreatePaymentTransactionMethodBase extends CreatePaymentTransactionMethodBase
Constructor | Description |
---|---|
PayoneCreatePaymentTransactionMethodBase() |
Modifier and Type | Method | Description |
---|---|---|
protected java.util.concurrent.CompletionStage<PaymentTransactionCreationResult> |
afterTransactionCreation(CreatePaymentTransactionData cptd,
io.sphere.sdk.payments.Payment payment) |
|
protected java.lang.String |
buildHandleUrl(io.sphere.sdk.payments.Payment p) |
|
java.util.function.Function<CreatePaymentTransactionData,java.util.concurrent.CompletionStage<PaymentTransactionCreationResult>> |
create() |
Provides a function that handles the creation of a payment transaction object within the CTP plattform.
|
protected io.sphere.sdk.payments.TransactionType |
getDefaultTransactionType(CreatePaymentTransactionData cptd) |
|
protected PaymentTransactionCreationResult |
handleExceptions(java.lang.Throwable t) |
|
protected PaymentTransactionCreationResult |
handleRedirectIfPresent(io.sphere.sdk.payments.Payment updatedPayment,
java.util.function.Function<? super io.sphere.sdk.payments.Payment,? extends PaymentTransactionCreationResult> ifCantRedirect) |
Try to handle redirect from the
updatedPayment :
if PayoneConfigurationNames.REDIRECT_URL exists in the
updatedPayment - return success result with ShopAction.REDIRECT
otherwise fallback to ifCantRedirect function
|
protected abstract PaymentTransactionCreationResult |
handleSuccessfulServiceCall(io.sphere.sdk.payments.Payment updatedPayment) |
Will be called after the Payone services handle URL request has finished successfully.
|
protected void |
setHandleUrl(java.lang.String handleUrl) |
addPaymentUpdateActions, createPaymentTransaction, createTransactionDraftBuilder, defaultSuccessTransactionCreationResult, getCustomFieldStringIfExists
public PayoneCreatePaymentTransactionMethodBase()
public java.util.function.Function<CreatePaymentTransactionData,java.util.concurrent.CompletionStage<PaymentTransactionCreationResult>> create()
CreatePaymentTransactionMethod
protected void setHandleUrl(java.lang.String handleUrl)
protected io.sphere.sdk.payments.TransactionType getDefaultTransactionType(CreatePaymentTransactionData cptd)
protected java.lang.String buildHandleUrl(io.sphere.sdk.payments.Payment p)
protected java.util.concurrent.CompletionStage<PaymentTransactionCreationResult> afterTransactionCreation(CreatePaymentTransactionData cptd, io.sphere.sdk.payments.Payment payment)
@Nonnull protected PaymentTransactionCreationResult handleRedirectIfPresent(@Nullable io.sphere.sdk.payments.Payment updatedPayment, @Nonnull java.util.function.Function<? super io.sphere.sdk.payments.Payment,? extends PaymentTransactionCreationResult> ifCantRedirect)
updatedPayment
:PayoneConfigurationNames.REDIRECT_URL
exists in the
updatedPayment
- return success result with ShopAction.REDIRECT
ifCantRedirect
functionupdatedPayment
- reference to the updated paymentifCantRedirect
- function which accepts the updated payment and returns respective result (likely with
OperationResult.FAILED
and ShopAction.HANDLE_ERROR
.PaymentTransactionCreationResult
with success action if payment contains redirect, or fallback
action from ifCantRedirect
is can't redirect the payment transaction processing.protected abstract PaymentTransactionCreationResult handleSuccessfulServiceCall(io.sphere.sdk.payments.Payment updatedPayment)
updatedPayment
- the refreshed payment objectprotected PaymentTransactionCreationResult handleExceptions(java.lang.Throwable t)