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 8cd57d7 commit 9283c53
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 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 @@ -13,7 +13,7 @@ public class FindPaymentRequest {
public static void main(String[] args) {

// Substitute the code below with a valid payment request code for your account
findByCode("F55FC43450264D2CB7DBAD548C81EE46 ");
findByCode("F55F C43450264D2CB7DBAD548C81EE46");
}

private static void findByCode(String paymentRequestCode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,9 @@ 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() + "/" + paymentRequestNotificationCode + "?"
return connectionData.getWsPaymentRequestNotificationUrl() + "/" + code + "?"
+ connectionData.getCredentialsUrlQuery();
}

Expand Down Expand Up @@ -284,8 +285,8 @@ public static PaymentRequestTransaction checkPaymentRequestTransaction(Credentia
PaymentRequestTransaction paymentRequestTransaction = null;

HttpURLConnection response = connection.get(NotificationService.buildPaymentRequestTransactionNotificationUrl(
connectionData, paymentRequestNotificationCode.trim()), connectionData.getServiceTimeout(),
connectionData.getCharset(), PagSeguroSystem.getAcceptHeaderXML());
connectionData, paymentRequestNotificationCode), connectionData.getServiceTimeout(), connectionData
.getCharset(), PagSeguroSystem.getAcceptHeaderXML());

try {

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

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

Expand Down Expand Up @@ -192,7 +194,7 @@ public static PaymentRequestTransaction findByCode(Credentials credentials, Stri
HttpStatus httpStatusCode = null;

HttpURLConnection response = connection.get(
buildPaymentRequestFindUrlByCode(connectionData, paymentRequestcode.trim()),
buildPaymentRequestFindUrlByCode(connectionData, paymentRequestcode),
connectionData.getServiceTimeout(), connectionData.getCharset(), PagSeguroSystem.getAcceptHeaderXML());

try {
Expand Down

0 comments on commit 9283c53

Please sign in to comment.