Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sofort #490

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public SalesExportSubmission() {
this.month = LocalDate.now().getMonthValue()-1;
}

this.includedPaymentMethods = Lists.newArrayList(PaymentMethod.IDEAL, PaymentMethod.SOFORT);
this.includedPaymentMethods = Lists.newArrayList(PaymentMethod.IDEAL);

this.freeProductsIncluded = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public enum PaymentMethod {
*/
IDEAL("ideal", cost -> cost + 0.35),

/**
* User paid his order via Mollie SOFORT.
*/
SOFORT("sofort", cost -> 1.01089 * cost + 0.3025),

/**
* User paid his order via another method.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,6 @@ public String paymentIdeal(RedirectAttributes redirect, @PathVariable String key
return this.payment(redirect, key, PaymentMethod.IDEAL);
}

/**
* Payment method using SOFORT.
*
* @param redirect of type RedirectAttributes
* @param key of type String
*
* @return String string
*/
@GetMapping("/sofort")
public String paymentSofort(RedirectAttributes redirect, @PathVariable String key) {
return this.payment(redirect, key, PaymentMethod.SOFORT);
}

/**
* Assert if an Order is suitable for Payment.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ protected PaymentRequest createMolliePaymentRequestFromOrder(Order order) {

PaymentMethod method;

if (order.getPaymentMethod() == ch.wisv.events.core.model.order.PaymentMethod.IDEAL) {
// if (order.getPaymentMethod() == ch.wisv.events.core.model.order.PaymentMethod.IDEAL) {
method = PaymentMethod.IDEAL;
} else {
method = PaymentMethod.SOFORT;
}
// } else {
// method = PaymentMethod.SOFORT;
// }

String returnUrl = clientUri + "/return/" + order.getPublicReference();
String webhookUrl = clientUri + "/api/v1/orders/status";
Expand Down
28 changes: 0 additions & 28 deletions src/main/resources/templates/webshop/payment/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,6 @@ <h5 class="d-inline mt-0">IDEAL</h5> - Online payment using your
</div>
</div>
</div>
<div class="col-12 col-md-6 mb-4">
<div class="card h-100">
<div class="card-body h-100">
<div class="row h-100">
<div class="col-3 px-3">
<img class="img-thumbnail" th:src="@{/images/icon-sofort.png}" alt="">
</div>
<div class="col-9 h-100">
<div class="row h-100">
<div class="col-12 align-self-start mb-4">
<h5 class="d-inline mt-0">SOFORT</h5> - Predominant online banking method in
countries across Europe.<br>

<span class="text-info">(+ &euro; 0,30 + 1,1% transaction cost)</span>
</div>

<div class="col-12 align-self-end">
<a th:href="@{'/checkout/' + ${order.getPublicReference()} + '/payment/sofort'}"
class="btn btn-block btn-primary">
Pay with SOFORT
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-6 mb-4" th:if="${containsOnlyReservable}">
<div class="card h-100">
<div class="card-body h-100">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ public void testCalculateCostIncludingTransaction_IDEAL() {
assertEquals(expected, actual, 0.001);
}

@Test
public void testCalculateCostIncludingTransaction_SOFORT() {
double cost = 50.0;
PaymentMethod paymentMethod = PaymentMethod.SOFORT;

double expected = 50.85; // Rounded 50.847
double actual = paymentMethod.calculateCostIncludingTransaction(cost);

assertEquals(expected, actual, 0.001);
}

@Test
public void testCalculateCostIncludingTransaction_OTHER() {
double cost = 50.0;
Expand Down
Loading