Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * #%L
  * BroadleafCommerce Framework
  * %%
  * Copyright (C) 2009 - 2013 Broadleaf Commerce
  * %%
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
package org.broadleafcommerce.core.payment.service;

Elbert Bautista (elbertbautista)
public interface OrderToPaymentRequestDTOService {


This translates an Order of org.broadleafcommerce.common.payment.PaymentType.CREDIT_CARD into a PaymentRequestDTO. This method assumes that this translation will apply to a final payment which means that the transaction amount for the returned org.broadleafcommerce.common.payment.dto.PaymentRequestDTO will be org.broadleafcommerce.core.order.domain.Order.getTotalAfterAppliedPayments() It assumes that all other payments (e.g. gift cards/account credit) have already been applied to the org.broadleafcommerce.core.order.domain.Order.

order the org.broadleafcommerce.core.order.domain.Order to be translated
a org.broadleafcommerce.common.payment.dto.PaymentRequestDTO based on the properties of order. This will only utilize the payments that are of type org.broadleafcommerce.common.payment.PaymentType.CREDIT_CARD
    public PaymentRequestDTO translateOrder(Order order);

Utilizes the org.broadleafcommerce.core.payment.domain.PaymentTransaction.getAdditionalFields() map to populate necessary request parameters on the resulting org.broadleafcommerce.common.payment.dto.PaymentRequestDTO. These additional fields are then used by the payment gateway to construct additional requests to the payment gateway. For instance, this might be use to refund or void the given paymentTransaction

transactionAmount the amount that should be placed on org.broadleafcommerce.common.payment.dto.PaymentRequestDTO.getTransactionTotal()
paymentTransaction the transaction whose additional fields should be placed on org.broadleafcommerce.common.payment.dto.PaymentRequestDTO.getAdditionalFields() for the gateway to use
a new org.broadleafcommerce.common.payment.dto.PaymentRequestDTO populated with the additional fields from paymentTransaction and the amount from transactionAmount
    public PaymentRequestDTO translatePaymentTransaction(Money transactionAmountPaymentTransaction paymentTransaction);
New to GrepCode? Check out our FAQ X