parent
1f8846a25a
commit
a8bc6dfc62
@ -1,7 +0,0 @@
|
||||
package au.com.royalpay.payment.manage.shopify.auth.domain;
|
||||
|
||||
public class ShopifyRequestVerifyException extends RuntimeException{
|
||||
public ShopifyRequestVerifyException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package au.com.royalpay.payment.manage.shopify.auth.domain.exception;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@ResponseStatus(HttpStatus.UNAUTHORIZED)
|
||||
public class ShopifyRequestVerifyException extends RuntimeException{
|
||||
public ShopifyRequestVerifyException(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package au.com.royalpay.payment.manage.shopify.support;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ShopifyHttpUtils {
|
||||
|
||||
public static String getRequestBody(HttpServletRequest request) {
|
||||
BufferedReader br = null;
|
||||
StringBuilder sb = new StringBuilder("");
|
||||
try {
|
||||
br = request.getReader();
|
||||
String str;
|
||||
while ((str = br.readLine()) != null) {
|
||||
sb.append(str);
|
||||
}
|
||||
br.close();
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (null != br) {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue