Commit Graph

123 Commits

Author SHA1 Message Date
Marcos Cáceres
eb155e743a Bug 1474499 - Add support for onmerchantvalidation and MerchantValidationEvent. r=edenchuang,baku 2018-09-12 22:56:00 +03:00
arthur.iakab
620bc5019f Backed out changeset ebe2c08a2454 (bug 1474499) for failing web platform tests on ValidationEvent/constructor.https.html 2018-09-11 19:30:23 +03:00
Marcos Cáceres
e4203c1813 Bug 1474499 - Add support for onmerchantvalidation and MerchantValidationEvent. r=edenchuang,baku
--HG--
extra : rebase_source : 5b5488fb1bb6c9f901a8c22c12aa635ebf8381c8
2018-09-11 06:00:00 +03:00
Eden Chuang
c5ec825b8f Bug 1435161 - Part 3 support error fields in PaymentDetailsUpdate. r=baku
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
2018-09-04 16:00:33 +02:00
Eden Chuang
7058aae68b Bug 1435161 - Part 2 supporting PaymentResponse.retry(). r=baku
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.
2018-09-04 12:28:40 +02:00
Eden Chuang
92d58a1b87 Bug 1435161 - Part 1 Removing unnecessary XPCOM components for PaymentRequest API. r=baku
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.
2018-08-30 14:13:33 +02:00
Eden Chuang
f4764c9019 Bug 1435161 - mochitest for PaymentResponse.retry(). r=baku
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.
2018-09-04 12:30:18 +02:00
Marcos Cáceres
ef9e5ae876 Bug 1487295 - Add defaults to PaymentMethodChangeEventInit's members. r=baku
--HG--
extra : rebase_source : d5f1590effbec2085672aa4a1552cbb798b4530b
2018-09-10 04:44:00 +03:00
Dorel Luca
f012e0b9a2 Backed out 2 changesets (bug 1487295) for WPT failres in payment-request/PaymentMethodChangeEvent/methodDetails-attribute.https.html
Backed out changeset 33cb5cf879d8 (bug 1487295)
Backed out changeset b5657f72bcb0 (bug 1487295)
2018-09-07 12:50:07 +03:00
Marcos Cáceres
a4a6a91838 Bug 1487295 - Add defaults to PaymentMethodChangeEventInit's members. r=baku
--HG--
extra : amend_source : 160b5a164fff0faf5a137b0dd0c50c6d5d859740
2018-09-06 23:53:00 +03:00
Gurzau Raul
031bc0c262 Backed out changeset f7d509458e63 (bug 1487295) for failing at PaymentMethodChangeEvent/methodDetails-attribute.https.html on a CLOSED TREE 2018-09-04 21:18:53 +03:00
Marcos Cáceres
15c023f206 Bug 1487295 - Add defaults to PaymentMethodChangeEventInit's members. r=baku 2018-09-04 01:21:00 +03:00
Marcos Cáceres
8128af9850 Bug 1485881 - Drop support for PaymentAddress.languageCode r=smaug
--HG--
extra : rebase_source : 6400765c8b669126c7a71f5094dd160b2b1a89ce
2018-08-27 16:30:00 +03:00
Marcos Cáceres
1699f2bb63 Bug 1484864 - Intermittent tier 2 test-verify dom/payments/test/browser_payment_in_different_tabs.js r=edenchuang 2018-08-27 21:47:00 +03:00
Eden Chuang
2f8de0fe6b Bug 1483470 - Improve the test case for responding a closed PaymentRequest. r=baku
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
2018-08-24 11:28:50 +02:00
Eden Chuang
a29e2c4da2 Bug 1483470 - Handling PaymentRequestUpdateEvent::updateWith() to a responed PaymentRequest. r=baku
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()
2018-08-22 03:10:45 +02:00
Eden Chuang
6fddec41b3 Bug 1483470 - Adding new method closePayment in nsIPaymentUIService.idl. r=baku
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()
2018-08-16 14:19:35 +02:00
Eden Chuang
68bb5bfa3c Bug 1483470 - Handling PaymentRequestService::RespondPayment() to a closed PaymentRequest. r=baku
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.
2018-08-16 14:27:24 +02:00
Kris Maglione
3a5c05e76f Bug 1484496: Part 5e - Convert remaining nsISimpleEnumerator users to use JS iteration. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D3733

--HG--
extra : rebase_source : c0fac176d7b3d840c4dbb14f8d95ccfc7f83a5a8
extra : histedit_source : a92c40117d0808a3ad68c972f622a7a42c9ae8ba
2018-08-18 18:13:14 -07:00
Kris Maglione
2dee0aae3c Bug 1484496: Part 4b - Add intrinsic type information to most nsSimpleEnumerators. r=froydnj
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
2018-08-18 21:06:32 -07:00
Kris Maglione
65c28aa0ad Bug 1484496: Part 2 - Add common base class for all nsISimpleEnumerator implementations. r=froydnj
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
2018-08-18 14:22:47 -07:00
Marcos Cáceres
d9c9ac71d9 Bug 1483156 - Currency of PaymentItem total should be 'USD', but got BOB r=edenchuang
--HG--
extra : amend_source : 8bfb03ef649733c587b1b04bfea6260fb5b2b4fd
2018-08-21 20:16:00 +03:00
Jeff Walden
e4f79e2a19 Bug 1484421 - Move JSON-related functionality into js/public/JSON.h that isn't #include'd in jsapi.h. r=jandem 2018-08-20 07:54:45 -07:00
Marcos Cáceres
8f0ff24be1 Bug 1480872 - paymentDetails attributes should default to an empty arrays. r=edenchuang 2018-08-19 19:11:00 +03:00
Eden Chuang
d532620f01 Bug 1408234 - mochitest for PaymentRequest cleanup after document closed. r=baku
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.
2018-08-13 11:25:13 +02:00
Eden Chuang
b4cd2e70aa Bug 1408234 - Cleanup the PaymentRequests when document close. r=baku
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.
2018-08-13 11:24:54 +02:00
Zibi Braniecki
4432035f49 Bug 1480673 - Migrate all uses of JS_Stringify to nsContentUtils::StringifyJSON. r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D2701

--HG--
extra : moz-landing-system : lando
2018-08-07 16:01:27 +00:00
Andi-Bogdan Postelnicu
88cc63910d Bug 1453795 - DOM - Initialize member fields in classes/ structures. r=peterv
--HG--
extra : rebase_source : 249fc26e50bded4e94f5effa4308af0f1e54b908
2018-06-16 17:21:46 +03:00
Marcos Cáceres
60e5daf61c Bug 1468356 - Implement onpaymentmethodchange attribute. r=mrbkap
--HG--
extra : rebase_source : 220c160ce0a4ab0568285c276de7326d4a16da23
2018-06-30 10:11:00 +03:00
Dorel Luca
bc2fbd0648 Merge mozilla-central to autoland
--HG--
extra : rebase_source : 0f5c3c308ce6ddd6fb9fcb49b83d4450a24d67dc
2018-06-27 13:33:04 +03:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Henri Sivonen
77eaf92c58 Bug 1447773 - Time out PaymentResponse after 5 seconds. r=mrbkap
MozReview-Commit-ID: JnoKgLC6yL6

--HG--
extra : rebase_source : 8fb0f553409b1ecf142568146f3f4cc7ad33ac4f
2018-05-29 12:31:22 +03:00
Sebastian Hengst
b8ce168b05 Bug 1471255 - bugs in dom/payments should be filed in Core::DOM: Web Payments. r=MattN
MozReview-Commit-ID: LuQsheIcW48

--HG--
extra : rebase_source : f00a112dfbf7992bfe32f18f89559fa02a915bae
2018-06-26 18:44:17 +03:00
Sebastian Hengst
c6864ae376 Bug 1470750 - Don't run DOM payment tests for non-Nightly. r=mrbkap
MozReview-Commit-ID: DqaSGheG7LE
2018-06-25 01:50:40 +03:00
Blake Kaplan
37c3abfe24 Bug 1470110 - Consistently disable payments off of Nightly. r=MattN
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
2018-06-22 12:05:36 -07:00
Blake Kaplan
7616406bb3 Bug 1469433 - Remove an unused function. r=smaug
This was just sitting around.

MozReview-Commit-ID: 282neafD23x

--HG--
extra : rebase_source : 9f7257f9bebc8e063dd2ef2aca9bf0fa9c8300c0
2018-06-19 15:58:37 -07:00
Blake Kaplan
2597785450 Bug 1469433 - Handle shutdown more gracefully. r=smaug
If we end up shutting down the content process while there's a request active
we'll end up "leaking" the request and asserting. This makes sure that we
let go of the PaymentRequest in that edge case. I can cause this by forceably
closing the payment request window on Linux without hitting OK or cancel.

MozReview-Commit-ID: 6XDYIcqNkC6

--HG--
extra : rebase_source : d20d8fae4aa4fc3afcca8491d415c64b8af8bcb4
2018-06-19 15:55:32 -07:00
Blake Kaplan
5d09eec7de Bug 1469433 - Match the spec's error reporting more closely. r=smaug
MozReview-Commit-ID: LI13cA0okeu

--HG--
extra : rebase_source : 8ffb8db4fc0e4905f31cca2b41a954b89720e42a
2018-06-19 15:30:43 -07:00
Blake Kaplan
dfb2d7b714 Bug 1442453 - Pass objects around instead of string IDs in the child. r=baku
The existing code only passed strings around to identify PaymentRequest
objects. That meant that we were constantly having to do hashtable lookups to
find the corresponding object. This patch just uses the single map that IPDL
maintains for us and passes objects around, obviating the need for more
hashtable lookups.

MozReview-Commit-ID: 6BBonrc6q4x

--HG--
extra : rebase_source : 041c6ce742d60a2c9e954a58582d09cd9ef7f2b1
2018-05-31 16:20:51 -07:00
Blake Kaplan
49d7053a3e Bug 1442453 - Create a single IPC actor per PaymentRequest. r=baku
There isn't any need to create an actor per call to the parent. This patch
lines up PaymentRequest with PPaymentRequestChild objects and links them
together. It also simplifies the maps and arrays we use to keep track of these
objects.

There's one tricky bit to note in this patch: in the case that a promise is
passed to paymentRequest.show(), we don't notify the parent process until the
promise resolves (when we call either UpdatePayment or AbortUpdate). In that
case, I needed to distinguish between an "update" because of the promise
resolving or a call to updateWith on an shippingaddresschange event in order
to get the bookkeeping right with the mActivePayments hashtable. In that case,
the PaymentRequest is kept alive by mShowingRequest alone. In all other cases,
mActivePayments keeps the PaymentRequest alive until we resolve or reject the
correct promise.

MozReview-Commit-ID: HoHjn8eqC4T

--HG--
extra : rebase_source : 4da1d65d1f791f4a5c18871ab3a3dcf94e833b90
2018-05-31 13:30:29 -07:00
Blake Kaplan
40ee64ba85 Bug 1442453 - Fix nits and get rid of needless QIs. r=baku
This removes some hard tabs that crept in and combines two if branches into a
single statement in order to avoid a bit of duplication.

The existing code here seems to treat any sort of upcast as needing a QI. That
is needlessly wasteful and causes a bunch of unneeded virtual calls.

MozReview-Commit-ID: 7WshYm9C4Xb

--HG--
extra : rebase_source : bc7b1b5157324158f627efd8dff54f078488f4fc
2018-05-30 14:13:07 -07:00
Blake Kaplan
5251fffd6b Bug 1442453 - Fix a typo in this member name. r=baku
MozReview-Commit-ID: Ds7yRFn04NK

--HG--
extra : rebase_source : 76fbce0f2599dec30f6a07bb7044e5446abcbf65
2018-05-30 14:05:42 -07:00
Blake Kaplan
b1a13228be Bug 1442453 - Don't enforce "one interactive request" in the wrong place. r=baku
The existing code assumed that the only reason that there could be a
PaymentRequestChild was due to an active show() call. That is not the case. We
already know whether there's an "interactive" PaymentRequest through
mShowingRequest, so we should just use that instead.

MozReview-Commit-ID: IA9bXn7hS63

--HG--
extra : rebase_source : 0d65a6e05d224a5fddfdbb953ad28f2eecd80533
2018-05-30 14:04:32 -07:00
Joel Maher
50b91c0a14 Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
Eden Chuang
130e426839 Bug 1435157 - mochitest for AddressErrors in WebPayment. r=baku
--HG--
extra : rebase_source : e1a782bab18fede5fe12e91ff26f1dd3037ccee2
2018-05-18 14:40:34 +08:00
Eden Chuang
029423a6e2 Bug 1435157 - Support AddressErrors in WebPayment. r=baku.
1. Add AddressErrors in PaymentRequest.webidl.
    2. IPC for passing AddressErrors.
    3. Getters for AddressErrors in nsIPaymentDetails.

--HG--
extra : rebase_source : 64c57003d57e064b5284cc64447c0c0740f16121
2018-05-17 19:59:16 +08:00
YUKI "Piro" Hiroshi
dd7b3aab39 Bug 1457395 - Fix typo "proces" in comments. r=milan
--HG--
extra : amend_source : 36cf036803ff9bffaebb66fc31ff7b960f0c7509
2018-05-10 16:56:09 +09:00
Kris Maglione
a259026c9d Bug 1456035: Part 4 - Convert callers of XPCOMUtils.generateQI to ChromeUtils.generateQI. r=mccr8
This also removes any redundant Ci.nsISupports elements in the interface
lists.

This was done using the following script:

acecb401b7/processors/chromeutils-generateQI.jsm

MozReview-Commit-ID: AIx10P8GpZY

--HG--
extra : rebase_source : a29c07530586dc18ba040f19215475ac20fcfb3b
2018-04-22 20:55:06 -07:00
Eden Chuang
0471b5e543 Bug 1440041 - mochitest for nsIPaymentRequest.shippingOption. r=baku
This patch includes followings
    1. Test with no selected shipping options.
    2. Test with one selected shipping option when creating PaymentRequest.
    3. Test with multiple selected shipping options when creating PaymentRequest.
    4. Test with selecting shipping option by user.
    5. Test with modifying the user selection by merchant.
    6. Merges the mochitest for bug 1443914.

--HG--
rename : dom/payments/test/Bug1443914ChromeScript.js => dom/payments/test/ShippingOptionsChromeScript.js
rename : dom/payments/test/test_bug1443914.html => dom/payments/test/test_shippingOptions.html
extra : histedit_source : 19126dcb3870e0637ed8f4d0fbc6839cb5d682a0
2018-04-13 18:48:31 -07:00
Eden Chuang
b206167b93 Bug 1440041 - Add a new readonly attribute nsIPaymentRequest.shippingOption. r=baku. 2018-04-13 18:47:20 -07:00