mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 13:07:52 +00:00
Bug 966942 - Convert nsIDOMPaymentRequestInfo to a dictionary. r=bz, r=ferjm
This commit is contained in:
parent
524ca36ead
commit
5ebd1530d8
@ -564,7 +564,6 @@
|
||||
|
||||
@BINPATH@/components/Payment.js
|
||||
@BINPATH@/components/PaymentFlowInfo.js
|
||||
@BINPATH@/components/PaymentRequestInfo.js
|
||||
@BINPATH@/components/Payment.manifest
|
||||
|
||||
@BINPATH@/components/DownloadsAPI.js
|
||||
|
@ -569,7 +569,6 @@
|
||||
|
||||
@BINPATH@/components/Payment.js
|
||||
@BINPATH@/components/PaymentFlowInfo.js
|
||||
@BINPATH@/components/PaymentRequestInfo.js
|
||||
@BINPATH@/components/Payment.manifest
|
||||
|
||||
#ifdef MOZ_WEBRTC
|
||||
|
@ -93,9 +93,6 @@ let PaymentManager = {
|
||||
if (!pr) {
|
||||
continue;
|
||||
}
|
||||
if (!(pr instanceof Ci.nsIDOMPaymentRequestInfo)) {
|
||||
return;
|
||||
}
|
||||
// We consider jwt type repetition an error.
|
||||
if (jwtTypes[pr.type]) {
|
||||
this.paymentFailed(requestId,
|
||||
@ -342,17 +339,7 @@ let PaymentManager = {
|
||||
}
|
||||
|
||||
let pldRequest = payloadObject.request;
|
||||
let request = Cc["@mozilla.org/payment/request-info;1"]
|
||||
.createInstance(Ci.nsIDOMPaymentRequestInfo);
|
||||
if (!request) {
|
||||
this.paymentFailed(aRequestId,
|
||||
"INTERNAL_ERROR_ERROR_CREATING_PAY_REQUEST");
|
||||
return true;
|
||||
}
|
||||
request.wrappedJSObject.init(aJwt,
|
||||
payloadObject.typ,
|
||||
provider.name);
|
||||
return request;
|
||||
return { jwt: aJwt, type: payloadObject.typ, providerName: provider.name };
|
||||
},
|
||||
|
||||
showPaymentFlow: function showPaymentFlow(aRequestId,
|
||||
|
@ -4,6 +4,3 @@ category JavaScript-navigator-property mozPay @mozilla.org/payment/content-helpe
|
||||
|
||||
component {b8bce4e7-fbf0-4719-a634-b1bf9018657c} PaymentFlowInfo.js
|
||||
contract @mozilla.org/payment/flow-info;1 {b8bce4e7-fbf0-4719-a634-b1bf9018657c}
|
||||
|
||||
component {0a58c67d-f003-48da-81d1-bd8f605f4b1c} PaymentRequestInfo.js
|
||||
contract @mozilla.org/payment/request-info;1 {0a58c67d-f003-48da-81d1-bd8f605f4b1c}
|
||||
|
@ -1,41 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
"use strict";
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const PAYMENTREQUESTINFO_CID =
|
||||
Components.ID("{0a58c67d-f003-48da-81d1-bd8f605f4b1c}");
|
||||
|
||||
// nsIDOMPaymentRequestInfo
|
||||
|
||||
function PaymentRequestInfo() {
|
||||
this.wrappedJSObject = this;
|
||||
};
|
||||
|
||||
PaymentRequestInfo.prototype = {
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMPaymentRequestInfo]),
|
||||
classID: PAYMENTREQUESTINFO_CID,
|
||||
classInfo: XPCOMUtils.generateCI({
|
||||
classID: PAYMENTREQUESTINFO_CID,
|
||||
contractID: "@mozilla.org/payment/request-info;1",
|
||||
classDescription: "Payment request information",
|
||||
flags: Ci.nsIClassInfo.DOM_OBJECT,
|
||||
interfaces: [Ci.nsIDOMPaymentRequestInfo]
|
||||
}),
|
||||
jwt: null,
|
||||
type: null,
|
||||
providerName: null,
|
||||
|
||||
init: function init(aJwt, aType, aProviderName) {
|
||||
this.jwt = aJwt;
|
||||
this.type = aType;
|
||||
this.providerName = aProviderName;
|
||||
}
|
||||
};
|
||||
|
||||
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentRequestInfo]);
|
@ -5,7 +5,6 @@
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMPaymentRequestInfo.idl',
|
||||
'nsINavigatorPayment.idl',
|
||||
'nsIPaymentFlowInfo.idl',
|
||||
'nsIPaymentUIGlue.idl',
|
||||
|
@ -1,19 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(93462984-0e9a-4016-bdb4-a24a88c08a29)]
|
||||
interface nsIDOMPaymentRequestInfo : nsISupports
|
||||
{
|
||||
// Base64 encoded and digitally signed payment request.
|
||||
readonly attribute DOMString jwt;
|
||||
|
||||
// JWT type that identifies the payment provider owner of the payment request
|
||||
// format.
|
||||
readonly attribute DOMString type;
|
||||
|
||||
// Payment provider name.
|
||||
readonly attribute DOMString providerName;
|
||||
};
|
@ -16,6 +16,5 @@ EXTRA_COMPONENTS += [
|
||||
'Payment.js',
|
||||
'Payment.manifest',
|
||||
'PaymentFlowInfo.js',
|
||||
'PaymentRequestInfo.js',
|
||||
]
|
||||
|
||||
|
@ -585,7 +585,6 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
|
||||
|
||||
@BINPATH@/components/Payment.js
|
||||
@BINPATH@/components/PaymentFlowInfo.js
|
||||
@BINPATH@/components/PaymentRequestInfo.js
|
||||
@BINPATH@/components/Payment.manifest
|
||||
@BINPATH@/components/PaymentsUI.js
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user