Author: mor
Date: Thu Jul 30 09:32:58 2009
New Revision: 799219
URL:
http://svn.apache.org/viewvc?rev=799219&view=revLog:
This script is only used on one page checkout. Modified it a bit since Credit Card payment method is the only option that is available on one page.
Modified:
ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy
Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy?rev=799219&r1=799218&r2=799219&view=diff==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy Thu Jul 30 09:32:58 2009
@@ -46,18 +46,16 @@
}
creditCards = [];
- paymentMethod = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findList("PaymentMethod", EntityCondition.makeCondition([partyId : party.partyId]), null, ["fromDate"], null, false)));
+ paymentMethod = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findList("PaymentMethod", EntityCondition.makeCondition([partyId : party.partyId, paymentMethodTypeId : "CREDIT_CARD"]), null, ["fromDate"], null, false)));
if (paymentMethod) {
creditCard = paymentMethod.getRelatedOne("CreditCard");
- if (creditCard) {
- context.paymentMethodTypeId = "CREDIT_CARD";
- context.cardNumber = creditCard.cardNumber;
- context.paymentMethodId = creditCard.paymentMethodId;
- context.firstNameOnCard = creditCard.firstNameOnCard;
- context.lastNameOnCard = creditCard.lastNameOnCard;
- context.expMonth = (creditCard.expireDate).substring(0, 2);
- context.expYear = (creditCard.expireDate).substring(3);
- }
+ context.paymentMethodTypeId = "CREDIT_CARD";
+ context.cardNumber = creditCard.cardNumber;
+ context.paymentMethodId = creditCard.paymentMethodId;
+ context.firstNameOnCard = creditCard.firstNameOnCard;
+ context.lastNameOnCard = creditCard.lastNameOnCard;
+ context.expMonth = (creditCard.expireDate).substring(0, 2);
+ context.expYear = (creditCard.expireDate).substring(3);
}
if (shipToContactMechId) {
if (billToContactMechId && billToContactMechId.equals(shipToContactMechId)) {