Reporting payment failures

While attempting to send payments it may be that sometimes payment failures occur. Reporting these issues through the Breez SDK will help us to improve LSP routing.

Rust
let payment_hash = String::from("...");

sdk.report_issue(ReportIssueRequest::PaymentFailure {
    data: ReportPaymentFailureDetails {
        payment_hash,
        comment: None,
    },
})
.await?;
Swift
let paymentHash = "..."

try? sdk.reportIssue(
    req: ReportIssueRequest.paymentFailure(
        data: ReportPaymentFailureDetails(paymentHash: paymentHash)))
Kotlin
val paymentHash = "..."
try {
    sdk.reportIssue(ReportIssueRequest.PaymentFailure(
        ReportPaymentFailureDetails(paymentHash)))
} catch (e: Exception) {
    // Handle error
}
React Native
try {
  const paymentHash = '...'
  await reportIssue({
    type: ReportIssueRequestVariant.PAYMENT_FAILURE,
    data: { paymentHash }
  })
} catch (err) {
  console.error(err)
}
Dart
ReportIssueRequest req = ReportIssueRequest.paymentFailure(
  data: ReportPaymentFailureDetails(
    paymentHash: paymentHash,
  ),
);
await breezSDK.reportIssue(req: req);
Python
payment_hash = "..."
sdk_services.report_issue(
    breez_sdk.ReportIssueRequest.PAYMENT_FAILURE(
        breez_sdk.ReportPaymentFailureDetails(payment_hash)))
Go
paymentHash := "..."
reportIssueRequest := breez_sdk.ReportIssueRequestPaymentFailure{
    Data: breez_sdk.ReportPaymentFailureDetails{
        PaymentHash: paymentHash,
    },
}
if err := sdk.ReportIssue(reportIssueRequest); err != nil {
    log.Printf("%#v", err)
}
C#
var paymentHash = "...";
try
{
    sdk.ReportIssue(new ReportIssueRequest.PaymentFailure(
        new ReportPaymentFailureDetails(paymentHash)
    ));
}
catch (Exception)
{
    // Handle error
}