Skip to content

Commit 233f258

Browse files
committed
Torna a PixOrder.notification_url opcional
Ao gerar um pedido PIX a partir de um servidor rodando localmente, a URL localhost do servidor não pode ser acessada pelo serviço do PagBank para notificar a aplicação quando o PIX for pago. Neste casos, a notification_url pode ser omitida. Signed-off-by: Manoel Campos <[email protected]>
1 parent fc3dc4b commit 233f258

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>br.com.competeaqui</groupId>
88
<artifactId>pagseguro-api</artifactId>
9-
<version>0.0.4-snapshot</version>
9+
<version>0.0.5-snapshot</version>
1010

1111
<name>PagSeguro Java API</name>
1212
<description>

src/main/java/br/com/competeaqui/pagseguro/service/PixOrder.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ public PixOrder(@NonNull String reference_id, @NonNull Customer customer) {
6464
}
6565

6666
public PixOrder(@NonNull String reference_id, @NonNull Customer customer, QrCode qrcode, @NonNull String notification_url) {
67-
this(null, reference_id, null, customer, null, List.of(qrcode), null, emptyList(), List.of(validateUrl(notification_url)), null);
67+
this(null, reference_id, null, customer, null, List.of(qrcode), null, emptyList(), getSingleList(notification_url), null);
6868
}
6969

70-
private static String validateUrl(final String notification_url) {
71-
if(notification_url.isBlank())
72-
throw new IllegalArgumentException("notification_url é obrigatória");
70+
private static List<String> getSingleList(final String value) {
71+
if(value == null || value.isBlank())
72+
return List.of();
7373

74-
return notification_url;
74+
return List.of(value);
7575
}
7676

7777
}

0 commit comments

Comments
 (0)