Skip to content

Commit e17a869

Browse files
authored
Merge pull request #210 from mwarzybok-sumoheavy/feature/SP-398
SP-398 Java: Add ability to create an invoice with a custom GUID
2 parents 43bc57a + c7872c2 commit e17a869

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/bitpay/sdk/Client.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ public Invoice createInvoice(Invoice invoice) throws InvoiceCreationException {
306306
*/
307307
public Invoice createInvoice(Invoice invoice, String facade, Boolean signRequest) throws BitPayException, InvoiceCreationException {
308308
invoice.setToken(this.getAccessToken(facade));
309-
invoice.setGuid(this.getGuid());
309+
if (invoice.getGuid().equals("")) {
310+
invoice.setGuid(this.getGuid());
311+
}
310312
ObjectMapper mapper = new ObjectMapper();
311313
String json;
312314

0 commit comments

Comments
 (0)