Skip to content

Commit 44c374a

Browse files
authored
Removed: Deprecated entity captureBillingAccountPayments since release 17.12. (#131)
(OFBIZ-11435) Also, added deprecated since tag in some old entities and fields. This is done as per current policy to deprecate entities/services. Thanks Pierre for reporting and Jacques for review.
1 parent 60c78d2 commit 44c374a

File tree

5 files changed

+3
-102
lines changed

5 files changed

+3
-102
lines changed

applications/accounting/servicedef/services_paymentmethod.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -351,18 +351,6 @@ under the License.
351351
<attribute name="captureAmount" type="BigDecimal" mode="IN" optional="false"/>
352352
<attribute name="processResult" type="String" mode="OUT" optional="false"/>
353353
</service>
354-
355-
<service name="captureBillingAccountPayment" engine="java"
356-
location="org.apache.ofbiz.accounting.payment.PaymentGatewayServices" invoke="captureBillingAccountPayment" auth="true">
357-
<description>Records a settlement or payment of an invoice by a billing account for the given captureAmount</description>
358-
<deprecated use-instead="captureBillingAccountPayments" since="Releases 17.12"/>
359-
<attribute name="invoiceId" type="String" mode="IN" optional="false"/>
360-
<attribute name="billingAccountId" type="String" mode="IN" optional="false"/>
361-
<attribute name="captureAmount" type="BigDecimal" mode="IN" optional="false"/>
362-
<attribute name="orderId" type="String" mode="IN" optional="true"/>
363-
<attribute name="paymentId" type="String" mode="OUT" optional="false"/>
364-
<attribute name="paymentGatewayResponseId" type="String" mode="OUT" optional="true"/>
365-
</service>
366354
<service name="captureBillingAccountPayments" engine="java"
367355
location="org.apache.ofbiz.accounting.payment.PaymentGatewayServices" invoke="captureBillingAccountPayments" auth="true">
368356
<description>Applies (part of) the unapplied payment applications associated to the billing account to the given invoice.</description>

applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,94 +1525,6 @@ public static Map<String, Object> processCaptureSplitPayment(DispatchContext dct
15251525
}
15261526
return ServiceUtil.returnSuccess();
15271527
}
1528-
1529-
// Deprecated: use captureBillingAccountPayments instead of this.
1530-
public static Map<String, Object> captureBillingAccountPayment(DispatchContext dctx, Map<String, ? extends Object> context) {
1531-
Delegator delegator = dctx.getDelegator();
1532-
LocalDispatcher dispatcher = dctx.getDispatcher();
1533-
GenericValue userLogin = (GenericValue) context.get("userLogin");
1534-
String invoiceId = (String) context.get("invoiceId");
1535-
String billingAccountId = (String) context.get("billingAccountId");
1536-
BigDecimal captureAmount = (BigDecimal) context.get("captureAmount");
1537-
String orderId = (String) context.get("orderId");
1538-
Locale locale = (Locale) context.get("locale");
1539-
Map<String, Object> results = ServiceUtil.returnSuccess();
1540-
1541-
try {
1542-
// Note that the partyIdFrom of the Payment should be the partyIdTo of the invoice, since you're receiving a payment from the party you billed
1543-
GenericValue invoice = EntityQuery.use(delegator).from("Invoice").where("invoiceId", invoiceId).queryOne();
1544-
Map<String, Object> paymentParams = UtilMisc.<String, Object>toMap("paymentTypeId", "CUSTOMER_PAYMENT", "paymentMethodTypeId", "EXT_BILLACT",
1545-
"partyIdFrom", invoice.getString("partyId"), "partyIdTo", invoice.getString("partyIdFrom"),
1546-
"statusId", "PMNT_RECEIVED", "effectiveDate", UtilDateTime.nowTimestamp());
1547-
paymentParams.put("amount", captureAmount);
1548-
paymentParams.put("currencyUomId", invoice.getString("currencyUomId"));
1549-
paymentParams.put("userLogin", userLogin);
1550-
Map<String, Object> tmpResult = dispatcher.runSync("createPayment", paymentParams);
1551-
if (ServiceUtil.isError(tmpResult)) {
1552-
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(tmpResult));
1553-
}
1554-
1555-
String paymentId = (String) tmpResult.get("paymentId");
1556-
tmpResult = dispatcher.runSync("createPaymentApplication", UtilMisc.<String, Object>toMap("paymentId", paymentId, "invoiceId", invoiceId, "billingAccountId", billingAccountId,
1557-
"amountApplied", captureAmount, "userLogin", userLogin));
1558-
if (ServiceUtil.isError(tmpResult)) {
1559-
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(tmpResult));
1560-
}
1561-
if (paymentId == null) {
1562-
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
1563-
"AccountingNoPaymentCreatedForInvoice",
1564-
UtilMisc.toMap("invoiceId", invoiceId, "billingAccountId", billingAccountId), locale));
1565-
}
1566-
results.put("paymentId", paymentId);
1567-
1568-
if (orderId != null && captureAmount.compareTo(BigDecimal.ZERO) > 0) {
1569-
// Create a paymentGatewayResponse, if necessary
1570-
GenericValue order = EntityQuery.use(delegator).from("OrderHeader").where("orderId", orderId).queryOne();
1571-
if (order == null) {
1572-
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
1573-
"AccountingNoPaymentGatewayResponseCreatedForInvoice",
1574-
UtilMisc.toMap("invoiceId", invoiceId, "billingAccountId", billingAccountId,
1575-
"orderId", orderId), locale));
1576-
}
1577-
// See if there's an orderPaymentPreference - there should be only one OPP for EXT_BILLACT per order
1578-
GenericValue orderPaymentPreference = EntityQuery.use(delegator).from("OrderPaymentPreference").where("orderId", orderId, "paymentMethodTypeId", "EXT_BILLACT").queryFirst();
1579-
if (orderPaymentPreference != null) {
1580-
1581-
// Check the productStore setting to see if we need to do this explicitly
1582-
GenericValue productStore = order.getRelatedOne("ProductStore", false);
1583-
if (productStore.getString("manualAuthIsCapture") == null || (! "Y".equalsIgnoreCase(productStore.getString("manualAuthIsCapture")))) {
1584-
String responseId = delegator.getNextSeqId("PaymentGatewayResponse");
1585-
GenericValue pgResponse = delegator.makeValue("PaymentGatewayResponse");
1586-
pgResponse.set("paymentGatewayResponseId", responseId);
1587-
pgResponse.set("paymentServiceTypeEnumId", CAPTURE_SERVICE_TYPE);
1588-
pgResponse.set("orderPaymentPreferenceId", orderPaymentPreference.getString("orderPaymentPreferenceId"));
1589-
pgResponse.set("paymentMethodTypeId", "EXT_BILLACT");
1590-
pgResponse.set("transCodeEnumId", "PGT_CAPTURE");
1591-
pgResponse.set("amount", captureAmount);
1592-
pgResponse.set("currencyUomId", invoice.getString("currencyUomId"));
1593-
pgResponse.set("transactionDate", UtilDateTime.nowTimestamp());
1594-
// referenceNum holds the relation to the order.
1595-
// todo: Extend PaymentGatewayResponse with a billingAccountId field?
1596-
pgResponse.set("referenceNum", billingAccountId);
1597-
1598-
// save the response
1599-
savePgr(dctx, pgResponse);
1600-
1601-
// Update the orderPaymentPreference
1602-
orderPaymentPreference.set("statusId", "PAYMENT_SETTLED");
1603-
orderPaymentPreference.store();
1604-
1605-
results.put("paymentGatewayResponseId", responseId);
1606-
}
1607-
}
1608-
}
1609-
} catch (GenericEntityException | GenericServiceException ex) {
1610-
return ServiceUtil.returnError(ex.getMessage());
1611-
}
1612-
1613-
return results;
1614-
}
1615-
16161528
public static Map<String, Object> captureBillingAccountPayments(DispatchContext dctx, Map<String, ? extends Object> context) {
16171529
Delegator delegator = dctx.getDelegator();
16181530
String invoiceId = (String) context.get("invoiceId");

applications/datamodel/entitydef/party-entitymodel.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2796,7 +2796,7 @@ under the License.
27962796
<field name="height" type="floating-point"></field>
27972797
<field name="weight" type="floating-point"></field>
27982798
<field name="mothersMaidenName" type="long-varchar" encrypt="true"></field>
2799-
<field name="oldMaritalStatus" type="indicator" col-name="MARITAL_STATUS"><description>Deprecated since branch release: use martialStatusEnumId</description></field>
2799+
<field name="oldMaritalStatus" type="indicator" col-name="MARITAL_STATUS"><description>Deprecated since branch release: Upcoming branch, use martialStatusEnumId</description></field>
28002800
<field name="maritalStatusEnumId" type="id"/>
28012801
<field name="socialSecurityNumber" type="long-varchar" encrypt="true"></field>
28022802
<field name="passportNumber" type="long-varchar" encrypt="true"></field>

applications/datamodel/entitydef/product-entitymodel.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3643,6 +3643,7 @@ under the License.
36433643
<entity entity-name="OldProductPromoCodeEmail" table-name="PRODUCT_PROMO_CODE_EMAIL"
36443644
package-name="org.apache.ofbiz.product.promo"
36453645
title="Product Promotion Email">
3646+
<description>Deprecated since branch release: Upcoming branch. Use ProdPromoCodeContactMech instead</description>
36463647
<field name="productPromoCodeId" type="id"></field>
36473648
<field name="emailAddress" type="email"></field>
36483649
<prim-key field="productPromoCodeId"/>

applications/datamodel/entitydef/shipment-entitymodel.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ under the License.
325325
<entity entity-name="OldPicklistStatusHistory" table-name="PICKLIST_STATUS_HISTORY"
326326
package-name="org.apache.ofbiz.shipment.picklist"
327327
title="Picklist Status History">
328-
<description>Deprecated since branch release: PicklistStatus instead</description>
328+
<description>Deprecated since branch release: Upcoming branch. Use PicklistStatus instead</description>
329329
<field name="picklistId" type="id"></field>
330330
<field name="changeDate" type="date-time"></field>
331331
<field name="changeUserLoginId" type="id-vlong"></field>

0 commit comments

Comments
 (0)