Class DefaultAdyenSessionService
java.lang.Object
com.broadleafcommerce.adyen.service.DefaultAdyenSessionService
- All Implemented Interfaces:
AdyenSessionService
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultAdyenSessionService(AdyenProvider adyenProvider, AdyenConfigurationProperties configurationProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddSavedPaymentMethodAttributes(CreateCheckoutSessionRequest createCheckoutSessionRequest, SessionRequest request) this method expected to be invoked in 2 places: 1st during checkout process, in that case mode should be "ask for consent" - checkbox on "drop-in" plugin will be shown.protected CreateCheckoutSessionRequestbuildCreateSessionRequest(@NonNull SessionRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected AdyenAmountconvertAmount(@NonNull javax.money.MonetaryAmount amount) createSession(@NonNull SessionRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) This method is responsible for calling Adyen init-session endpoint.protected AdyenProviderprotected LonggetAmountInMinorUnits(@NonNull javax.money.MonetaryAmount amount) protected StringgetApplicationId(com.broadleafcommerce.data.tracking.core.context.ContextInfo context) getBroadleafMultiTenantMetadata(@NonNull SessionRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected AdyenConfigurationPropertiesprotected StringgetTenantId(com.broadleafcommerce.data.tracking.core.context.ContextInfo context) protected com.broadleafcommerce.common.extension.TypeFactory
-
Constructor Details
-
DefaultAdyenSessionService
public DefaultAdyenSessionService(AdyenProvider adyenProvider, AdyenConfigurationProperties configurationProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
createSession
public Map<String,Object> createSession(@NonNull @NonNull SessionRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:AdyenSessionServiceThis method is responsible for calling Adyen init-session endpoint.- Specified by:
createSessionin interfaceAdyenSessionService- Parameters:
request- The request to create a session.contextInfo- context information around the multi-tenant state- Returns:
- the response from Adyen API.
-
buildCreateSessionRequest
protected CreateCheckoutSessionRequest buildCreateSessionRequest(@NonNull @NonNull SessionRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
addSavedPaymentMethodAttributes
protected void addSavedPaymentMethodAttributes(CreateCheckoutSessionRequest createCheckoutSessionRequest, SessionRequest request) this method expected to be invoked in 2 places: 1st during checkout process, in that case mode should be "ask for consent" - checkbox on "drop-in" plugin will be shown. 2nd during add saved payment method in payments section of user profile - no checkbox but always save.- Parameters:
createCheckoutSessionRequest-request-
-
convertAmount
-
getAmountInMinorUnits
-
getBroadleafMultiTenantMetadata
protected Map<String,String> getBroadleafMultiTenantMetadata(@NonNull @NonNull SessionRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
getTenantId
@Nullable protected String getTenantId(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
getApplicationId
@Nullable protected String getApplicationId(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) -
getAdyenProvider
-
getConfigurationProperties
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-