-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #424 from Adyen/feature/AD-276
Feature/ad 276
- Loading branch information
Showing
7 changed files
with
111 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
adyenocc/src/com/adyen/commerce/controllers/PaymentStatusController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package com.adyen.commerce.controllers; | ||
|
||
import com.adyen.commerce.constants.AdyenoccConstants; | ||
import com.adyen.v6.facades.AdyenOrderFacade; | ||
import de.hybris.platform.commerceservices.request.mapping.annotation.ApiVersion; | ||
import de.hybris.platform.commercewebservices.core.strategies.OrderCodeIdentificationStrategy; | ||
import de.hybris.platform.webservicescommons.swagger.ApiBaseSiteIdAndUserIdParam; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.access.annotation.Secured; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping(value = AdyenoccConstants.ADYEN_USER_PREFIX) | ||
@ApiVersion("v2") | ||
@Tag(name = "Adyen") | ||
public class PaymentStatusController { | ||
|
||
@Autowired | ||
private OrderCodeIdentificationStrategy orderCodeIdentificationStrategy; | ||
|
||
@Autowired | ||
private AdyenOrderFacade adyenOrderFacade; | ||
|
||
|
||
@Secured({"ROLE_CUSTOMERGROUP", "ROLE_CLIENT", "ROLE_TRUSTED_CLIENT", "ROLE_CUSTOMERMANAGERGROUP"}) | ||
@GetMapping(value = "/payment-status/{orderCode}") | ||
@Operation(operationId = "getPaymentStatus", summary = "Get order payment status.", description = "Returns payment status of order with given code.") | ||
@ApiBaseSiteIdAndUserIdParam | ||
public ResponseEntity<String> getPaymentStatus( | ||
@Parameter(description = "Order GUID (Globally Unique Identifier) or order CODE", required = true) @PathVariable final String orderCode) { | ||
try { | ||
String paymentStatus = adyenOrderFacade.getPaymentStatusOCC(orderCode); | ||
return ResponseEntity.ok(paymentStatus); | ||
} catch (Exception e) { | ||
return ResponseEntity.badRequest().build(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
adyenwebcommons/src/com/adyen/commerce/response/OCCPlaceOrderResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.adyen.commerce.response; | ||
|
||
import de.hybris.platform.commercefacades.order.data.OrderData; | ||
|
||
public class OCCPlaceOrderResponse extends PlaceOrderResponse { | ||
private OrderData orderData; | ||
|
||
public OrderData getOrderData() { | ||
return orderData; | ||
} | ||
|
||
public void setOrderData(OrderData orderData) { | ||
this.orderData = orderData; | ||
} | ||
} |