com.mx.path.model.mdx.web.controller.BillsController Maven / Gradle / Ivy
The newest version!
package com.mx.path.model.mdx.web.controller;
import com.mx.path.gateway.accessor.AccessorResponse;
import com.mx.path.model.mdx.model.MdxList;
import com.mx.path.model.mdx.model.payment.Bill;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "{clientId}", produces = BaseController.MDX_MEDIA)
public class BillsController extends BaseController {
public BillsController() {
}
@RequestMapping(value = "/users/{userId}/bills", method = RequestMethod.GET)
public final ResponseEntity> getBillList() throws Exception {
AccessorResponse> response = gateway().payments().bills().list();
return new ResponseEntity<>(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK);
}
@RequestMapping(value = "/users/{userId}/bill/{id}", method = RequestMethod.GET)
public final ResponseEntity getBill(@PathVariable("id") String id) throws Exception {
AccessorResponse response = gateway().payments().bills().get(id);
return new ResponseEntity(response.getResult().wrapped(), createMultiMapForResponse(response.getHeaders()), HttpStatus.OK);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy