Bug 1615630 - Call PaymentRequestManager::NotifyRequestDone() when PaymentShowActionResponse.status() is not PAYMENT_ACCEPTED before calling PaymentRequest::RespondShowPayment r=baku,alchen

Differential Revision: https://phabricator.services.mozilla.com/D65692

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Eden Chuang 2020-03-10 09:03:51 +00:00
parent 703ed9959d
commit 0ae0e5703d

View File

@ -683,13 +683,16 @@ nsresult PaymentRequestManager::RespondPayment(
break;
}
}
// If PaymentActionResponse is not PAYMENT_ACCEPTED, no need to keep the
// PaymentRequestChild instance. Otherwise, keep PaymentRequestChild for
// merchants call PaymentResponse.complete()
if (rejectedReason.Failed()) {
NotifyRequestDone(aRequest);
}
aRequest->RespondShowPayment(response.methodName(), responseData,
response.payerName(), response.payerEmail(),
response.payerPhone(),
std::move(rejectedReason));
if (rejectedReason.Failed()) {
NotifyRequestDone(aRequest);
}
break;
}
case IPCPaymentActionResponse::TIPCPaymentAbortActionResponse: {