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_CAPTURE
transactions.authorizeTransaction
(@NonNull BraintreePaymentRequest braintreePaymentRequest, @NonNull String nonce, String applicationId, String tenantId) Executes theDefaultTransactionTypes.AUTHORIZE
transactions.buildBraintreeAuthorizeAndCaptureTransactionRequest
(BraintreePaymentRequest braintreePaymentRequest, String nonce, String applicationId, String tenantId) protected BraintreeAuthorizeTransactionRequest
buildBraintreeAuthorizeTransactionRequest
(BraintreePaymentRequest braintreePaymentRequest, String nonce, String applicationId, String tenantId) protected BraintreeCaptureTransactionRequest
buildBraintreeCaptureTransactionRequest
(@NonNull BraintreePaymentRequest braintreePaymentRequest, String transactionId) protected BraintreeRefundTransactionRequest
buildBraintreeRefundTransactionRequest
(String transactionId, BraintreePaymentRequest braintreePaymentRequest) buildBraintreeReverseAuthorizeTransactionRequest
(@NonNull BraintreePaymentRequest braintreePaymentRequest, String transactionId) protected BraintreeSearchTransactionRequest
buildBraintreeSearchTransactionRequest
(String transactionId) protected BraintreeGenerateTokenRequest
buildGenerateTokenRequest
(String customerId, String applicationId, String tenantId) captureTransaction
(@NonNull String transactionId, @NonNull BraintreePaymentRequest braintreePaymentRequest, String applicationId, String tenantId) Executes theDefaultTransactionTypes.CAPTURE
transactions.protected BraintreeResponse
checkError
(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 String
getApiToken
(String applicationId, String tenantId) protected org.springframework.web.util.UriComponentsBuilder
protected BraintreeConfigurationProperties
protected ExternalBraintreeProviderProperties
getTransactionStatus
(@NonNull String transactionId, String applicationId, String tenantId) Get current status of the transaction.protected com.broadleafcommerce.common.extension.TypeFactory
protected void
populateCustomFields
(List<CustomField> customFields, BraintreePaymentRequest braintreePaymentRequest) refundTransaction
(@NonNull String transactionId, @NonNull BraintreePaymentRequest braintreePaymentRequest, String applicationId, String tenantId) Executes theDefaultTransactionTypes.REFUND
transactions.reverseAuthorizeTransaction
(@NonNull String transactionId, @NonNull BraintreePaymentRequest braintreePaymentRequest, String applicationId, String tenantId) Executes theDefaultTransactionTypes.REVERSE_AUTH
transactions.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:BraintreeProvider
This method generate Client Token which will be used on the Client Side integration for Drop-in calls- Specified by:
generateClientToken
in 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:BraintreeProvider
Executes theDefaultTransactionTypes.AUTHORIZE
transactions.- Specified by:
authorizeTransaction
in 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:BraintreeProvider
Executes theDefaultTransactionTypes.AUTHORIZE_AND_CAPTURE
transactions.- Specified by:
authorizeAndCaptureTransaction
in 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:BraintreeProvider
Executes theDefaultTransactionTypes.CAPTURE
transactions.- Specified by:
captureTransaction
in 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:BraintreeProvider
Executes theDefaultTransactionTypes.REVERSE_AUTH
transactions.- Specified by:
reverseAuthorizeTransaction
in 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:BraintreeProvider
Executes theDefaultTransactionTypes.REFUND
transactions.- Specified by:
refundTransaction
in 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:BraintreeProvider
Get current status of the transaction.- Specified by:
getTransactionStatus
in 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
-