Skip to content

Commit

Permalink
Remove sofort
Browse files Browse the repository at this point in the history
  • Loading branch information
JoepdeJong committed May 27, 2024
1 parent fe5985b commit 4e66969
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 62 deletions.
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

0 comments on commit 4e66969

Please sign in to comment.