1. Warning to browser console when calling with empty error fields.
2. Warning to browser console when calling with non-empty payer errors but
corresponding PaymentOptions.requestPayerXXX is false.
--HG--
extra : histedit_source : 816c44a0ceca5202886a48eee96d2ef7f7315487
PaymentRequest API is not supported when the PaymentRequest is not in the
fully active document. Adding bool a PaymentRequest::InFullyActiveDocument()
method to check if the PaymentRequest is in fully active document. This
method should be called at the start of any PaymentRequest APIs. If the
PaymentRequest is not in fully active document, ignoring the API call and
throw the NS_ERROR_DOM_ABORT_ERR if needed.
--HG--
extra : histedit_source : 3e8e4a73f69c639f9cc528afa586af22597ff320
1. Set nsIPaymentRequest.completeStatus as 'updating' when calling
nsIPaymentRequestService::Change*. After event handling done, set
nsIPaymentRequest.completeStatus as '' and call
nsIPaymentUIService::UpdatePayment()
2. When the page handles PaymentRequestUpdateEvent or the Promise of
PaymentRequest::Show() over the dom.payments.response.timeout, set
nsIPaymentRequest.completeStatus as 'timeout' and call
PaymentUIService::UpdatePayment() automatically
3. Set nsIPaymentRequest.completeStatus as 'nohandler' when dispatching
PaymentRequestUpdateEvent and no event handler for it.
4. Set the initial valud of dom.payments.response.timeout to 20000 ms.
--HG--
extra : rebase_source : 7fe64a05bf7d20726c95aadd6e85bc14cb26bd3f
Save the changing method information in PaymentMethodChangeEvent and
dispatch it.
--HG--
extra : histedit_source : 583cc4efd19d22d21864527db9bb479f772839e4
1. Add a new method nsIPaymentRequestService::ChangePaymentMethod for UI to
inform merchant the payment method is changed by user.
2. Add a new method in PPaymentRequest.ipdl to passing the changing method
information from chrome process to content process.
3. Add BasicCardChangeDetails dictionary in BasicCardPayment.webidl
4. Create ChangeDetails, GeneralDetails and BasicCardDetails for saving the
the method information in content process.
--HG--
extra : histedit_source : 8426da9c1d070daa35623b3431341c13cb361aed
1. Add a new attribute nsIPaymentOptions.requestBillingAddress.
2. Add new XPCOM interfaces MethodChangeDetails, GeneralChangeDetails and
BasicCardMethodChangeDetails for passing the method change details from
UI code.
--HG--
extra : histedit_source : 680bff71f0d8a9d9333a3699fcc6a4fd9630fe1b
1. Add a new method nsIPaymentRequestService::ChangePaymentMethod for UI to
inform merchant the payment method is changed by user.
2. Add a new method in PPaymentRequest.ipdl to passing the changing method
information from chrome process to content process.
3. Add BasicCardChangeDetails dictionary in BasicCardPayment.webidl
4. Create ChangeDetails, GeneralDetails and BasicCardDetails for saving the
the method information in content process.
1. Add a new attribute nsIPaymentOptions.requestBillingAddress.
2. Add new XPCOM interfaces MethodChangeDetails, GeneralChangeDetails and
BasicCardMethodChangeDetails for passing the method change details from
UI code.
1. Adding a new completeStatus 'initial' for nsIPaymentRequest.completeStatus
to indicate the status of the showing PaymentRequest for Payment UI component.
2. Removing the PaymentRequest::mDeferredShow and calling
PaymentRequestManager::showPayment() when PaymentRequest::Show() called
with a detailsUpdate parameter to inform UI component to support better
user experience.
The concept of card types, supportedTypes, BasicCardType enum, were removed from the Basic Card spec.
Differential Revision: https://phabricator.services.mozilla.com/D10646
--HG--
extra : moz-landing-system : lando
In original design, payment method response data is passed between processes
through a simple nsString. It means a special encoder/decoder is needed for
special response data, ex. BasicCardResponse, to serialize/deserialize
into/from the nsString. However, when a token spliter, ':', ';' and '@', is
used in response data, it makes the encoder/decoder can not work normally.
It is hard to define a suitable token spliter set for encoder/decoder.
So instead of using an error-prone encoder/decoder, this patch defining a new
IPC structure for response data.
--HG--
extra : rebase_source : 4972033516bc861ea3f975a27b7688fc6eb89a94
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.
Differential Revision: https://phabricator.services.mozilla.com/D6861
--HG--
extra : moz-landing-system : lando
Removing PaymentRequestManager::mShowingRequest and related code.
PaymentRequest showing is controlled by PaymentRequestService in chrome
process, before we come out the solution for bug 1469419, we don't need
showing control in content process.
1. Adding a checking before clearing PaymentRequestService::mShowingRequest.
Clearing PaymentRequestService::mShowingRequest when it is rejected.
2. Adding an internal method nsresult ShowPayment(const nsAString& requestId)
to remove the duplicate code in PaymentRequestService.
Add state checking when calling RespondPayment(), ChangeShippingAddress()
and ChangeShippingOption().
Calling ChangeShippingXXX is valid when the PaymentRequest state is interactive.
Calling RespondPayment is valid when following situations
1. PaymentRequest state is interactive
2. PaymentRequest state is closed but the response is for CompleteAction.
3. PaymentRequest state is created but the response is for CanMakeAction.
--HG--
extra : histedit_source : 9ae63e409813154de42cc33024835ac5f0c96893
Adding testcase for interacting with PaymentRequest in wrong PaymentRequest
state. Calling RespondPayment(), ChangeShippingOption() and
ChangeShippingAddress() in wrong state should return error. This test case
verifying the behavior when calling these methods when PaymentRequest state
is eClosed and after PaymentResponse::complete() called.
--HG--
extra : histedit_source : 3e70e64ac739dd7d8cbc4627dbdbd64462ae4211
To support merchants providing the payment details with errors by
PaymentRequestUpdateEvent.updateWith() during PaymentResponse.retry(),
PaymentDetailsUpdate needs to add more two attributes in webidl.
dictionary PaymentDetailsUpdate {
...
PayerErrorFields payerErrors;
object paymentMethodErrors;
};
And transfer these error field to UI component
1. Add PaymentValidationErrors and PayerErrorFields in PaymentRequest.webidl
and PaymentResponse.retry() in PaymentResponse.webidl
2. Implement PaymentRequest.retryPayment() and
PaymentRequestManager.retryPayment() in content process.
3. Add IPCPaymentRetryActionRequest in PPaymentRequest.ipdl to transfer the
error fields to chrome process.
4. Implement PaymentResponse.retry() by reusing the code of show() and
updateWith() of PaymentRequestService in chrome process.
Remove the unnecessary XPCOM component nsIPaymentActionRequest and
nsIPaymentActionCallback. These two components are only used in C++ and they
need not to expose to the front end.
1. Add testcase testRetryAfterComplete to test the behavior of retry() after
complete().
2. Add testcase testRetryAfterRetry to test the multiple retry()s in the same
round.
3. Add testcase testRetryWithEmptyErrors to test the retry() called with an
empty PaymentValidationErrors.
4. Add testcase testRetry to test the normal flow of retry().
5. Add testcase testRetryAbortByUser to test the retry() aborted by user.
1. Improving the testCloseByRedirectingAfterShow. Try to call
PaymentRequestService::respondPayment when the PaymentRequest is closed.
2. Adding a new test testUpdateWithRespondedPayment for the case the merchant
calls PaymentRequestUpdateEvent::updateWith() and the PaymentRequest is
rejected by the user.
--HG--
rename : dom/payments/test/test_cleanupPayment.html => dom/payments/test/test_closePayment.html
1. Checking if the PaymentRequest::mState equals to eInteractive when calling
PaymentRequest::UpdatePayment() and PaymentRequest::AbortUpdate.
2. Removing the non-suitable MOZ_ASSERT in PaymentRequest::RespondShowPayment()
1. Adding a new method void closePayment(in AString requestId) in
nsIPaymentUIService.idl
2. Implementing the closePayment method in paymentUIService.js.
3. Calling closePayment of paymentUIService.js in
PaymentRequestService::LaunchUIAction()
1. Returning NS_ERROR_FAILURE in PaymentRequestService::RespondPayment() when
the specified PaymentRequest does not exist in PaymentRequestService.
2. Renaming "cleanup" to "close" in DOM::WebPayment codes to fit the actual
behavior.
This allows JS callers to automatically get the correct types during
interation, without having to explicitly specify them.
Differential Revision: https://phabricator.services.mozilla.com/D3728
--HG--
extra : rebase_source : b708f382d8ea571d199c669bfed5b5a7ca9ffac4
extra : histedit_source : 7df6feb82088c8a5ca45dc28fe4d2b852c177fee
In order to allow JS callers to use nsISimpleEnumerator instances with the JS
iteration protocol, we'll need to additional methods to every instance. Since
we currently have a large number of unrelated implementations, it would be
best if they could share the same implementation for the JS portion of the
protocol.
This patch adds a stub nsSimpleEnumerator base class, and updates all existing
implementations to inherit from it. A follow-up will add a new base interface
to this class, and implement the additional functionality required for JS
iteration.
Differential Revision: https://phabricator.services.mozilla.com/D3725
--HG--
extra : rebase_source : ad66d7b266856d5a750c772e4710679fab9434b1
extra : histedit_source : a83ebffbf2f0b191ba7de9007f73def6b9a955b8
1. add a set new mochitests to test cleanup function.
By redirecting to another page.
By redirecting to another page, when PaymentRequest.show() is called.
By reloading
By removing/closing the page.
2. remove unnecessary PaymentRequestService.cleanup() call in the test suite.
Let PaymentRequest inherit from nsIDocumentActivity interface.
Calling RegisterActivityObserver() and UnregisterActivityObserver() in
constructor and destructor to get activity notifications from document.
When receiving the notification, NotifyOwnerDocumentActivityChanged() will
check the owner document's activity status. If the status is disabled, calling
PaymentRequestManager::CleanupPayment() to cleanup the PaymentRequest in
content process and aslo sending the cleanup information to chrome process.
We only build the frontend parts of Web Payments on Nightly, but users could
futz with the prefs and expose the DOM API on Beta. We should be careful about
not allowing that mismatch.
This also adds some additional logging if we run into a bug like this again.
MozReview-Commit-ID: 9qcQTIsIHkg
--HG--
extra : rebase_source : cdaed71d79e6f8cedd1229ffd03cac21e3660367