Payment service added
This commit is contained in:
@@ -39,9 +39,17 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package nl.testinstance.store;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author sven
|
||||
*/
|
||||
@Controller
|
||||
public class HomeController {
|
||||
@RequestMapping("/")
|
||||
public String index() {
|
||||
return "index.html";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package nl.testinstance.store;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author sven
|
||||
*/
|
||||
public class OrdersService {
|
||||
private PaymentService paymentService;
|
||||
|
||||
public OrdersService(PaymentService paymentService) {
|
||||
this.paymentService = paymentService;
|
||||
}
|
||||
public void placeOrder() {
|
||||
paymentService.processPayment( amount: 10);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package nl.testinstance.store;
|
||||
|
||||
public interface PaymentService {
|
||||
void processPayment(double amount);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
|
||||
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
|
||||
*/
|
||||
|
||||
package nl.testinstance.store;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author sven
|
||||
*/
|
||||
public class StripePaymentService implements PaymentService {
|
||||
@Override
|
||||
public void processPayment(double amount) {
|
||||
System.out.println("STIRPE");
|
||||
System.out.println("Amount:" + amount);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<!doctype html>
|
||||
<html lang="nl">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Store</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello world</h1>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user