Class ExternalBraintreeProvider
java.lang.Object
com.broadleafcommerce.braintree.provider.external.AbstractExternalProvider
com.broadleafcommerce.braintree.provider.external.ExternalBraintreeProvider
- All Implemented Interfaces:
BraintreeProvider
public class ExternalBraintreeProvider
extends AbstractExternalProvider
implements BraintreeProvider
-
Constructor Summary
ConstructorsConstructorDescriptionExternalBraintreeProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ExternalBraintreeProviderProperties providerProperties, BraintreeConfigurationProperties configProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionauthorizeAndCaptureTransaction(@NonNull BraintreePaymentRequest braintreePaymentRequest, @NonNull String nonce, String applicationId, String tenantId) Executes theDefaultTransactionTypes.AUTHORIZE_AND_CAPTUREtransactions.authorizeTransaction(@NonNull BraintreePaymentRequest braintreePaymentRequest, @NonNull String nonce, String applicationId, String tenantId) Executes theDefaultTransactionTypes.AUTHORIZEtransactions.buildBraintreeAuthorizeAndCaptureTransactionRequest(BraintreePaymentRequest braintreePaymentRequest, String nonce, String applicationId, String tenantId) protected BraintreeAuthorizeTransactionRequestbuildBraintreeAuthorizeTransactionRequest(BraintreePaymentRequest braintreePaymentRequest, String nonce, String applicationId, String tenantId) protected BraintreeCaptureTransactionRequestbuildBraintreeCaptureTransactionRequest(@NonNull BraintreePaymentRequest braintreePaymentRequest, String transactionId) protected BraintreeRefundTransactionRequestbuildBraintreeRefundTransactionRequest(String transactionId, BraintreePaymentRequest braintreePaymentRequest) buildBraintreeReverseAuthorizeTransactionRequest(@NonNull BraintreePaymentRequest braintreePaymentRequest, String transactionId) protected BraintreeSearchTransactionRequestbuildBraintreeSearchTransactionRequest(String transactionId) protected BraintreeGenerateTokenRequestbuildGenerateTokenRequest(String customerId, String applicationId, String tenantId) captureTransaction(@NonNull String transactionId, @NonNull BraintreePaymentRequest braintreePaymentRequest, String applicationId, String tenantId) Executes theDefaultTransactionTypes.CAPTUREtransactions.protected BraintreeResponsecheckError(BraintreeResponse braintreeResponse) generateClientToken(String customerId, String applicationId, String tenantId) This method generate Client Token which will be used on the Client Side integration for Drop-in callsprotected StringgetApiToken(String applicationId, String tenantId) protected org.springframework.web.util.UriComponentsBuilderprotected BraintreeConfigurationPropertiesprotected ExternalBraintreeProviderPropertiesgetTransactionStatus(@NonNull String transactionId, String applicationId, String tenantId) Get current status of the transaction.protected com.broadleafcommerce.common.extension.TypeFactoryprotected voidpopulateCustomFields(List<CustomField> customFields, BraintreePaymentRequest braintreePaymentRequest) refundTransaction(@NonNull String transactionId, @NonNull BraintreePaymentRequest braintreePaymentRequest, String applicationId, String tenantId) Executes theDefaultTransactionTypes.REFUNDtransactions.reverseAuthorizeTransaction(@NonNull String transactionId, @NonNull BraintreePaymentRequest braintreePaymentRequest, String applicationId, String tenantId) Executes theDefaultTransactionTypes.REVERSE_AUTHtransactions.Methods inherited from class com.broadleafcommerce.braintree.provider.external.AbstractExternalProvider
executeRequest, getObjectMapper, getWebClient, uriVars
-
Constructor Details
-
ExternalBraintreeProvider
public ExternalBraintreeProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ExternalBraintreeProviderProperties providerProperties, BraintreeConfigurationProperties configProperties, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
generateClientToken
public BraintreeGenerateTokenResponse generateClientToken(@Nullable String customerId, @Nullable String applicationId, @Nullable String tenantId) Description copied from interface:BraintreeProviderThis method generate Client Token which will be used on the Client Side integration for Drop-in calls- Specified by:
generateClientTokenin interfaceBraintreeProvider- Parameters:
customerId- Only applies to the Drop-in UI; not needed when generating client tokens for custom integrations. A string value representing an existing customer in your Vault. Passing this option allows customers to manage their vaulted payment methods via the Drop-in UIapplicationId- the application idtenantId- the tenant id- Returns:
- BraintreeGenerateTokenResponse which contains all authorization and configuration information your client needs to initialize the client SDK to communicate with Braintree
-
authorizeTransaction
public BraintreeResponse authorizeTransaction(@NonNull @NonNull BraintreePaymentRequest braintreePaymentRequest, @NonNull @NonNull String nonce, @Nullable String applicationId, @Nullable String tenantId) Description copied from interface:BraintreeProviderExecutes theDefaultTransactionTypes.AUTHORIZEtransactions.- Specified by:
authorizeTransactionin interfaceBraintreeProvider- Parameters:
braintreePaymentRequest- the request bodynonce- - payment_method_nonce representing customer payment authorization. This value comes from the Client Side and can be generated by Drop-in, PayPal or any other payment methods supported by BraintreeapplicationId- the application idtenantId- the tenant id- Returns:
- the response from Braintree API
-
authorizeAndCaptureTransaction
public BraintreeResponse authorizeAndCaptureTransaction(@NonNull @NonNull BraintreePaymentRequest braintreePaymentRequest, @NonNull @NonNull String nonce, @Nullable String applicationId, @Nullable String tenantId) Description copied from interface:BraintreeProviderExecutes theDefaultTransactionTypes.AUTHORIZE_AND_CAPTUREtransactions.- Specified by:
authorizeAndCaptureTransactionin interfaceBraintreeProvider- Parameters:
braintreePaymentRequest- the request bodynonce- the nonce from Client SDKapplicationId- the application idtenantId- the tenant id- Returns:
- the response from Braintree API
-
captureTransaction
public BraintreeResponse captureTransaction(@NonNull @NonNull String transactionId, @NonNull @NonNull BraintreePaymentRequest braintreePaymentRequest, @Nullable String applicationId, @Nullable String tenantId) Description copied from interface:BraintreeProviderExecutes theDefaultTransactionTypes.CAPTUREtransactions.- Specified by:
captureTransactionin interfaceBraintreeProvider- Parameters:
transactionId- the transaction id to capturebraintreePaymentRequest- the request bodyapplicationId- the application idtenantId- the tenant id- Returns:
- the response from Braintree API
-
reverseAuthorizeTransaction
public BraintreeResponse reverseAuthorizeTransaction(@NonNull @NonNull String transactionId, @NonNull @NonNull BraintreePaymentRequest braintreePaymentRequest, @Nullable String applicationId, @Nullable String tenantId) Description copied from interface:BraintreeProviderExecutes theDefaultTransactionTypes.REVERSE_AUTHtransactions.- Specified by:
reverseAuthorizeTransactionin interfaceBraintreeProvider- Parameters:
transactionId- the transaction id to reverseapplicationId- the application idtenantId- the tenant id- Returns:
- the response from Braintree API
-
refundTransaction
public BraintreeResponse refundTransaction(@NonNull @NonNull String transactionId, @NonNull @NonNull BraintreePaymentRequest braintreePaymentRequest, @Nullable String applicationId, @Nullable String tenantId) Description copied from interface:BraintreeProviderExecutes theDefaultTransactionTypes.REFUNDtransactions.- Specified by:
refundTransactionin interfaceBraintreeProvider- Parameters:
transactionId- the transaction id to reversebraintreePaymentRequest- the request bodyapplicationId- the application idtenantId- the tenant id- Returns:
- the response from Braintree API
-
getTransactionStatus
public BraintreeResponse getTransactionStatus(@NonNull @NonNull String transactionId, @Nullable String applicationId, @Nullable String tenantId) Description copied from interface:BraintreeProviderGet current status of the transaction.- Specified by:
getTransactionStatusin interfaceBraintreeProvider- Parameters:
transactionId- the transaction id to reverseapplicationId- the application idtenantId- the tenant id- Returns:
- the response from Braintree API
-
getApiUrlBuilder
protected org.springframework.web.util.UriComponentsBuilder getApiUrlBuilder() -
checkError
-
getApiToken
-
buildGenerateTokenRequest
protected BraintreeGenerateTokenRequest buildGenerateTokenRequest(@Nullable String customerId, @Nullable String applicationId, @Nullable String tenantId) -
buildBraintreeReverseAuthorizeTransactionRequest
protected BraintreeReverseAuthorizeTransactionRequest buildBraintreeReverseAuthorizeTransactionRequest(@NonNull @NonNull BraintreePaymentRequest braintreePaymentRequest, String transactionId) -
buildBraintreeAuthorizeTransactionRequest
protected BraintreeAuthorizeTransactionRequest buildBraintreeAuthorizeTransactionRequest(BraintreePaymentRequest braintreePaymentRequest, String nonce, @Nullable String applicationId, @Nullable String tenantId) -
buildBraintreeAuthorizeAndCaptureTransactionRequest
protected BraintreeAuthorizeAndCaptureTransactionRequest buildBraintreeAuthorizeAndCaptureTransactionRequest(BraintreePaymentRequest braintreePaymentRequest, String nonce, @Nullable String applicationId, @Nullable String tenantId) -
buildBraintreeCaptureTransactionRequest
protected BraintreeCaptureTransactionRequest buildBraintreeCaptureTransactionRequest(@NonNull @NonNull BraintreePaymentRequest braintreePaymentRequest, String transactionId) -
buildBraintreeRefundTransactionRequest
protected BraintreeRefundTransactionRequest buildBraintreeRefundTransactionRequest(String transactionId, BraintreePaymentRequest braintreePaymentRequest) -
buildBraintreeSearchTransactionRequest
protected BraintreeSearchTransactionRequest buildBraintreeSearchTransactionRequest(String transactionId) -
populateCustomFields
protected void populateCustomFields(List<CustomField> customFields, BraintreePaymentRequest braintreePaymentRequest) -
getProviderProperties
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getConfigProperties
-