Skip to content

Commit

Permalink
Merge pull request #51 from Adyen/develop
Browse files Browse the repository at this point in the history
Merge develop for 3.1.0
  • Loading branch information
lancergr authored Jul 10, 2017
2 parents d1171fd + 0d609a6 commit 6dc8a0d
Show file tree
Hide file tree
Showing 32 changed files with 750 additions and 467 deletions.

Large diffs are not rendered by default.

Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
<c:if test="${storedCard.card.expiryMonth lt 10}">0</c:if>
${fn:escapeXml(storedCard.card.expiryMonth)}&nbsp;/&nbsp;${fn:escapeXml(storedCard.card.expiryYear)}
</li>
<c:if test="${storedCard.card.billingAddress ne null}">
<li>${fn:escapeXml(storedCard.card.billingAddress.street)}</li>
<li>${fn:escapeXml(storedCard.card.billingAddress.city)}</li>
<li>${fn:escapeXml(storedCard.card.billingAddress.country)}&nbsp;${fn:escapeXml(storedCard.card.billingAddress.postalCode)}</li>
<c:if test="${storedCard.billingAddress ne null}">
<li>${fn:escapeXml(storedCard.billingAddress.street)}</li>
<li>${fn:escapeXml(storedCard.billingAddress.city)}</li>
<li>${fn:escapeXml(storedCard.billingAddress.country)}&nbsp;${fn:escapeXml(storedCard.billingAddress.postalCode)}</li>
</c:if>
</ul>
<div class="account-cards-actions pull-left">
Expand All @@ -57,10 +57,10 @@
<br>
<c:if test="${storedCard.card.expiryMonth lt 10}">0</c:if>
${fn:escapeXml(storedCard.card.expiryMonth)}&nbsp;/&nbsp;${fn:escapeXml(storedCard.card.expiryYear)}
<c:if test="${storedCard.card.billingAddress ne null}">
<br>${fn:escapeXml(storedCard.card.billingAddress.street)}
<br>${fn:escapeXml(storedCard.card.billingAddress.city)}
<br>${fn:escapeXml(storedCard.card.billingAddress.country)}&nbsp;${fn:escapeXml(storedCard.card.billingAddress.postalCode)}
<c:if test="${storedCard.billingAddress ne null}">
<br>${fn:escapeXml(storedCard.billingAddress.street)}
<br>${fn:escapeXml(storedCard.billingAddress.city)}
<br>${fn:escapeXml(storedCard.billingAddress.country)}&nbsp;${fn:escapeXml(storedCard.billingAddress.postalCode)}
</c:if>
</div>
<c:url value="/my-account/stored-cards/remove" var="removePaymentActionUrl"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,46 +16,49 @@
<template:page pageTitle="${pageTitle}" hideHeaderLinks="true">
<jsp:attribute name="pageScripts">
<script type="text/javascript" src="${cseUrl}"></script>
<script type="text/javascript" src="${dfUrl}"></script>

<script type="text/javascript">
<c:if test="${not empty allowedCards}">
//Set the allowed cards
var allowedCards = [];
<c:forEach items="${allowedCards}" var="allowedCard">
allowedCards.push("${allowedCard.code}");
</c:forEach>
var encryptedForm = AdyenCheckout.createForm();
var cardLogosContainer = document.getElementById('cardLogos');
AdyenCheckout.enableCardTypeDetection(allowedCards, cardLogosContainer, encryptedForm);
//Set the allowed cards
var allowedCards = [];
<c:forEach items="${allowedCards}" var="allowedCard">
allowedCards.push( "${allowedCard.code}" );
</c:forEach>
var encryptedForm = AdyenCheckout.createForm();
var cardLogosContainer = document.getElementById( 'cardLogos' );
AdyenCheckout.enableCardTypeDetection( allowedCards, cardLogosContainer, encryptedForm );
</c:if>
<c:forEach items="${storedCards}" var="storedCard">
AdyenCheckout.createOneClickForm("${storedCard.recurringDetailReference}");
AdyenCheckout.createOneClickForm( "${storedCard.recurringDetailReference}" );
</c:forEach>
//Handle form submission
$(".submit_silentOrderPostForm").click(function (event) {
if (!AdyenCheckout.validateForm()) {
$( ".submit_silentOrderPostForm" ).click( function ( event ) {
if ( !AdyenCheckout.validateForm() ) {
return false;
}
AdyenCheckout.setCustomPaymentMethodValues();
$("#adyen-encrypted-form").submit();
});
$( "#adyen-encrypted-form" ).submit();
} );
<c:if test="${not empty selectedPaymentMethod}">
AdyenCheckout.togglePaymentMethod("${selectedPaymentMethod}");
AdyenCheckout.togglePaymentMethod( "${selectedPaymentMethod}" );
</c:if>
// Toggle payment method specific areas (credit card form and issuers list)
$('input[type=radio][name=paymentMethod]').change(function () {
$( 'input[type=radio][name=paymentMethod]' ).change( function () {
var paymentMethod = this.value;
AdyenCheckout.togglePaymentMethod(paymentMethod);
});
AdyenCheckout.togglePaymentMethod( paymentMethod );
} );
AdyenCheckout.createDobDatePicker( "p_method_adyen_hpp_dob" );
AdyenCheckout.createDobDatePicker("p_method_adyen_hpp_dob");
AdyenCheckout.createDfValue();
</script>
</jsp:attribute>

Expand All @@ -82,14 +85,15 @@
<form:hidden path="issuerId"/>
<form:hidden path="dob"/>
<form:hidden path="socialSecurityNumber"/>
<form:hidden path="dfValue"/>

<div class="fieldset">
<dl class="sp-methods" id="checkout-payment-method-load">
<c:if test="${not empty allowedCards}">
<dt id="dt_method_adyen_cc">
<input id="p_method_adyen_cc" value="adyen_cc" type="radio"
name="paymentMethod" title="Credit Card"
<c:if test="${selectedPaymentMethod == 'adyen_cc'}"> checked </c:if>
<c:if test="${selectedPaymentMethod == 'adyen_cc'}"> checked </c:if>
autocomplete="off">
<label for="p_method_adyen_cc">
<span>Credit Card</span>
Expand Down Expand Up @@ -208,7 +212,7 @@
value="${cardReference}" type="radio"
name="paymentMethod" title="Credit Card"
autocomplete="off"
<c:if test="${selectedPaymentMethod == cardReference}"> checked </c:if>
<c:if test="${selectedPaymentMethod == cardReference}"> checked </c:if>
>
<img src="https://live.adyen.com/hpp/img/pm/${storedCard.variant}.png"/>
<label for="p_method_adyen_oneclick_${storedCard.recurringDetailReference}">
Expand Down Expand Up @@ -277,7 +281,7 @@
value="${paymentMethod.brandCode}" type="radio"
name="paymentMethod" title="${paymentMethod.name}"
autocomplete="off"
<c:if test="${selectedPaymentMethod == paymentMethod.brandCode}"> checked </c:if>
<c:if test="${selectedPaymentMethod == paymentMethod.brandCode}"> checked </c:if>
>
<img src="https://live.adyen.com/hpp/img/pm/${paymentMethod.brandCode}.png"/>
<label for="p_method_adyen_hpp_${paymentMethod.brandCode}">
Expand All @@ -288,7 +292,7 @@
<div id="adyen_hpp_${paymentMethod.brandCode}_container"
class="extra-fields-container">
<select class="issuer-select" tabindex="4"
id ="p_method_adyen_hpp_${paymentMethod.brandCode}_issuer">
id="p_method_adyen_hpp_${paymentMethod.brandCode}_issuer">
<option value="" label="Please select Issuer"/>
<c:forEach items="${paymentMethod.issuers}"
var="issuer">
Expand All @@ -305,13 +309,13 @@
class="extra-fields-container">

<dt>
<label for="p_method_adyen_hpp_${paymentMethod.brandCode}_dob">
<span>Date of birth</span>
</label>
<input id="p_method_adyen_hpp_${paymentMethod.brandCode}_dob"
class="p_method_adyen_hpp_dob"
type="text"
title="date of birth">
<label for="p_method_adyen_hpp_${paymentMethod.brandCode}_dob">
<span>Date of birth</span>
</label>
<input id="p_method_adyen_hpp_${paymentMethod.brandCode}_dob"
class="p_method_adyen_hpp_dob"
type="text"
title="date of birth">
</dt>

<c:if test="${showSocialSecurityNumber}">
Expand All @@ -330,10 +334,44 @@
</dl>
</c:if>
</dt>

</c:if>
</c:forEach>

<c:if test="${showBoleto}">
<dt id="dt_method_adyen_boleto">
<input id="p_method_adyen_boleto"
value="boleto" type="radio"
name="paymentMethod" title="Boleto"
autocomplete="off"
<c:if test="${selectedPaymentMethod == 'boleto'}"> checked </c:if>
>
<img src="https://live.adyen.com/hpp/img/pm/boleto.png"/>
<label for="p_method_adyen_boleto">
<span>Boleto</span>
</label>
</dt>
<div id="dd_method_boleto"
class="extra-fields-container">

<ul class="form-list">
<li class="adyen_payment_input_fields">
<label class="required">First name</label>
<input type="text" name="firstName" value="${cartData.deliveryAddress.firstName}"/>
</li>
<li class="adyen_payment_input_fields">
<label class="required">Last name</label>
<input type="text" name="lastName" value="${cartData.deliveryAddress.lastName}"/>
</li>
<li class="adyen_payment_input_fields">
<label class="required">Social Security Number</label>

<input id="p_method_adyen_hpp_boleto_ssn"
class="p_method_adyen_hpp_ssn"
type="text">
</li>
</ul>
</div>
</c:if>
</dl>
</div>
</form:form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ var AdyenCheckout = (function () {

$("#dd_method_" + paymentMethod).show();
$("#adyen_hpp_" + paymentMethod + "_container").show();
}
};

var createDfValue = function() {
dfDo("dfValue");
};

return {
enableCardTypeDetection: enableCardTypeDetection,
Expand All @@ -173,6 +177,7 @@ var AdyenCheckout = (function () {
createOneClickForm: createOneClickForm,
createForm: createForm,
createDobDatePicker: createDobDatePicker,
togglePaymentMethod: togglePaymentMethod
togglePaymentMethod: togglePaymentMethod,
createDfValue: createDfValue
}
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ module.name=platform-module
name=adyenv6b2ccheckoutaddon
releasedate=20170509 1903
vendor=adyen
version=3.0.0
version.api=3.0.0
version=3.1.0
version.api=3.1.0
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,19 @@ public interface AdyenCheckoutFacade {
*/
OrderData handleHPPResponse(HttpServletRequest request) throws SignatureException;

@Deprecated
OrderData authoriseCardPayment(HttpServletRequest request, CartData cartData) throws Exception;

/**
* Authorizes a CC payment
* Authorizes a payment using Adyen API
* In case of authorized, it places an order from cart
*
* @param request HTTP Request object
* @param cartData cartData object
* @return OrderData
* @throws Exception In case order failed to be created
*/
OrderData authoriseCardPayment(HttpServletRequest request, CartData cartData) throws Exception;
OrderData authorisePayment(HttpServletRequest request, CartData cartData) throws Exception;

/**
* Handles an 3D response
Expand Down Expand Up @@ -118,6 +121,12 @@ public interface AdyenCheckoutFacade {
*/
void initializeCheckoutData(Model model);

/**
* Returns whether Boleto should be shown as an available payment method on the checkout page
* Relevant for Brasil
*/
boolean showBoleto();

/**
* Returns whether CC can be stored depending on the recurring contract settings
*/
Expand Down
Loading

0 comments on commit 6dc8a0d

Please sign in to comment.