def METHOD_NAME(self, pr: PaymentRequest,
        cb: Optional[CompletionCallbackType]=None) -> InvoiceRow:
    wallet = self._account.get_wallet()
    # We decouple handling of the completion callback from the call.
    with wallet.get_invoice_table() as table:
        # Is this the best algorithm for detecting a duplicate? No idea.
        existing_row = table.read_duplicate(value=pr.get_amount(),
            payment_uri=pr.get_payment_uri())
        if existing_row is not None:
            return existing_row
        # We have a unique constraint on the payment uri to error if we add a duplicate.
        row = InvoiceRow(0, self._account.get_id(), None, pr.get_payment_uri(), pr.get_memo(),
            PaymentFlag.UNPAID, pr.get_amount(), pr.to_json().encode(),
            pr.get_expiration_date(), table._get_current_timestamp())
        table.create([ row ], completion_callback=cb)
    # NOTE: Does not have the invoice id intentionally to reflect it is in progress.
    return row