Skip to content

Commit c7872c2

Browse files
SP-398 Java: Add ability to create an invoice with a custom GUID
1 parent 942b27c commit c7872c2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +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+
if (invoice.getGuid().equals("")) {
310+
invoice.setGuid(this.getGuid());
311+
}
309312
ObjectMapper mapper = new ObjectMapper();
310313
String json;
311314

0 commit comments

Comments
 (0)