Skip to content

Commit

Permalink
Implement payment canceled error message
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelWuensch committed Jan 5, 2025
1 parent d37d3d7 commit d103c10
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,9 @@ public Single<SendLnPaymentResponse> sendLnPayment(SendLnPaymentRequest sendLnPa
case FAILURE_REASON_INCORRECT_PAYMENT_DETAILS:
failureReason = SendLnPaymentResponse.FailureReason.INCORRECT_PAYMENT_DETAILS;
break;
case FAILURE_REASON_CANCELED:
failureReason = SendLnPaymentResponse.FailureReason.CANCELED;
break;
default:
failureReason = SendLnPaymentResponse.FailureReason.UNKNOWN;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,9 @@ public void onError(String error, SendLnPaymentResponse sendLnPaymentResponse, i
case INCORRECT_PAYMENT_DETAILS:
errorMessage = errorPrefix + "\n\n" + getResources().getString(R.string.error_payment_keysend_not_enabled_on_remote);
break;
case CANCELED:
errorMessage = errorPrefix + "\n\n" + getResources().getString(R.string.error_payment_canceled);
break;
default:
errorMessage = errorPrefix + "\n\n" + error;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,9 @@ public void onError(String error, SendLnPaymentResponse sendLnPaymentResponse, i
case INCORRECT_PAYMENT_DETAILS:
errorMessage = errorPrefix + "\n\n" + getResources().getString(R.string.error_payment_invalid_details);
break;
case CANCELED:
errorMessage = errorPrefix + "\n\n" + getResources().getString(R.string.error_payment_canceled);
break;
default:
errorMessage = errorPrefix + "\n\n" + error;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public enum FailureReason {
NO_ROUTE,
INSUFFICIENT_FUNDS,
INCORRECT_PAYMENT_DETAILS,
CANCELED,
UNKNOWN;
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@
<string name="error_payment_no_route_small_amount">No route was found. You are trying to send an amount that is so small, that many channels might not route it. Please check your the routing settings for your own channels and adapt the MinHTLC value if necessary.</string>
<string name="error_payment_insufficient_balance">The amount to pay is bigger than what you can send over lightning with your current open channels.</string>
<string name="error_payment_keysend_not_enabled_on_remote">Please make sure the recipient has enabled the keysend feature.</string>
<string name="error_payment_canceled">The sender canceled the payment..</string>
<string name="error_only_payment_data_allowed">Only payment data is allowed here.</string>
<string name="error_node_not_yet_ready">Your node is not fully synced yet. Please try again later.</string>
<string name="error_tor_blocked_lnurl" comment="Parameters are: %1$s: hostname">%1$s seems to block request coming from the Tor network. You might try switching Tor off in the settings or contact the service and request them to update their cloudflare rules.</string>
Expand Down

0 comments on commit d103c10

Please sign in to comment.