Skip to content

Commit

Permalink
Ajuste no parsing dos codigos de notificacao e criacao de solicitacao…
Browse files Browse the repository at this point in the history
… de pagamento
  • Loading branch information
rribaldo committed Feb 2, 2015
1 parent 9283c53 commit 36f9492
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
Binary file modified pagseguro-api-2.5.1.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ private static String buildAuthorizationNotificationUrl(ConnectionData connectio
*/
private static String buildPaymentRequestTransactionNotificationUrl(final ConnectionData connectionData,
final String paymentRequestNotificationCode) throws PagSeguroServiceException {
final String code = paymentRequestNotificationCode.replaceAll(" ", "");

return connectionData.getWsPaymentRequestNotificationUrl() + "/" + code + "?"
return connectionData.getWsPaymentRequestNotificationUrl() + "/" + paymentRequestNotificationCode + "?"
+ connectionData.getCredentialsUrlQuery();
}

Expand Down Expand Up @@ -271,7 +269,7 @@ public static HttpURLConnection checkNotification(Credentials credentials, Strin
*/
public static PaymentRequestTransaction checkPaymentRequestTransaction(Credentials credentials,
String paymentRequestNotificationCode) throws PagSeguroServiceException {
if (paymentRequestNotificationCode == null || ("").equals(paymentRequestNotificationCode.trim())) {
if (paymentRequestNotificationCode == null || paymentRequestNotificationCode.contains(" ")) {
throw new PagSeguroServiceException(HttpStatus.NOT_FOUND);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ public static String buildPaymentRequestUrl(ConnectionData connectionData) throw
*/
private static String buildPaymentRequestFindUrlByCode(ConnectionData connectionData, String paymentRequestCode)
throws PagSeguroServiceException {
final String code = paymentRequestCode.replaceAll(" ", "");

return connectionData.getWSPaymentRequestFindByCodeUrl() + "/" + code + "?"
return connectionData.getWSPaymentRequestFindByCodeUrl() + "/" + paymentRequestCode + "?"
+ connectionData.getCredentialsUrlQuery();
}

Expand Down Expand Up @@ -182,7 +180,7 @@ public static String createPaymentRequest(Credentials credentials, PaymentReques
*/
public static PaymentRequestTransaction findByCode(Credentials credentials, String paymentRequestcode)
throws PagSeguroServiceException {
if (paymentRequestcode == null || ("").equals(paymentRequestcode.trim())) {
if (paymentRequestcode == null || paymentRequestcode.contains(" ")) {
throw new PagSeguroServiceException(HttpStatus.NOT_FOUND);
}

Expand Down

0 comments on commit 36f9492

Please sign in to comment.