Граф коммитов

51 Коммитов

Автор SHA1 Сообщение Дата
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Eden Chuang 931859451b Bug 1477117 - Part 2 - Add new IPC method for passing the changing method information. r=baku
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
2018-11-27 14:05:00 +01:00
arthur.iakab e36b9a7f34 Backed out 4 changesets (bug 1477117) for causing hazard build bustage on payments/PaymentRequest.cpp:1066 CLOSED TREE
Backed out changeset 3b473ca68a57 (bug 1477117)
Backed out changeset 8ffc94b44c3e (bug 1477117)
Backed out changeset ddaac3335514 (bug 1477117)
Backed out changeset 1809212f5f29 (bug 1477117)
2018-11-28 02:28:36 +02:00
Eden Chuang c9058620cb bug 1477117 - Part 2 - Add new IPC method for passing the changing method information. r=baku
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.
2018-11-27 14:05:00 +01:00
Gabriele Svelto 566f669d07 Bug 1509450 - Remove unnecessary inclusions of ContentParent.h and ContentChild.h r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D12728

--HG--
extra : moz-landing-system : lando
2018-11-26 14:49:44 +00:00
Eden Chuang 974f7da95a bug 1501823 - Force to call PaymentUIService.showPayment() when PaymentRequest.show called with a promise parameter. r=baku
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.
2018-11-21 11:03:21 +01:00
Diego Pino Garcia 84e713c49f Bug 1501102 - Move hard-coded 'supportedRegions' array to a pref to allow developers outside US/CA to test PaymentRequest. r=baku,MattN
--HG--
extra : rebase_source : 1661ff1d2b0ea9276a3a32953c94cedd5694fed8
2018-11-14 00:59:00 +02:00
Eden Chuang 9b43e53126 bug 1497111 - Remove unnecessarily null'ed out values of PaymentRequest.webidl. r=baku
--HG--
extra : histedit_source : 5a1a3f3a49540f92b32a0b94f07e65bb71382d09
2018-11-12 17:24:54 +01:00
Brindusan Cristian a14f91e1ee Backed out changeset 9ee2e7c7fa16 (bug 1497111) for wpt failures on payment-request-constructor.https.html. 2018-11-13 17:02:02 +02:00
Eden Chuang 330656ca6f bug 1497111 - Remove unnecessarily null'ed out values of PaymentRequest.webidl. r=baku 2018-11-12 17:24:54 +01:00
Eden Chuang 7020e04316 bug 1477409 - Part 1 - Instead of passing tabId, passing outerWindowId to Payment UI component. r=baku
--HG--
extra : histedit_source : 5480494582d1de6bcdac2ff295815d3182909697
2018-11-06 14:42:36 +01:00
Eden Chuang 74e578d048 Bug 1497215 - Refactor the IPC structure for PaymentResponse.details r=baku
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
2018-10-29 13:56:32 +01:00
Marcos Cáceres 6de37261e9 Bug 1497699 - Drop support for PaymentItem.type. r=edenchuang,baku
Being removed from the spec. Front-end no longer needs this.

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

--HG--
extra : moz-landing-system : lando
2018-10-16 12:53:01 +00:00
Eden Chuang 05093acbf4 Bug 1441752 - Adding an new attribute regionCode in PaymentAddress. r=baku
--HG--
extra : histedit_source : d71b94a611ff5cd3f5b556de9157ff46a5cfeda6
2018-09-28 12:21:59 +02:00
Eden Chuang dff10f1a39 Bug 1478740 - Part 2 - remove PaymentRequestManager::mShowingRequest. r=baku.
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.
2018-09-11 16:41:43 +02:00
Marcos Cáceres f616da00ba Bug 1472026 - Implement PaymentResponse.prototype.onpayerdetailchange. r=edenchuang,baku
Implement PaymentResponse.prototype.onpayerdetailchange, per spec.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 11:23:33 +00:00
shindli 70bf79757d Backed out changeset 376c2bf5bcbf (bug 1472026) for PaymentRequest failures in dom/payments/test/test_block_none10s.html 2018-09-19 12:31:51 +03:00
Marcos Cáceres 9dd1b3aeae Bug 1472026 - Implement PaymentResponse.prototype.onpayerdetailchange. r=edenchuang,baku
Implement PaymentResponse.prototype.onpayerdetailchange, per spec.

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

--HG--
extra : moz-landing-system : lando
2018-09-19 08:41:53 +00: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
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
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
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 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
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
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 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 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
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
Eden Chuang b206167b93 Bug 1440041 - Add a new readonly attribute nsIPaymentRequest.shippingOption. r=baku. 2018-04-13 18:47:20 -07:00
Eden Chuang 1537e9d304 Bug 1441709 - Support PaymentRequest.show() with an optional PaymentDetailsUpdate promise parameter. r=baku
1. Add "optional Promise<PaymentDetailsUpdate> detailsPromise" as a parameter
   of PaymentRequest.show() in PaymentRequest.webidl.
2. Let PaymentRequest inherit from PromiseNativeHandler, and implement the
   ResolvedCallback() and RejectedCallback() to handle the PaymentDetailsUpdate
   promise.
3. Update PaymentRequest.show() implementation. If PaymentDetailsUpdate Promise
   is not nullptr, the show request would not be transferred to chrome process
   immediately until the promise is resolved/rejected.
4. Update selectedShippingOption when requestShipping is true.
5. Change the PaymentMethod id validation sequence according to the spec.

--HG--
extra : histedit_source : e591c759037cce4f66701b2faa5ecbe01c00e246
2018-04-02 23:12:21 +08:00
Henri Sivonen 2eb6c4eda3 Bug 1436903 - Avoid passing shipping options to the front end when shipping was not requested. r=baku
MozReview-Commit-ID: FdkC02izUy6

--HG--
extra : rebase_source : 4434a148379e33771950848c6cdf1350e33eb23b
2018-03-07 13:16:46 +02:00
Henri Sivonen 44e4383f36 Bug 1432079 - Implement PaymentItemType. r=baku
MozReview-Commit-ID: Jpj9arQ9MaE

--HG--
extra : rebase_source : 75dff1a752b2f85b162e6cfbc67fd563cee12993
2018-02-28 15:00:05 +02:00
Andrew McCreight 298aa82710 Bug 1412125, part 2 - Fix dom/ mode lines. r=qdot
This was automatically generated by the script modeline.py.

MozReview-Commit-ID: BgulzkGteAL

--HG--
extra : rebase_source : a4b9d16a4c06c4e85d7d85f485221b1e4ebdfede
2017-10-26 15:08:41 -07:00
Eden Chuang 3d2f4c7cfc Bug 1403080 - Return null DOMString while PaymentOptions.requestShipping is false. r=baku
--HG--
extra : rebase_source : ec5f87928253c69d834f2a7a9a0c9b3b1f523c45
2017-09-28 15:20:19 +08:00
Eden Chuang a15d19dc9d Bug 1398991 - Set PaymentRequest.ShippingOption only if options.requestShipping is true. r=baku
This patch implements the following changes according to the spec change.
See https://w3c.github.io/payment-request/#constructor step 8 for more
details.

1. Return TypeError during PaymentRequest construction with duplicate
   shippingOption id.
2. Set PaymentRequest.shippingOption with the selected shippingOption only
   if options.requestShipping is true.
2017-09-15 14:19:52 +08:00
Eden Chuang 2638e37728 Bug 1388661 - Support currency validation in PaymentRequet API. r=baku
This patch implements currency validation algorithm according to the spec
    https://w3c.github.io/payment-request/#validity-checkers.

    1. amount.currencySystem must be "urn:iso:std:iso:4217".
    2. amount.currency is valid with following criteria
       1. The currency length must be 3.
       2. The currency contains any character that must be in the range "A" to
          "Z"(U+0041 to U+005A) or the range "a" to "z"(U+0061 to U+007A).

    According to the spec, converting the currency to upper case and save it in
    nsIPaymentRequest.
2017-09-06 14:36:24 +08:00
Eden Chuang af95d86b7f Bug 1385187 - Reject PaymentRequest.show() with NotSupportedError DOMException if no supported method. r=baku
1. Create a new action response status PAYMENT_NOTSUPPORTED and get rid of
   unnecessary method isAccpeted() from nsIPaymentActionResponse.idl.
2. Create canMakePayment() in PaymentRequestService and run it before
   launching UI. If canMakePayment() returns false, send PAYMENT_NOTSUPPORTED
   back to content process.
3. If chrome process returns PAYMENT_NOTSUPPORTED when calling showPayment(),
   throw NotSupportedError DOMException to merchant side.
2017-08-28 11:55:59 +08:00
Eden Chuang 34196fb87f Bug 1383293 - Add a new readonly attribute topLevelPrincipal in nsIPaymentRequest for UI support. r=baku
Getting the top level document's principal when constructing PaymentRequest,
then sending it to chrome process and saving it in nsIPaymentRequest.
Creating a new readonly attribute nsIPrincipal topLevelPrincipal in
nsIPaymentRequest for UI to query the top level document's principal
information.
2017-08-23 14:26:51 +08:00
Eden Chuang 3aa4930b7a Bug 1379892 - Reject PaymentRequest.show() with AbortError DOMException if a request is showing. r=baku 2017-07-25 15:39:39 +08:00
Jocelyn Liu 809522fb3a Bug 1367694 - Set payment request's shippingOption and shippingType attributes when creating it. r=baku
Per spec, given details and options parameters of PaymentRequest constructor,
1) if details.shippingOptions exists and IDs of all shipping options are unique,
   request's shippingOption will be set to the last selected option's ID.
   Otherwise, set request's shippingOption to null.
2) if options.requestShipping is ture, set request's shippingType to
   options.shippingType. Otherwise, set request's shippingType to null.
2017-07-05 15:16:43 -07:00
Eden Chuang c3f02d3246 Bug 1376623 - PaymentMethodData.supportedMethods is now DOMString. r=baku 2017-07-01 01:17:12 +08:00
Eden Chuang 4282643952 Bug 1318990 - PaymentRequestUpdateEvent interface and PaymentRequest API onshippingaddress/optionchange implementation. r=baku 2017-06-23 17:15:51 +08:00
Eden Chuang 084d3f703e Bug 1345365 - PaymentRequest API canMakePayment(), abort() and show() implementation. r=baku
--HG--
extra : rebase_source : 09ea762ee2af888f090817617545c7cf7a15f1a9
2017-06-14 15:59:00 +08:00
Wes Kocher 1c6a87f4be Backed out 2 changesets (bug 1345365) for frequent failures in test_data.html a=backout
Backed out changeset 0ea7a5deacf6 (bug 1345365)
Backed out changeset bba1dee06769 (bug 1345365)

MozReview-Commit-ID: KURUgnesr8B
2017-06-15 00:52:04 -07:00
Eden Chuang 5b3b71aae6 Bug 1345365 - PaymentRequest API canMakePayment(), abort() and show() implementation. r=baku
--HG--
extra : rebase_source : 1471c9b98cd919d411b22426c55bc3159d4d2f00
2017-06-14 15:59:00 +08:00
Eden Chuang 68cf4559f8 Bug 1345361 - PaymentRequest constructor implementation. r=baku 2017-05-26 01:50:32 +08:00
Ryan VanderMeulen df9dd3967c Backed out changeset 437d6df1859c (bug 1345361) for ESLint failures. 2017-05-25 18:05:15 -04:00