Bug 1435161 - Part 1 Removing unnecessary XPCOM components for PaymentRequest API. r=baku
authorEden Chuang <echuang@mozilla.com>
Thu, 30 Aug 2018 14:13:33 +0200
changeset 435642 ead0d6dcd6f07f4722fb20c2eb4628840343c4d9
parent 435641 c3bb55a328e0ab6e852ce4cb141e81b007a606d1
child 435643 e65bec7e01c82025e19af0f9c11a492788d816df
push id34616
push usercsabou@mozilla.com
push dateTue, 11 Sep 2018 10:07:11 +0000
treeherdermozilla-central@423bdf7a802b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1435161
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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.
dom/interfaces/payments/moz.build
dom/interfaces/payments/nsIPaymentActionRequest.idl
dom/interfaces/payments/nsIPaymentRequest.idl
dom/interfaces/payments/nsIPaymentRequestService.idl
dom/payments/PaymentActionRequest.cpp
dom/payments/PaymentActionRequest.h
dom/payments/PaymentRequestData.cpp
dom/payments/PaymentRequestData.h
dom/payments/PaymentRequestModule.cpp
dom/payments/PaymentRequestService.cpp
dom/payments/PaymentRequestService.h
dom/payments/ipc/PaymentRequestParent.cpp
dom/payments/ipc/PaymentRequestParent.h
dom/payments/moz.build
--- a/dom/interfaces/payments/moz.build
+++ b/dom/interfaces/payments/moz.build
@@ -1,16 +1,15 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 XPIDL_SOURCES += [
-    'nsIPaymentActionRequest.idl',
     'nsIPaymentActionResponse.idl',
     'nsIPaymentAddress.idl',
     'nsIPaymentRequest.idl',
     'nsIPaymentRequestService.idl',
     'nsIPaymentUIService.idl',
 ]
 
 XPIDL_MODULE = 'dom_payments'
deleted file mode 100644
--- a/dom/interfaces/payments/nsIPaymentActionRequest.idl
+++ /dev/null
@@ -1,161 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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"
-#include "nsIVariant.idl"
-#include "nsIPaymentRequest.idl"
-#include "nsIPaymentActionResponse.idl"
-#include "nsIPaymentAddress.idl"
-
-interface nsIArray;
-
-[builtinclass, uuid(3fef5459-b0ea-469b-be9f-b99e8ca75d3d)]
-interface nsIPaymentActionCallback : nsISupports
-{
-  void respondPayment(in nsIPaymentActionResponse aResponse);
-  void changeShippingAddress(in AString aRequestId, in nsIPaymentAddress aAddress);
-  void changeShippingOption(in AString aRequestId, in AString aOption);
-};
-
-[builtinclass, uuid(7ddbe8be-beac-4952-96f6-619981dff7a6)]
-interface nsIPaymentActionRequest : nsISupports
-{
-  const uint32_t UNKNOWN_ACTION = 0;
-  const uint32_t CREATE_ACTION = 1;
-  const uint32_t CANMAKE_ACTION = 2;
-  const uint32_t SHOW_ACTION = 3;
-  const uint32_t ABORT_ACTION = 4;
-  const uint32_t COMPLETE_ACTION = 5;
-  const uint32_t UPDATE_ACTION = 6;
-  const uint32_t CLOSE_ACTION = 7;
-
-  /*
-   *  The payment request identifier.
-   */
-  readonly attribute AString requestId;
-
-  /*
-   *  The type of the requested task.
-   */
-  readonly attribute uint32_t type;
-
-  /*
-   *  The callback for the response from UI module
-   */
-  readonly attribute nsIPaymentActionCallback callback;
-
-  /*
-   *  Initialize function for this request.
-   */
-  void init(in AString aRequestId,
-            in uint32_t aType,
-            in nsIPaymentActionCallback aCallback);
-};
-
-[builtinclass, uuid(1d38dce6-8bcd-441b-aa94-68e300b6e175)]
-interface nsIPaymentCreateActionRequest : nsIPaymentActionRequest
-{
-  /*
-   *  The tab identifier
-   */
-  readonly attribute uint64_t tabId;
-
-  /*
-   *  The top level document's principal
-   */
-  readonly attribute nsIPrincipal topLevelPrincipal;
-
-  /*
-   *  The methodData information of the payment request.
-   */
-  readonly attribute nsIArray methodData;
-
-  /*
-   *  The Details information of the payment request.
-   */
-  readonly attribute nsIPaymentDetails details;
-
-  /*
-   *  The Options information of the payment request.
-   */
-  readonly attribute nsIPaymentOptions options;
-
-  /*
-   *  The selected shipping option of the payment request;
-   */
-  readonly attribute AString shippingOption;
-
-  /*
-   *  Initialize function the this request.
-   */
-  void initRequest(in AString aRequestId,
-                   in nsIPaymentActionCallback aCallback,
-                   in uint64_t aTabId,
-                   in nsIPrincipal aPrincipal,
-                   in nsIArray aMethodData,
-                   in nsIPaymentDetails aDetails,
-                   in nsIPaymentOptions aOptions,
-                   in AString aShippingOption);
-};
-
-[builtinclass, uuid(4429697d-1135-47de-a46e-5196d399ec55)]
-interface nsIPaymentCompleteActionRequest : nsIPaymentActionRequest
-{
-  /*
-   *  The complete status from merchant side.
-   */
-  readonly attribute AString completeStatus;
-
-  /*
-   *  Initialize function for this request.
-   */
-  void initRequest(in AString aRequestId,
-                   in nsIPaymentActionCallback aCallback,
-                   in AString aCompleteStatus);
-};
-
-[builtinclass, uuid(21f631e8-c047-4fd8-b3c6-68e26c62639a)]
-interface nsIPaymentUpdateActionRequest : nsIPaymentActionRequest
-{
-  /*
-   *  The details information for updating the specified payment request.
-   */
-  readonly attribute nsIPaymentDetails details;
-
-  /*
-   *  The selected shipping option information
-   */
-  readonly attribute AString shippingOption;
-
-  /*
-   *  Initialize function for this request.
-   */
-  void initRequest(in AString aRequestId,
-                   in nsIPaymentActionCallback aCallback,
-                   in nsIPaymentDetails aDetails,
-                   in AString aShippingOption);
-};
-
-%{C++
-#define NS_PAYMENT_ACTION_REQUEST_CID \
-  { 0x7ddbe8be, 0xbeac, 0x4952, { 0x96, 0xf6, 0x61, 0x99, 0x81, 0xdf, 0xf7, 0xa6 } }
-#define NS_PAYMENT_ACTION_REQUEST_CONTRACT_ID \
-  "@mozilla.org/dom/payments/payment-action-request;1"
-
-#define NS_PAYMENT_CREATE_ACTION_REQUEST_CID \
-  { 0x1d38dce6, 0x8bcd, 0x441b, { 0xaa, 0x94, 0x68, 0xe3, 0x00, 0xb6, 0xe1, 0x75 } }
-#define NS_PAYMENT_CREATE_ACTION_REQUEST_CONTRACT_ID \
-  "@mozilla.org/dom/payments/payment-create-action-request;1"
-
-#define NS_PAYMENT_COMPLETE_ACTION_REQUEST_CID \
-  { 0x4429697d, 0x1135, 0x47de, { 0xa4, 0x6e, 0x51, 0x96, 0xd3, 0x99, 0xec, 0x55 } }
-#define NS_PAYMENT_COMPLETE_ACTION_REQUEST_CONTRACT_ID \
-  "@mozilla.org/dom/payments/payment-complete-action-request;1"
-
-#define NS_PAYMENT_UPDATE_ACTION_REQUEST_CID \
-  { 0x21f631e8, 0xc047, 0x4fd8, { 0xb3, 0xc6, 0x68, 0xe2, 0x6c, 0x62, 0x63, 0x9a } }
-#define NS_PAYMENT_UPDATE_ACTION_REQUEST_CONTRACT_ID \
-  "@mozilla.org/dom/payments/payment-update-action-request;1"
-%}
--- a/dom/interfaces/payments/nsIPaymentRequest.idl
+++ b/dom/interfaces/payments/nsIPaymentRequest.idl
@@ -58,19 +58,16 @@ interface nsIPaymentDetails : nsISupport
   readonly attribute AString id;
   readonly attribute nsIPaymentItem totalItem;
   readonly attribute nsIArray displayItems;
   readonly attribute nsIArray shippingOptions;
   readonly attribute nsIArray modifiers;
   readonly attribute AString error;
   [implicit_jscontext]
   readonly attribute jsval shippingAddressErrors;
-
-  void update(in nsIPaymentDetails aDetails, in boolean aRequestShipping);
-  AString shippingAddressErrorsJSON();
 };
 
 [scriptable, builtinclass, uuid(d53f9f20-138e-47cc-9fd5-db16a3f6d301)]
 interface nsIPaymentOptions : nsISupports
 {
   readonly attribute boolean requestPayerName;
   readonly attribute boolean requestPayerEmail;
   readonly attribute boolean requestPayerPhone;
@@ -84,13 +81,9 @@ interface nsIPaymentRequest : nsISupport
   readonly attribute uint64_t tabId;
   readonly attribute nsIPrincipal topLevelPrincipal;
   readonly attribute AString requestId;
   readonly attribute AString completeStatus;
   readonly attribute nsIArray paymentMethods;
   readonly attribute nsIPaymentDetails paymentDetails;
   readonly attribute nsIPaymentOptions paymentOptions;
   readonly attribute AString shippingOption;
-
-  [noscript] void setCompleteStatus(in AString aCompleteStatus);
-  void updatePaymentDetails(in nsIPaymentDetails aDetails,
-                            in AString aShippingOption);
 };
--- a/dom/interfaces/payments/nsIPaymentRequestService.idl
+++ b/dom/interfaces/payments/nsIPaymentRequestService.idl
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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"
 #include "nsIVariant.idl"
 #include "nsIPaymentRequest.idl"
-#include "nsIPaymentActionRequest.idl"
 #include "nsIPaymentActionResponse.idl"
 #include "nsIPaymentAddress.idl"
 #include "nsISimpleEnumerator.idl"
 #include "nsIPaymentUIService.idl"
 
 /**
  *  nsPaymentRequestService is used to manage the created PaymentRequest in the
  *  chrome process. It is also the IPC agent for payment UI to communicate with
@@ -65,32 +64,16 @@ interface nsIPaymentRequestService : nsI
    */
   void cleanup();
 
   /**
    *  Setup the customized nsIPaymentUIService.
    *  This API is for testing only.
    */
   void setTestingUIService(in nsIPaymentUIService aUIService);
-
-  /**
-   *  Request a specified action on the specified PaymentRequest.
-   *  @param aRequest - the requested action.
-   */
-  void requestPayment(in nsIPaymentActionRequest aRequest);
-
-  /**
-   *  This is a cleanup function to break the association between
-   *  nsIPaymentRequestService and nsIPaymentActionCallback.
-   *  nsIPaymentActionCallback is an interface that registered to
-   *  nsIPaymentRequestService when the merchant asks to perform actions, and it
-   *  will be called when user's response send back to nsIPaymentRequestService.
-   *  @param aCallback - the specified nsIPaymentActionCallback.
-   */
-  void removeActionCallback(in nsIPaymentActionCallback aCallback);
 };
 
 %{C++
 #define NS_PAYMENT_REQUEST_SERVICE_CID \
   { 0xcccd665f, 0xedf3, 0x41fc, { 0xab, 0x9b, 0xfc, 0x55, 0xb3, 0x73, 0x40, 0xaa } }
 #define NS_PAYMENT_REQUEST_SERVICE_CONTRACT_ID \
   "@mozilla.org/dom/payments/payment-request-service;1"
 %}
deleted file mode 100644
--- a/dom/payments/PaymentActionRequest.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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 "nsArrayUtils.h"
-#include "nsIMutableArray.h"
-#include "PaymentActionRequest.h"
-#include "PaymentRequestData.h"
-
-using namespace mozilla::dom::payments;
-
-namespace mozilla {
-namespace dom {
-
-/* PaymentActionRequest */
-
-NS_IMPL_ISUPPORTS(PaymentActionRequest,
-                  nsIPaymentActionRequest)
-
-PaymentActionRequest::PaymentActionRequest()
-  : mRequestId(EmptyString())
-  , mType(nsIPaymentActionRequest::UNKNOWN_ACTION)
-  , mCallback(nullptr)
-{
-}
-
-NS_IMETHODIMP
-PaymentActionRequest::Init(const nsAString& aRequestId,
-                           const uint32_t aType,
-                           nsIPaymentActionCallback* aCallback)
-{
-  mRequestId = aRequestId;
-  mType = aType;
-  mCallback = aCallback;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentActionRequest::GetRequestId(nsAString& aRequestId)
-{
-  aRequestId = mRequestId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentActionRequest::GetType(uint32_t* aType)
-{
-  *aType = mType;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentActionRequest::GetCallback(nsIPaymentActionCallback** aCallback)
-{
-  NS_ENSURE_ARG_POINTER(aCallback);
-  nsCOMPtr<nsIPaymentActionCallback> callback = mCallback;
-  callback.forget(aCallback);
-  return NS_OK;
-}
-
-/* PaymentCreateActionRequest */
-
-NS_IMPL_ISUPPORTS_INHERITED(PaymentCreateActionRequest,
-                            PaymentActionRequest,
-                            nsIPaymentCreateActionRequest)
-
-PaymentCreateActionRequest::PaymentCreateActionRequest()
-  : mTabId(0)
-{
-}
-
-NS_IMETHODIMP
-PaymentCreateActionRequest::InitRequest(const nsAString& aRequestId,
-                                        nsIPaymentActionCallback* aCallback,
-                                        const uint64_t aTabId,
-                                        nsIPrincipal* aTopLevelPrincipal,
-                                        nsIArray* aMethodData,
-                                        nsIPaymentDetails* aDetails,
-                                        nsIPaymentOptions* aOptions,
-                                        const nsAString& aShippingOption)
-{
-  NS_ENSURE_ARG_POINTER(aCallback);
-  NS_ENSURE_ARG_POINTER(aTopLevelPrincipal);
-  NS_ENSURE_ARG_POINTER(aMethodData);
-  NS_ENSURE_ARG_POINTER(aDetails);
-  NS_ENSURE_ARG_POINTER(aOptions);
-  nsresult rv = Init(aRequestId, nsIPaymentActionRequest::CREATE_ACTION, aCallback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-  mTabId = aTabId;
-  mTopLevelPrincipal = aTopLevelPrincipal;
-  mMethodData = aMethodData;
-  mDetails = aDetails;
-  mOptions = aOptions;
-  mShippingOption = aShippingOption;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentCreateActionRequest::GetTabId(uint64_t* aTabId)
-{
-  NS_ENSURE_ARG_POINTER(aTabId);
-  *aTabId = mTabId;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentCreateActionRequest::GetTopLevelPrincipal(nsIPrincipal** aTopLevelPrincipal)
-{
-  NS_ENSURE_ARG_POINTER(aTopLevelPrincipal);
-  MOZ_ASSERT(mTopLevelPrincipal);
-  nsCOMPtr<nsIPrincipal> principal = mTopLevelPrincipal;
-  principal.forget(aTopLevelPrincipal);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentCreateActionRequest::GetMethodData(nsIArray** aMethodData)
-{
-  NS_ENSURE_ARG_POINTER(aMethodData);
-  MOZ_ASSERT(mMethodData);
-  nsCOMPtr<nsIArray> methodData = mMethodData;
-  methodData.forget(aMethodData);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentCreateActionRequest::GetDetails(nsIPaymentDetails** aDetails)
-{
-  NS_ENSURE_ARG_POINTER(aDetails);
-  MOZ_ASSERT(mDetails);
-  nsCOMPtr<nsIPaymentDetails> details = mDetails;
-  details.forget(aDetails);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentCreateActionRequest::GetOptions(nsIPaymentOptions** aOptions)
-{
-  NS_ENSURE_ARG_POINTER(aOptions);
-  MOZ_ASSERT(mOptions);
-  nsCOMPtr<nsIPaymentOptions> options = mOptions;
-  options.forget(aOptions);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentCreateActionRequest::GetShippingOption(nsAString& aShippingOption)
-{
-  aShippingOption = mShippingOption;
-  return NS_OK;
-}
-
-/* PaymentCompleteActionRequest */
-
-NS_IMPL_ISUPPORTS_INHERITED(PaymentCompleteActionRequest,
-                            PaymentActionRequest,
-                            nsIPaymentCompleteActionRequest)
-
-PaymentCompleteActionRequest::PaymentCompleteActionRequest()
-  : mCompleteStatus(EmptyString())
-{
-}
-
-NS_IMETHODIMP
-PaymentCompleteActionRequest::GetCompleteStatus(nsAString& aCompleteStatus)
-{
-  aCompleteStatus = mCompleteStatus;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentCompleteActionRequest::InitRequest(const nsAString& aRequestId,
-                                          nsIPaymentActionCallback* aCallback,
-                                          const nsAString& aCompleteStatus)
-{
-  NS_ENSURE_ARG_POINTER(aCallback);
-  nsresult rv = Init(aRequestId, nsIPaymentActionRequest::COMPLETE_ACTION, aCallback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-  mCompleteStatus = aCompleteStatus;
-  return NS_OK;
-}
-
-/* PaymentUpdateActionRequest */
-
-NS_IMPL_ISUPPORTS_INHERITED(PaymentUpdateActionRequest,
-                            PaymentActionRequest,
-                            nsIPaymentUpdateActionRequest)
-
-NS_IMETHODIMP
-PaymentUpdateActionRequest::GetDetails(nsIPaymentDetails** aDetails)
-{
-  NS_ENSURE_ARG_POINTER(aDetails);
-  MOZ_ASSERT(mDetails);
-  nsCOMPtr<nsIPaymentDetails> details = mDetails;
-  details.forget(aDetails);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentUpdateActionRequest::GetShippingOption(nsAString& aShippingOption)
-{
-  aShippingOption = mShippingOption;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-PaymentUpdateActionRequest::InitRequest(const nsAString& aRequestId,
-                                        nsIPaymentActionCallback* aCallback,
-                                        nsIPaymentDetails* aDetails,
-                                        const nsAString& aShippingOption)
-{
-  NS_ENSURE_ARG_POINTER(aCallback);
-  NS_ENSURE_ARG_POINTER(aDetails);
-  nsresult rv = Init(aRequestId, nsIPaymentActionRequest::UPDATE_ACTION, aCallback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-  mDetails = aDetails;
-  mShippingOption = aShippingOption;
-  return NS_OK;
-}
-
-} // end of namespace dom
-} // end of namespace mozilla
deleted file mode 100644
--- a/dom/payments/PaymentActionRequest.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_dom_PaymentActionRequest_h
-#define mozilla_dom_PaymentActionRequest_h
-
-#include "nsIPaymentActionRequest.h"
-#include "nsCOMPtr.h"
-#include "nsIArray.h"
-#include "nsString.h"
-
-namespace mozilla {
-namespace dom {
-
-class PaymentActionRequest : public nsIPaymentActionRequest
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIPAYMENTACTIONREQUEST
-
-  PaymentActionRequest();
-
-protected:
-  virtual ~PaymentActionRequest() = default;
-
-  nsString mRequestId;
-  uint32_t mType;
-  nsCOMPtr<nsIPaymentActionCallback> mCallback;
-};
-
-class PaymentCreateActionRequest final : public nsIPaymentCreateActionRequest
-                                       , public PaymentActionRequest
-{
-public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_FORWARD_NSIPAYMENTACTIONREQUEST(PaymentActionRequest::)
-  NS_DECL_NSIPAYMENTCREATEACTIONREQUEST
-
-  PaymentCreateActionRequest();
-
-private:
-  ~PaymentCreateActionRequest() = default;
-
-  uint64_t mTabId;
-  nsCOMPtr<nsIPrincipal> mTopLevelPrincipal;
-  nsCOMPtr<nsIArray> mMethodData;
-  nsCOMPtr<nsIPaymentDetails> mDetails;
-  nsCOMPtr<nsIPaymentOptions> mOptions;
-  nsString mShippingOption;
-};
-
-class PaymentCompleteActionRequest final : public nsIPaymentCompleteActionRequest
-                                         , public PaymentActionRequest
-{
-public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_FORWARD_NSIPAYMENTACTIONREQUEST(PaymentActionRequest::)
-  NS_DECL_NSIPAYMENTCOMPLETEACTIONREQUEST
-
-  PaymentCompleteActionRequest();
-
-private:
-  ~PaymentCompleteActionRequest() = default;
-
-  nsString mCompleteStatus;
-};
-
-class PaymentUpdateActionRequest final : public nsIPaymentUpdateActionRequest
-                                       , public PaymentActionRequest
-{
-public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_FORWARD_NSIPAYMENTACTIONREQUEST(PaymentActionRequest::)
-  NS_DECL_NSIPAYMENTUPDATEACTIONREQUEST
-
-  PaymentUpdateActionRequest() = default;
-private:
-  ~PaymentUpdateActionRequest() = default;
-
-  nsCOMPtr<nsIPaymentDetails> mDetails;
-  nsString mShippingOption;
-};
-
-} // end of namespace dom
-} // end of namespace mozilla
-
-#endif
--- a/dom/payments/PaymentRequestData.cpp
+++ b/dom/payments/PaymentRequestData.cpp
@@ -478,17 +478,17 @@ PaymentDetails::GetShippingAddressErrors
   AddressErrors errors;
   errors.Init(mShippingAddressErrors);
   if (!ToJSValue(aCx, errors, aErrors)) {
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP
+nsresult
 PaymentDetails::Update(nsIPaymentDetails* aDetails, const bool aRequestShipping)
 {
   MOZ_ASSERT(aDetails);
   /*
    * According to the spec [1], update the attributes if they present in new
    * details (i.e., PaymentDetailsUpdate); otherwise, keep original value.
    * Note |id| comes only from initial details (i.e., PaymentDetailsInit) and
    * |error| only from new details.
@@ -528,25 +528,28 @@ PaymentDetails::Update(nsIPaymentDetails
     mModifiers = modifiers;
   }
 
   rv = aDetails->GetError(mError);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  aDetails->ShippingAddressErrorsJSON(mShippingAddressErrors);
+  PaymentDetails* rowDetails = static_cast<PaymentDetails*>(aDetails);
+  MOZ_ASSERT(rowDetails);
+  mShippingAddressErrors = rowDetails->GetShippingAddressErrors();
+
   return NS_OK;
 
 }
-NS_IMETHODIMP
-PaymentDetails::ShippingAddressErrorsJSON(nsAString& aErrors)
+
+nsString
+PaymentDetails::GetShippingAddressErrors() const
 {
-  aErrors = mShippingAddressErrors;
-  return NS_OK;
+  return mShippingAddressErrors;
 }
 
 /* PaymentOptions */
 
 NS_IMPL_ISUPPORTS(PaymentOptions,
                   nsIPaymentOptions)
 
 PaymentOptions::PaymentOptions(const bool aRequestPayerName,
@@ -696,35 +699,37 @@ PaymentRequest::GetPaymentOptions(nsIPay
 
 NS_IMETHODIMP
 PaymentRequest::GetShippingOption(nsAString& aShippingOption)
 {
   aShippingOption = mShippingOption;
   return NS_OK;
 }
 
-NS_IMETHODIMP
+nsresult
 PaymentRequest::UpdatePaymentDetails(nsIPaymentDetails* aPaymentDetails,
                                      const nsAString& aShippingOption)
 {
   MOZ_ASSERT(aPaymentDetails);
   bool requestShipping;
   nsresult rv = mPaymentOptions->GetRequestShipping(&requestShipping);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
   mShippingOption = aShippingOption;
-  return mPaymentDetails->Update(aPaymentDetails, requestShipping);
+
+  PaymentDetails* rowDetails = static_cast<PaymentDetails*>(mPaymentDetails.get());
+  MOZ_ASSERT(rowDetails);
+  return rowDetails->Update(aPaymentDetails, requestShipping);
 }
 
-NS_IMETHODIMP
+void
 PaymentRequest::SetCompleteStatus(const nsAString& aCompleteStatus)
 {
   mCompleteStatus = aCompleteStatus;
-  return NS_OK;
 }
 
 NS_IMETHODIMP
 PaymentRequest::GetCompleteStatus(nsAString& aCompleteStatus)
 {
   aCompleteStatus = mCompleteStatus;
   return NS_OK;
 }
--- a/dom/payments/PaymentRequestData.h
+++ b/dom/payments/PaymentRequestData.h
@@ -5,17 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_PaymentRequestData_h
 #define mozilla_dom_PaymentRequestData_h
 
 #include "nsIPaymentAddress.h"
 #include "nsIPaymentRequest.h"
 #include "nsCOMPtr.h"
-#include "mozilla/dom/PPaymentRequest.h"
+#include "mozilla/dom/PaymentRequestParent.h"
 
 namespace mozilla {
 namespace dom {
 namespace payments {
 
 class PaymentMethodData final : public nsIPaymentMethodData
 {
 public:
@@ -126,16 +126,18 @@ class PaymentDetails final : public nsIP
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPAYMENTDETAILS
 
 
   static nsresult Create(const IPCPaymentDetails& aIPCDetails,
                          nsIPaymentDetails** aDetails);
+  nsresult Update(nsIPaymentDetails* aDetails, const bool aRequestShipping);
+  nsString GetShippingAddressErrors() const;
 private:
   PaymentDetails(const nsAString& aId,
                  nsIPaymentItem* aTotalItem,
                  nsIArray* aDisplayItems,
                  nsIArray* aShippingOptions,
                  nsIArray* aModifiers,
                  const nsAString& aError,
                  const nsAString& aShippingAddressError);
@@ -184,27 +186,48 @@ public:
   PaymentRequest(const uint64_t aTabId,
                  const nsAString& aRequestId,
                  nsIPrincipal* aPrincipal,
                  nsIArray* aPaymentMethods,
                  nsIPaymentDetails* aPaymentDetails,
                  nsIPaymentOptions* aPaymentOptions,
                  const nsAString& aShippingOption);
 
+  void SetIPC(PaymentRequestParent* aIPC)
+  {
+    mIPC = aIPC;
+  }
+
+  PaymentRequestParent* GetIPC() const
+  {
+    return mIPC;
+  }
+
+  nsresult
+  UpdatePaymentDetails(nsIPaymentDetails* aPaymentDetails,
+                       const nsAString& aShippingOption);
+
+  void
+  SetCompleteStatus(const nsAString& aCompleteStatus);
+
 private:
   ~PaymentRequest() = default;
 
   uint64_t mTabId;
   nsString mRequestId;
   nsString mCompleteStatus;
   nsCOMPtr<nsIPrincipal> mTopLevelPrincipal;
   nsCOMPtr<nsIArray> mPaymentMethods;
   nsCOMPtr<nsIPaymentDetails> mPaymentDetails;
   nsCOMPtr<nsIPaymentOptions> mPaymentOptions;
   nsString mShippingOption;
+
+  // IPC's life cycle should be controlled by IPC mechanism.
+  // PaymentRequest should not own the reference of it.
+  PaymentRequestParent* mIPC;
 };
 
 class PaymentAddress final : public nsIPaymentAddress
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPAYMENTADDRESS
 
--- a/dom/payments/PaymentRequestModule.cpp
+++ b/dom/payments/PaymentRequestModule.cpp
@@ -1,99 +1,74 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "mozilla/ModuleUtils.h"
-#include "PaymentActionRequest.h"
 #include "PaymentActionResponse.h"
 #include "PaymentRequestData.h"
 #include "PaymentRequestService.h"
 
 using mozilla::dom::GeneralResponseData;
 using mozilla::dom::BasicCardResponseData;
-using mozilla::dom::PaymentActionRequest;
-using mozilla::dom::PaymentCreateActionRequest;
-using mozilla::dom::PaymentCompleteActionRequest;
-using mozilla::dom::PaymentUpdateActionRequest;
 using mozilla::dom::PaymentCanMakeActionResponse;
 using mozilla::dom::PaymentAbortActionResponse;
 using mozilla::dom::PaymentShowActionResponse;
 using mozilla::dom::PaymentCompleteActionResponse;
 using mozilla::dom::payments::PaymentAddress;
 using mozilla::dom::PaymentRequestService;
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(GeneralResponseData)
 NS_GENERIC_FACTORY_CONSTRUCTOR(BasicCardResponseData)
-NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentActionRequest)
-NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentCreateActionRequest)
-NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentCompleteActionRequest)
-NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentUpdateActionRequest)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentCanMakeActionResponse)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentAbortActionResponse)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentShowActionResponse)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentCompleteActionResponse)
 NS_GENERIC_FACTORY_CONSTRUCTOR(PaymentAddress)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(PaymentRequestService,
                                          PaymentRequestService::GetSingleton)
 
 NS_DEFINE_NAMED_CID(NS_GENERAL_RESPONSE_DATA_CID);
 NS_DEFINE_NAMED_CID(NS_BASICCARD_RESPONSE_DATA_CID);
-NS_DEFINE_NAMED_CID(NS_PAYMENT_ACTION_REQUEST_CID);
-NS_DEFINE_NAMED_CID(NS_PAYMENT_CREATE_ACTION_REQUEST_CID);
-NS_DEFINE_NAMED_CID(NS_PAYMENT_COMPLETE_ACTION_REQUEST_CID);
-NS_DEFINE_NAMED_CID(NS_PAYMENT_UPDATE_ACTION_REQUEST_CID);
 NS_DEFINE_NAMED_CID(NS_PAYMENT_CANMAKE_ACTION_RESPONSE_CID);
 NS_DEFINE_NAMED_CID(NS_PAYMENT_ABORT_ACTION_RESPONSE_CID);
 NS_DEFINE_NAMED_CID(NS_PAYMENT_SHOW_ACTION_RESPONSE_CID);
 NS_DEFINE_NAMED_CID(NS_PAYMENT_COMPLETE_ACTION_RESPONSE_CID);
 NS_DEFINE_NAMED_CID(NS_PAYMENT_ADDRESS_CID);
 NS_DEFINE_NAMED_CID(NS_PAYMENT_REQUEST_SERVICE_CID);
 
 static const mozilla::Module::CIDEntry kPaymentRequestCIDs[] = {
   { &kNS_GENERAL_RESPONSE_DATA_CID, false, nullptr, GeneralResponseDataConstructor},
   { &kNS_BASICCARD_RESPONSE_DATA_CID, false, nullptr, BasicCardResponseDataConstructor},
-  { &kNS_PAYMENT_ACTION_REQUEST_CID, false, nullptr, PaymentActionRequestConstructor},
-  { &kNS_PAYMENT_CREATE_ACTION_REQUEST_CID, false, nullptr, PaymentCreateActionRequestConstructor},
-  { &kNS_PAYMENT_COMPLETE_ACTION_REQUEST_CID, false, nullptr, PaymentCompleteActionRequestConstructor},
-  { &kNS_PAYMENT_UPDATE_ACTION_REQUEST_CID, false, nullptr, PaymentUpdateActionRequestConstructor},
   { &kNS_PAYMENT_CANMAKE_ACTION_RESPONSE_CID, false, nullptr, PaymentCanMakeActionResponseConstructor},
   { &kNS_PAYMENT_ABORT_ACTION_RESPONSE_CID, false, nullptr, PaymentAbortActionResponseConstructor},
   { &kNS_PAYMENT_SHOW_ACTION_RESPONSE_CID, false, nullptr, PaymentShowActionResponseConstructor},
   { &kNS_PAYMENT_COMPLETE_ACTION_RESPONSE_CID, false, nullptr, PaymentCompleteActionResponseConstructor},
   { &kNS_PAYMENT_ADDRESS_CID, false, nullptr, PaymentAddressConstructor},
   { &kNS_PAYMENT_REQUEST_SERVICE_CID, true, nullptr, PaymentRequestServiceConstructor },
   { nullptr }
 };
 
 static const mozilla::Module::ContractIDEntry kPaymentRequestContracts[] = {
   { NS_GENERAL_RESPONSE_DATA_CONTRACT_ID, &kNS_GENERAL_RESPONSE_DATA_CID },
   { NS_BASICCARD_RESPONSE_DATA_CONTRACT_ID, &kNS_BASICCARD_RESPONSE_DATA_CID },
-  { NS_PAYMENT_ACTION_REQUEST_CONTRACT_ID, &kNS_PAYMENT_ACTION_REQUEST_CID },
-  { NS_PAYMENT_CREATE_ACTION_REQUEST_CONTRACT_ID, &kNS_PAYMENT_CREATE_ACTION_REQUEST_CID },
-  { NS_PAYMENT_COMPLETE_ACTION_REQUEST_CONTRACT_ID, &kNS_PAYMENT_COMPLETE_ACTION_REQUEST_CID },
-  { NS_PAYMENT_UPDATE_ACTION_REQUEST_CONTRACT_ID, &kNS_PAYMENT_UPDATE_ACTION_REQUEST_CID },
   { NS_PAYMENT_CANMAKE_ACTION_RESPONSE_CONTRACT_ID, &kNS_PAYMENT_CANMAKE_ACTION_RESPONSE_CID },
   { NS_PAYMENT_ABORT_ACTION_RESPONSE_CONTRACT_ID, &kNS_PAYMENT_ABORT_ACTION_RESPONSE_CID },
   { NS_PAYMENT_SHOW_ACTION_RESPONSE_CONTRACT_ID, &kNS_PAYMENT_SHOW_ACTION_RESPONSE_CID },
   { NS_PAYMENT_COMPLETE_ACTION_RESPONSE_CONTRACT_ID, &kNS_PAYMENT_COMPLETE_ACTION_RESPONSE_CID },
   { NS_PAYMENT_ADDRESS_CONTRACT_ID, &kNS_PAYMENT_ADDRESS_CID },
   { NS_PAYMENT_REQUEST_SERVICE_CONTRACT_ID, &kNS_PAYMENT_REQUEST_SERVICE_CID },
   { nullptr }
 };
 
 static const mozilla::Module::CategoryEntry kPaymentRequestCategories[] = {
   { "payment-request", "GeneralResponseData", NS_GENERAL_RESPONSE_DATA_CONTRACT_ID },
   { "payment-request", "BasicCardResponseData", NS_BASICCARD_RESPONSE_DATA_CONTRACT_ID },
-  { "payment-request", "PaymentActionRequest", NS_PAYMENT_ACTION_REQUEST_CONTRACT_ID },
-  { "payment-request", "PaymentCreateActionRequest", NS_PAYMENT_CREATE_ACTION_REQUEST_CONTRACT_ID },
-  { "payment-request", "PaymentCompleteActionRequest", NS_PAYMENT_COMPLETE_ACTION_REQUEST_CONTRACT_ID },
-  { "payment-request", "PaymentUpdateActionRequest", NS_PAYMENT_UPDATE_ACTION_REQUEST_CONTRACT_ID },
   { "payment-request", "PaymentCanMakeActionResponse", NS_PAYMENT_CANMAKE_ACTION_RESPONSE_CONTRACT_ID },
   { "payment-request", "PaymentAbortActionResponse", NS_PAYMENT_ABORT_ACTION_RESPONSE_CONTRACT_ID },
   { "payment-request", "PaymentShowActionResponse", NS_PAYMENT_SHOW_ACTION_RESPONSE_CONTRACT_ID },
   { "payment-request", "PaymentCompleteActionResponse", NS_PAYMENT_COMPLETE_ACTION_RESPONSE_CONTRACT_ID },
   { "payment-request", "PaymentAddress", NS_PAYMENT_ADDRESS_CONTRACT_ID },
   { "payment-request", "PaymentRequestService", NS_PAYMENT_REQUEST_SERVICE_CONTRACT_ID },
   { nullptr }
 };
--- a/dom/payments/PaymentRequestService.cpp
+++ b/dom/payments/PaymentRequestService.cpp
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "mozilla/ClearOnShutdown.h"
+#include "mozilla/dom/PaymentRequestParent.h"
 #include "PaymentRequestData.h"
 #include "PaymentRequestService.h"
 #include "BasicCardPayment.h"
 #include "nsSimpleEnumerator.h"
 
 namespace mozilla {
 namespace dom {
 
@@ -156,248 +157,223 @@ PaymentRequestService::LaunchUIAction(co
     uiService = mTestingUIService;
   } else {
     uiService = do_GetService(NS_PAYMENT_UI_SERVICE_CONTRACT_ID, &rv);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
   }
   switch (aActionType) {
-    case nsIPaymentActionRequest::SHOW_ACTION: {
+    case IPCPaymentActionRequest::TIPCPaymentShowActionRequest:{
       rv = uiService->ShowPayment(aRequestId);
       break;
     }
-    case nsIPaymentActionRequest::ABORT_ACTION: {
+    case IPCPaymentActionRequest::TIPCPaymentAbortActionRequest: {
       rv = uiService->AbortPayment(aRequestId);
       break;
     }
-    case nsIPaymentActionRequest::COMPLETE_ACTION: {
+    case IPCPaymentActionRequest::TIPCPaymentCompleteActionRequest: {
       rv = uiService->CompletePayment(aRequestId);
       break;
     }
-    case nsIPaymentActionRequest::UPDATE_ACTION: {
+    case IPCPaymentActionRequest::TIPCPaymentUpdateActionRequest: {
       rv = uiService->UpdatePayment(aRequestId);
       break;
     }
-    case nsIPaymentActionRequest::CLOSE_ACTION: {
+    case IPCPaymentActionRequest::TIPCPaymentCloseActionRequest: {
       rv = uiService->ClosePayment(aRequestId);
       break;
     }
     default : {
       return NS_ERROR_FAILURE;
     }
   }
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP
-PaymentRequestService::RemoveActionCallback(nsIPaymentActionCallback* aCallback)
+nsresult
+PaymentRequestService::RequestPayment(const nsAString& aRequestId,
+                                      const IPCPaymentActionRequest& aAction,
+                                      PaymentRequestParent* aIPC)
 {
-  NS_ENSURE_ARG_POINTER(aCallback);
-  for (auto iter = mCallbackHashtable.Iter(); !iter.Done(); iter.Next()) {
-    nsCOMPtr<nsIPaymentActionCallback> callback = iter.Data();
-    MOZ_ASSERT(callback);
-    if (callback == aCallback) {
-      iter.Remove();
-      return NS_OK;
-    }
-  }
-  return NS_OK;
-}
+  NS_ENSURE_ARG_POINTER(aIPC);
 
-NS_IMETHODIMP
-PaymentRequestService::RequestPayment(nsIPaymentActionRequest* aRequest)
-{
-  NS_ENSURE_ARG_POINTER(aRequest);
+  nsresult rv = NS_OK;
+  uint32_t type = aAction.type();
 
-  nsAutoString requestId;
-  nsresult rv = aRequest->GetRequestId(requestId);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-  nsCOMPtr<nsIPaymentActionCallback> callback;
-  rv = aRequest->GetCallback(getter_AddRefs(callback));
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-  rv = SetActionCallback(requestId, callback);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-
-  uint32_t type;
-  rv = aRequest->GetType(&type);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
+  if (type != IPCPaymentActionRequest::TIPCPaymentCreateActionRequest) {
+    nsCOMPtr<nsIPaymentRequest> request;
+    rv = GetPaymentRequestById(aRequestId, getter_AddRefs(request));
+    if (NS_WARN_IF(NS_FAILED(rv))) {
+      return rv;
+    }
+    if (!request && type != IPCPaymentActionRequest::TIPCPaymentCloseActionRequest) {
+      return NS_ERROR_FAILURE;
+    }
+    if (request) {
+      payments::PaymentRequest* rowRequest =
+        static_cast<payments::PaymentRequest*>(request.get());
+      if (!rowRequest) {
+        return NS_ERROR_FAILURE;
+      }
+      rowRequest->SetIPC(aIPC);
+    }
   }
 
   switch (type) {
-    case nsIPaymentActionRequest::CREATE_ACTION: {
-      nsCOMPtr<nsIPaymentCreateActionRequest> request =
-        do_QueryInterface(aRequest);
-      MOZ_ASSERT(request);
-      uint64_t tabId;
-      rv = request->GetTabId(&tabId);
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      nsCOMPtr<nsIPrincipal> topLevelPrincipal;
-      rv = request->GetTopLevelPrincipal(getter_AddRefs(topLevelPrincipal));
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      nsCOMPtr<nsIArray> methodData;
-      rv = request->GetMethodData(getter_AddRefs(methodData));
+    case IPCPaymentActionRequest::TIPCPaymentCreateActionRequest: {
+      const IPCPaymentCreateActionRequest& action = aAction;
+      uint64_t tabId = aIPC->GetTabId();
+      nsCOMPtr<nsIMutableArray> methodData = do_CreateInstance(NS_ARRAY_CONTRACTID);
+      MOZ_ASSERT(methodData);
+      for (IPCPaymentMethodData data : action.methodData()) {
+        nsCOMPtr<nsIPaymentMethodData> method;
+        rv = payments::PaymentMethodData::Create(data, getter_AddRefs(method));
+        NS_ENSURE_SUCCESS(rv, rv);
+        rv = methodData->AppendElement(method);
+        NS_ENSURE_SUCCESS(rv, rv);
+      }
+      nsCOMPtr<nsIPaymentDetails> details;
+      rv = payments::PaymentDetails::Create(action.details(), getter_AddRefs(details));
       NS_ENSURE_SUCCESS(rv, rv);
-
-      nsCOMPtr<nsIPaymentDetails> details;
-      rv = request->GetDetails(getter_AddRefs(details));
-      NS_ENSURE_SUCCESS(rv, rv);
-
       nsCOMPtr<nsIPaymentOptions> options;
-      rv = request->GetOptions(getter_AddRefs(options));
+      rv = payments::PaymentOptions::Create(action.options(), getter_AddRefs(options));
       NS_ENSURE_SUCCESS(rv, rv);
-
-      nsAutoString shippingOption;
-      rv = request->GetShippingOption(shippingOption);
-      NS_ENSURE_SUCCESS(rv, rv);
-
       nsCOMPtr<nsIPaymentRequest> payment =
-        new payments::PaymentRequest(tabId, requestId, topLevelPrincipal,
-                                     methodData, details, options, shippingOption);
+        new payments::PaymentRequest(tabId,
+                                     aRequestId,
+                                     action.topLevelPrincipal(),
+                                     methodData,
+                                     details,
+                                     options,
+                                     action.shippingOption());
 
       if (!mRequestQueue.AppendElement(payment, mozilla::fallible)) {
         return NS_ERROR_OUT_OF_MEMORY;
       }
       break;
     }
-    case nsIPaymentActionRequest::CANMAKE_ACTION: {
+    case IPCPaymentActionRequest::TIPCPaymentCanMakeActionRequest: {
       nsCOMPtr<nsIPaymentCanMakeActionResponse> canMakeResponse =
         do_CreateInstance(NS_PAYMENT_CANMAKE_ACTION_RESPONSE_CONTRACT_ID);
       MOZ_ASSERT(canMakeResponse);
-
-      rv = canMakeResponse->Init(requestId, CanMakePayment(requestId));
+      rv = canMakeResponse->Init(aRequestId,
+                                 CanMakePayment(aRequestId));
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
-
       rv = RespondPayment(canMakeResponse.get());
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
       break;
     }
-    case nsIPaymentActionRequest::SHOW_ACTION: {
-      if (mShowingRequest || !CanMakePayment(requestId)) {
+    case IPCPaymentActionRequest::TIPCPaymentShowActionRequest: {
+      if (mShowingRequest || !CanMakePayment(aRequestId)) {
         uint32_t responseStatus;
         if (mShowingRequest) {
           responseStatus = nsIPaymentActionResponse::PAYMENT_REJECTED;
         } else {
           responseStatus = nsIPaymentActionResponse::PAYMENT_NOTSUPPORTED;
         }
         nsCOMPtr<nsIPaymentShowActionResponse> showResponse =
           do_CreateInstance(NS_PAYMENT_SHOW_ACTION_RESPONSE_CONTRACT_ID);
         MOZ_ASSERT(showResponse);
-        rv = showResponse->Init(requestId,
+        rv = showResponse->Init(aRequestId,
                                 responseStatus,
                                 EmptyString(),
                                 nullptr,
                                 EmptyString(),
                                 EmptyString(),
                                 EmptyString());
         rv = RespondPayment(showResponse.get());
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return rv;
         }
       } else {
-        rv = GetPaymentRequestById(requestId, getter_AddRefs(mShowingRequest));
+        rv = GetPaymentRequestById(aRequestId,
+                                   getter_AddRefs(mShowingRequest));
         if (NS_WARN_IF(NS_FAILED(rv))) {
-          return NS_ERROR_FAILURE;
+          return rv;
         }
-        rv = LaunchUIAction(requestId, type);
+        rv = LaunchUIAction(aRequestId, type);
         if (NS_WARN_IF(NS_FAILED(rv))) {
-          return NS_ERROR_FAILURE;
+          return rv;
         }
       }
       break;
     }
-    case nsIPaymentActionRequest::ABORT_ACTION: {
-      rv = LaunchUIAction(requestId, type);
+    case IPCPaymentActionRequest::TIPCPaymentAbortActionRequest: {
+      rv = LaunchUIAction(aRequestId, type);
       if (NS_WARN_IF(NS_FAILED(rv))) {
-        return NS_ERROR_FAILURE;
+        return rv;
       }
       break;
     }
-    case nsIPaymentActionRequest::COMPLETE_ACTION: {
-      nsCOMPtr<nsIPaymentCompleteActionRequest> request =
-        do_QueryInterface(aRequest);
-      MOZ_ASSERT(request);
-      nsAutoString completeStatus;
-      rv = request->GetCompleteStatus(completeStatus);
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return NS_ERROR_FAILURE;
-      }
+    case IPCPaymentActionRequest::TIPCPaymentCompleteActionRequest: {
+      const IPCPaymentCompleteActionRequest& action = aAction;
       nsCOMPtr<nsIPaymentRequest> payment;
-      rv = GetPaymentRequestById(requestId, getter_AddRefs(payment));
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return NS_ERROR_FAILURE;
-      }
-      rv = payment->SetCompleteStatus(completeStatus);
+      rv = GetPaymentRequestById(aRequestId, getter_AddRefs(payment));
       if (NS_WARN_IF(NS_FAILED(rv))) {
-        return NS_ERROR_FAILURE;
+        return rv;
       }
-      rv = LaunchUIAction(requestId, type);
+      MOZ_ASSERT(payment);
+      payments::PaymentRequest* rowPayment =
+        static_cast<payments::PaymentRequest*>(payment.get());
+      MOZ_ASSERT(rowPayment);
+      rowPayment->SetCompleteStatus(action.completeStatus());
+      rv = LaunchUIAction(aRequestId, type);
       if (NS_WARN_IF(NS_FAILED(rv))) {
-        return NS_ERROR_FAILURE;
+        return rv;
       }
       break;
     }
-    case nsIPaymentActionRequest::UPDATE_ACTION: {
-      nsCOMPtr<nsIPaymentUpdateActionRequest> request = do_QueryInterface(aRequest);
-      MOZ_ASSERT(request);
-
+    case IPCPaymentActionRequest::TIPCPaymentUpdateActionRequest: {
+      const IPCPaymentUpdateActionRequest& action = aAction;
       nsCOMPtr<nsIPaymentDetails> details;
-      rv = request->GetDetails(getter_AddRefs(details));
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      nsAutoString shippingOption;
-      rv = request->GetShippingOption(shippingOption);
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      rv = request->GetRequestId(requestId);
-      NS_ENSURE_SUCCESS(rv, rv);
-      nsCOMPtr<nsIPaymentRequest> payment;
-      rv = GetPaymentRequestById(requestId, getter_AddRefs(payment));
+      rv = payments::PaymentDetails::Create(action.details(), getter_AddRefs(details));
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
-      rv = payment->UpdatePaymentDetails(details, shippingOption);
+      nsCOMPtr<nsIPaymentRequest> payment;
+      rv = GetPaymentRequestById(aRequestId, getter_AddRefs(payment));
+      if (NS_WARN_IF(NS_FAILED(rv))) {
+        return rv;
+      }
+      MOZ_ASSERT(payment);
+      payments::PaymentRequest* rowPayment =
+        static_cast<payments::PaymentRequest*>(payment.get());
+      MOZ_ASSERT(rowPayment);
+      rv = rowPayment->UpdatePaymentDetails(details, action.shippingOption());
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
       if (mShowingRequest) {
         MOZ_ASSERT(mShowingRequest == payment);
-        rv = LaunchUIAction(requestId, type);
+        rv = LaunchUIAction(aRequestId, type);
       } else {
         mShowingRequest = payment;
-        rv = LaunchUIAction(requestId, nsIPaymentActionRequest::SHOW_ACTION);
+        rv = LaunchUIAction(aRequestId,
+                            IPCPaymentActionRequest::TIPCPaymentShowActionRequest);
       }
       if (NS_WARN_IF(NS_FAILED(rv))) {
-        return NS_ERROR_FAILURE;
+        return rv;
       }
       break;
     }
-    case nsIPaymentActionRequest::CLOSE_ACTION: {
+    case IPCPaymentActionRequest::TIPCPaymentCloseActionRequest: {
       nsCOMPtr<nsIPaymentRequest> payment;
-      rv = GetPaymentRequestById(requestId, getter_AddRefs(payment));
+      rv = GetPaymentRequestById(aRequestId, getter_AddRefs(payment));
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
-      rv = LaunchUIAction(requestId, type);
+      rv = LaunchUIAction(aRequestId, type);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
       if (mShowingRequest == payment) {
         mShowingRequest = nullptr;
       }
       mRequestQueue.RemoveElement(payment);
       break;
@@ -417,29 +393,28 @@ PaymentRequestService::RespondPayment(ns
   nsresult rv = aResponse->GetRequestId(requestId);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIPaymentRequest> request;
   rv = GetPaymentRequestById(requestId, getter_AddRefs(request));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
-
   if (!request) {
     return NS_ERROR_FAILURE;
   }
-
-  nsCOMPtr<nsIPaymentActionCallback> callback;
-  if (!mCallbackHashtable.Get(requestId, getter_AddRefs(callback))) {
+  payments::PaymentRequest* rowRequest =
+    static_cast<payments::PaymentRequest*>(request.get());
+  if (!rowRequest) {
     return NS_ERROR_FAILURE;
   }
-  if (NS_WARN_IF(!callback)) {
+  if (!rowRequest->GetIPC()) {
     return NS_ERROR_FAILURE;
   }
-  rv = callback->RespondPayment(aResponse);
+  rv = rowRequest->GetIPC()->RespondPayment(aResponse);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // Remove nsIPaymentRequest from mRequestQueue while receive succeeded abort
   // response or complete response
   uint32_t type;
   rv = aResponse->GetType(&type);
@@ -482,75 +457,67 @@ PaymentRequestService::RespondPayment(ns
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PaymentRequestService::ChangeShippingAddress(const nsAString& aRequestId,
                                              nsIPaymentAddress* aAddress)
 {
-  nsCOMPtr<nsIPaymentActionCallback> callback;
-  if (!mCallbackHashtable.Get(aRequestId, getter_AddRefs(callback))) {
+  nsCOMPtr<nsIPaymentRequest> request;
+  nsresult rv = GetPaymentRequestById(aRequestId, getter_AddRefs(request));
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
+  }
+  if (!request) {
     return NS_ERROR_FAILURE;
   }
-  if (NS_WARN_IF(!callback)) {
+  payments::PaymentRequest* rowRequest =
+    static_cast<payments::PaymentRequest*>(request.get());
+  if (!rowRequest) {
     return NS_ERROR_FAILURE;
   }
-
-  nsresult rv = callback->ChangeShippingAddress(aRequestId, aAddress);
+  if (!rowRequest->GetIPC()) {
+    return NS_ERROR_FAILURE;
+  }
+  rv = rowRequest->GetIPC()->ChangeShippingAddress(aRequestId, aAddress);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PaymentRequestService::ChangeShippingOption(const nsAString& aRequestId,
                                             const nsAString& aOption)
 {
-  nsCOMPtr<nsIPaymentActionCallback> callback;
-  if (!mCallbackHashtable.Get(aRequestId, getter_AddRefs(callback))) {
+  nsCOMPtr<nsIPaymentRequest> request;
+  nsresult rv = GetPaymentRequestById(aRequestId, getter_AddRefs(request));
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
+  }
+  if (!request) {
     return NS_ERROR_FAILURE;
   }
-  if (NS_WARN_IF(!callback)) {
+  payments::PaymentRequest* rowRequest =
+    static_cast<payments::PaymentRequest*>(request.get());
+  if (!rowRequest) {
     return NS_ERROR_FAILURE;
   }
-
-  nsresult rv = callback->ChangeShippingOption(aRequestId, aOption);
+  if (!rowRequest->GetIPC()) {
+    return NS_ERROR_FAILURE;
+  }
+  rv = rowRequest->GetIPC()->ChangeShippingOption(aRequestId, aOption);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return NS_OK;
 }
 
-nsresult
-PaymentRequestService::SetActionCallback(const nsAString& aRequestId,
-                                         nsIPaymentActionCallback* aCallback)
-{
-  NS_ENSURE_ARG_POINTER(aCallback);
-  nsCOMPtr<nsIPaymentActionCallback> callback;
-  if (mCallbackHashtable.Get(aRequestId, getter_AddRefs(callback))) {
-    mCallbackHashtable.Remove(aRequestId);
-  }
-  mCallbackHashtable.Put(aRequestId, aCallback);
-  return NS_OK;
-}
-
-nsresult
-PaymentRequestService::RemoveActionCallback(const nsAString& aRequestId)
-{
-  nsCOMPtr<nsIPaymentActionCallback> callback;
-  if (!mCallbackHashtable.Get(aRequestId, getter_AddRefs(callback))) {
-    return NS_ERROR_FAILURE;
-  }
-  mCallbackHashtable.Remove(aRequestId);
-  return NS_OK;
-}
-
 bool
 PaymentRequestService::CanMakePayment(const nsAString& aRequestId)
 {
   /*
    *  TODO: Check third party payment app support by traversing all
    *        registered third party payment apps.
    */
   return IsBasicCardPayment(aRequestId);
--- a/dom/payments/PaymentRequestService.h
+++ b/dom/payments/PaymentRequestService.h
@@ -29,39 +29,33 @@ public:
 
   static already_AddRefed<PaymentRequestService> GetSingleton();
 
   already_AddRefed<nsIPaymentRequest>
   GetPaymentRequestByIndex(const uint32_t index);
 
   uint32_t NumPayments() const;
 
+  nsresult RequestPayment(const nsAString& aRequestId,
+                          const IPCPaymentActionRequest& aAction,
+                          PaymentRequestParent* aCallback);
 private:
   ~PaymentRequestService() = default;
 
   nsresult
-  SetActionCallback(const nsAString& aRequestId,
-                    nsIPaymentActionCallback* aCallback);
-  nsresult
-  RemoveActionCallback(const nsAString& aRequestId);
-
-  // this method is only used for testing
-  nsresult
   LaunchUIAction(const nsAString& aRequestId, uint32_t aActionType);
 
   bool
   CanMakePayment(const nsAString& aRequestId);
 
   bool
   IsBasicCardPayment(const nsAString& aRequestId);
 
   FallibleTArray<nsCOMPtr<nsIPaymentRequest>> mRequestQueue;
 
-  nsInterfaceHashtable<nsStringHashKey, nsIPaymentActionCallback> mCallbackHashtable;
-
   nsCOMPtr<nsIPaymentUIService> mTestingUIService;
 
   nsCOMPtr<nsIPaymentRequest> mShowingRequest;
 };
 
 } // end of namespace dom
 } // end of namespace mozilla
 
--- a/dom/payments/ipc/PaymentRequestParent.cpp
+++ b/dom/payments/ipc/PaymentRequestParent.cpp
@@ -2,185 +2,103 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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 "mozilla/ipc/InputStreamUtils.h"
 #include "nsArrayUtils.h"
 #include "nsCOMPtr.h"
-#include "nsIMutableArray.h"
 #include "nsIPaymentRequestService.h"
 #include "nsISupportsPrimitives.h"
 #include "nsServiceManagerUtils.h"
 #include "PaymentRequestData.h"
 #include "PaymentRequestParent.h"
+#include "PaymentRequestService.h"
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_ISUPPORTS(PaymentRequestParent, nsIPaymentActionCallback)
-
 PaymentRequestParent::PaymentRequestParent(uint64_t aTabId)
   : mActorAlive(true)
   , mTabId(aTabId)
+  , mRequestId(EmptyString())
 {
 }
 
 mozilla::ipc::IPCResult
 PaymentRequestParent::RecvRequestPayment(const IPCPaymentActionRequest& aRequest)
 {
   if (!mActorAlive) {
     return IPC_FAIL_NO_REASON(this);
   }
-  nsCOMPtr<nsIPaymentActionRequest> action;
-  nsresult rv;
   switch (aRequest.type()) {
-    case IPCPaymentActionRequest::TIPCPaymentCreateActionRequest: {
+    case IPCPaymentActionRequest::TIPCPaymentCreateActionRequest:{
       const IPCPaymentCreateActionRequest& request = aRequest;
-
-      nsCOMPtr<nsIMutableArray> methodData = do_CreateInstance(NS_ARRAY_CONTRACTID);
-      MOZ_ASSERT(methodData);
-      for (IPCPaymentMethodData data : request.methodData()) {
-        nsCOMPtr<nsIPaymentMethodData> method;
-        rv = payments::PaymentMethodData::Create(data, getter_AddRefs(method));
-        if (NS_WARN_IF(NS_FAILED(rv))) {
-          return IPC_FAIL_NO_REASON(this);
-        }
-        rv = methodData->AppendElement(method);
-        if (NS_WARN_IF(NS_FAILED(rv))) {
-          return IPC_FAIL_NO_REASON(this);
-        }
-      }
-
-      nsCOMPtr<nsIPaymentDetails> details;
-      rv = payments::PaymentDetails::Create(request.details(), getter_AddRefs(details));
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return IPC_FAIL_NO_REASON(this);
-      }
-
-      nsCOMPtr<nsIPaymentOptions> options;
-      rv = payments::PaymentOptions::Create(request.options(), getter_AddRefs(options));
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return IPC_FAIL_NO_REASON(this);
-      }
-
-      nsCOMPtr<nsIPaymentCreateActionRequest> createAction =
-        do_CreateInstance(NS_PAYMENT_CREATE_ACTION_REQUEST_CONTRACT_ID);
-      if (NS_WARN_IF(!createAction)) {
-        return IPC_FAIL_NO_REASON(this);
-      }
-      rv = createAction->InitRequest(request.requestId(),
-                                     this,
-                                     mTabId,
-                                     request.topLevelPrincipal(),
-                                     methodData,
-                                     details,
-                                     options,
-                                     request.shippingOption());
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return IPC_FAIL_NO_REASON(this);
-      }
-
-      action = do_QueryInterface(createAction);
-      MOZ_ASSERT(action);
+      mRequestId = request.requestId();
       break;
     }
-    case IPCPaymentActionRequest::TIPCPaymentCanMakeActionRequest: {
+    case IPCPaymentActionRequest::TIPCPaymentCanMakeActionRequest:{
       const IPCPaymentCanMakeActionRequest& request = aRequest;
-      rv = CreateActionRequest(request.requestId(),
-                               nsIPaymentActionRequest::CANMAKE_ACTION,
-                               getter_AddRefs(action));
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return IPC_FAIL_NO_REASON(this);
-      }
+      mRequestId = request.requestId();
       break;
     }
-    case IPCPaymentActionRequest::TIPCPaymentShowActionRequest: {
+    case IPCPaymentActionRequest::TIPCPaymentShowActionRequest:{
       const IPCPaymentShowActionRequest& request = aRequest;
-      rv = CreateActionRequest(request.requestId(),
-                               nsIPaymentActionRequest::SHOW_ACTION,
-                               getter_AddRefs(action));
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return IPC_FAIL_NO_REASON(this);
-      }
+      mRequestId = request.requestId();
       break;
     }
     case IPCPaymentActionRequest::TIPCPaymentAbortActionRequest: {
       const IPCPaymentAbortActionRequest& request = aRequest;
-      rv = CreateActionRequest(request.requestId(),
-                               nsIPaymentActionRequest::ABORT_ACTION,
-                               getter_AddRefs(action));
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return IPC_FAIL_NO_REASON(this);
-      }
+      mRequestId = request.requestId();
       break;
     }
     case IPCPaymentActionRequest::TIPCPaymentCompleteActionRequest: {
       const IPCPaymentCompleteActionRequest& request = aRequest;
-      nsCOMPtr<nsIPaymentCompleteActionRequest> completeAction =
-        do_CreateInstance(NS_PAYMENT_COMPLETE_ACTION_REQUEST_CONTRACT_ID);
-      rv = completeAction->InitRequest(request.requestId(),
-                                       this,
-                                       request.completeStatus());
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return IPC_FAIL_NO_REASON(this);
-      }
-      action = do_QueryInterface(completeAction);
-      MOZ_ASSERT(action);
+      mRequestId = request.requestId();
       break;
     }
     case IPCPaymentActionRequest::TIPCPaymentUpdateActionRequest: {
       const IPCPaymentUpdateActionRequest& request = aRequest;
-
-      nsCOMPtr<nsIPaymentDetails> details;
-      rv = payments::PaymentDetails::Create(request.details(), getter_AddRefs(details));
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return IPC_FAIL_NO_REASON(this);
-      }
-
-      nsCOMPtr<nsIPaymentUpdateActionRequest> updateAction =
-        do_CreateInstance(NS_PAYMENT_UPDATE_ACTION_REQUEST_CONTRACT_ID);
-      rv = updateAction->InitRequest(request.requestId(),
-                                     this,
-                                     details,
-                                     request.shippingOption());
-      action = do_QueryInterface(updateAction);
-      MOZ_ASSERT(action);
+      mRequestId = request.requestId();
       break;
     }
     case IPCPaymentActionRequest::TIPCPaymentCloseActionRequest: {
       const IPCPaymentCloseActionRequest& request = aRequest;
-      rv = CreateActionRequest(request.requestId(),
-                               nsIPaymentActionRequest::CLOSE_ACTION,
-                               getter_AddRefs(action));
-      if (NS_WARN_IF(NS_FAILED(rv))) {
-        return IPC_FAIL_NO_REASON(this);
-      }
+      mRequestId = request.requestId();
       break;
     }
-    default: {
-      return IPC_FAIL(this, "Unexpected request type");
+    default : {
+      return IPC_FAIL(this, "Unknown PaymentRequest action type");
     }
   }
   nsCOMPtr<nsIPaymentRequestService> service =
     do_GetService(NS_PAYMENT_REQUEST_SERVICE_CONTRACT_ID);
   MOZ_ASSERT(service);
-  rv = service->RequestPayment(action);
+  PaymentRequestService* rowService =
+    static_cast<PaymentRequestService*>(service.get());
+  MOZ_ASSERT(rowService);
+  nsresult rv = rowService->RequestPayment(mRequestId, aRequest, this);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return IPC_FAIL(this, "nsIPaymentRequestService::RequestPayment failed");
   }
   return IPC_OK();
 }
 
-NS_IMETHODIMP
+uint64_t
+PaymentRequestParent::GetTabId()
+{
+  return mTabId;
+}
+
+nsresult
 PaymentRequestParent::RespondPayment(nsIPaymentActionResponse* aResponse)
 {
   if (!NS_IsMainThread()) {
-    nsCOMPtr<nsIPaymentActionCallback> self = this;
+    RefPtr<PaymentRequestParent> self = this;
     nsCOMPtr<nsIPaymentActionResponse> response = aResponse;
     nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction("PaymentRequestParent::RespondPayment",
                                                      [self, response] ()
     {
       self->RespondPayment(response);
     });
     return NS_DispatchToMainThread(r);
   }
@@ -263,22 +181,22 @@ PaymentRequestParent::RespondPayment(nsI
     }
     default: {
       return NS_ERROR_FAILURE;
     }
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP
+nsresult
 PaymentRequestParent::ChangeShippingAddress(const nsAString& aRequestId,
                                             nsIPaymentAddress* aAddress)
 {
   if (!NS_IsMainThread()) {
-    nsCOMPtr<nsIPaymentActionCallback> self = this;
+    RefPtr<PaymentRequestParent> self = this;
     nsCOMPtr<nsIPaymentAddress> address = aAddress;
     nsAutoString requestId(aRequestId);
     nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction("dom::PaymentRequestParent::ChangeShippingAddress",
                                                      [self, requestId, address] ()
     {
       self->ChangeShippingAddress(requestId, address);
     });
     return NS_DispatchToMainThread(r);
@@ -345,22 +263,22 @@ PaymentRequestParent::ChangeShippingAddr
 
   nsAutoString requestId(aRequestId);
   if (!SendChangeShippingAddress(requestId, ipcAddress)) {
     return NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP
+nsresult
 PaymentRequestParent::ChangeShippingOption(const nsAString& aRequestId,
                                            const nsAString& aOption)
 {
   if (!NS_IsMainThread()) {
-    nsCOMPtr<nsIPaymentActionCallback> self = this;
+    RefPtr<PaymentRequestParent> self = this;
     nsAutoString requestId(aRequestId);
     nsAutoString option(aOption);
     nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction("dom::PaymentRequestParent::ChangeShippingOption",
                                                      [self, requestId, option] ()
     {
       self->ChangeShippingOption(requestId, option);
     });
     return NS_DispatchToMainThread(r);
@@ -385,33 +303,25 @@ PaymentRequestParent::Recv__delete__()
 
 void
 PaymentRequestParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   mActorAlive = false;
   nsCOMPtr<nsIPaymentRequestService> service =
     do_GetService(NS_PAYMENT_REQUEST_SERVICE_CONTRACT_ID);
   MOZ_ASSERT(service);
-  nsresult rv = service->RemoveActionCallback(this);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    MOZ_ASSERT(false);
+  if (!mRequestId.Equals(EmptyString())) {
+    nsCOMPtr<nsIPaymentRequest> request;
+    nsresult rv = service->GetPaymentRequestById(mRequestId, getter_AddRefs(request));
+    if (NS_WARN_IF(NS_FAILED(rv))) {
+      return;
+    }
+    if (!request) {
+      return;
+    }
+    payments::PaymentRequest* rowRequest =
+      static_cast<payments::PaymentRequest*>(request.get());
+    MOZ_ASSERT(rowRequest);
+    rowRequest->SetIPC(nullptr);
   }
 }
-
-nsresult
-PaymentRequestParent::CreateActionRequest(const nsAString& aRequestId,
-                                          uint32_t aActionType,
-                                          nsIPaymentActionRequest** aAction)
-{
-  NS_ENSURE_ARG_POINTER(aAction);
-  nsCOMPtr<nsIPaymentActionRequest> action =
-    do_CreateInstance(NS_PAYMENT_ACTION_REQUEST_CONTRACT_ID);
-  MOZ_ASSERT(action);
-  nsresult rv = action->Init(aRequestId, aActionType, this);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    return rv;
-  }
-  action.forget(aAction);
-  return NS_OK;
-}
-
 } // end of namespace dom
 } // end of namespace mozilla
--- a/dom/payments/ipc/PaymentRequestParent.h
+++ b/dom/payments/ipc/PaymentRequestParent.h
@@ -3,43 +3,46 @@
 /* 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/. */
 
 #ifndef mozilla_dom_PaymentRequestParent_h
 #define mozilla_dom_PaymentRequestParent_h
 
 #include "mozilla/dom/PPaymentRequestParent.h"
-#include "nsIPaymentActionRequest.h"
+#include "nsIPaymentAddress.h"
+#include "nsIPaymentActionResponse.h"
 
 namespace mozilla {
 namespace dom {
 
-class PaymentRequestParent final : public nsIPaymentActionCallback
-                                 , public PPaymentRequestParent
+class PaymentRequestParent final : public PPaymentRequestParent
 {
-  NS_DECL_THREADSAFE_ISUPPORTS
-  NS_DECL_NSIPAYMENTACTIONCALLBACK
+  NS_INLINE_DECL_REFCOUNTING(PaymentRequestParent)
+public:
+  explicit PaymentRequestParent(uint64_t aTabId);
 
-  explicit PaymentRequestParent(uint64_t aTabId);
+  uint64_t GetTabId();
+  nsresult RespondPayment(nsIPaymentActionResponse* aResponse);
+  nsresult ChangeShippingAddress(const nsAString& aRequestId,
+                                 nsIPaymentAddress* aAddress);
+  nsresult ChangeShippingOption(const nsAString& aRequestId,
+                                const nsAString& aOption);
 
 protected:
   mozilla::ipc::IPCResult
   RecvRequestPayment(const IPCPaymentActionRequest& aRequest) override;
 
   mozilla::ipc::IPCResult Recv__delete__() override;
 
   void ActorDestroy(ActorDestroyReason aWhy) override;
 private:
   ~PaymentRequestParent() = default;
 
-  nsresult CreateActionRequest(const nsAString& aRequestId,
-                               uint32_t aActionType,
-                               nsIPaymentActionRequest** aAction);
-
   bool mActorAlive;
   uint64_t mTabId;
+  nsString mRequestId;
 };
 
 } // end of namespace dom
 } // end of namespace mozilla
 
 #endif
--- a/dom/payments/moz.build
+++ b/dom/payments/moz.build
@@ -19,17 +19,16 @@ EXPORTS.mozilla.dom += [
     'PaymentRequest.h',
     'PaymentRequestManager.h',
     'PaymentRequestUpdateEvent.h',
     'PaymentResponse.h',
 ]
 
 UNIFIED_SOURCES += [
     'BasicCardPayment.cpp',
-    'PaymentActionRequest.cpp',
     'PaymentActionResponse.cpp',
     'PaymentAddress.cpp',
     'PaymentMethodChangeEvent.cpp',
     'PaymentRequest.cpp',
     'PaymentRequestData.cpp',
     'PaymentRequestManager.cpp',
     'PaymentRequestModule.cpp',
     'PaymentRequestService.cpp',