Commit 9e5c20b7 authored by rouslan's avatar rouslan Committed by Commit bot

Warn web developers that card networks as method names are deprecated.

Web developers should use 'basic-card' instead. Deprecated:

  new PaymentRequest(
    [{
      supportedMethods: ['visa', 'amex'],
    }],
    cart);

Should be used:

  new PaymentRequest(
    [{
      supportedMethods: ['basic-card'],
      data: {supportedNetworks: ['visa', 'amex']},
    }],
    cart);

Console warning message:
  [Deprecation] Card issuer network ("amex", "diners", "discover",
  "jcb", "mastercard", "mir", "unionpay", "visa") as payment method is
  deprecated and will be removed in M64, around January 2018. Please use
  payment method name "basic-card" with issuer network in the
  "supportedNetworks" field instead. See
  https://www.chromestatus.com/features/5725727580225536 for more
  details.

Intent to deprecate thread:
https://groups.google.com/a/chromium.org/d/msg/blink-dev/1udpnrlQK4Q/ot_E-htQAQAJ

BUG=719526

Review-Url: https://codereview.chromium.org/2865023003
Cr-Commit-Position: refs/heads/master@{#473997}
parent 88460835
...@@ -19,6 +19,8 @@ enum Milestone { ...@@ -19,6 +19,8 @@ enum Milestone {
M60, M60,
M61, M61,
M62, M62,
M63,
M64,
}; };
const char* milestoneString(Milestone milestone) { const char* milestoneString(Milestone milestone) {
...@@ -34,6 +36,10 @@ const char* milestoneString(Milestone milestone) { ...@@ -34,6 +36,10 @@ const char* milestoneString(Milestone milestone) {
return "M61, around September 2017"; return "M61, around September 2017";
case M62: case M62:
return "M62, around October 2017"; return "M62, around October 2017";
case M63:
return "M63, around December 2017";
case M64:
return "M64, around January 2018";
} }
NOTREACHED(); NOTREACHED();
...@@ -425,6 +431,14 @@ String Deprecation::DeprecationMessage(UseCounter::Feature feature) { ...@@ -425,6 +431,14 @@ String Deprecation::DeprecationMessage(UseCounter::Feature feature) {
"recent-changes-credential-management-api for migration suggestions.", "recent-changes-credential-management-api for migration suggestions.",
milestoneString(M62)); milestoneString(M62));
case UseCounter::kPaymentRequestNetworkNameInSupportedMethods:
return replacedWillBeRemoved(
"Card issuer network (\"amex\", \"diners\", \"discover\", \"jcb\", "
"\"mastercard\", \"mir\", \"unionpay\", \"visa\") as payment method",
"payment method name \"basic-card\" with issuer network in the "
"\"supportedNetworks\" field",
M64, "5725727580225536");
// Features that aren't deprecated don't have a deprecation message. // Features that aren't deprecated don't have a deprecation message.
default: default:
return String(); return String();
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#include "core/dom/TaskRunnerHelper.h" #include "core/dom/TaskRunnerHelper.h"
#include "core/events/Event.h" #include "core/events/Event.h"
#include "core/events/EventQueue.h" #include "core/events/EventQueue.h"
#include "core/frame/Deprecation.h"
#include "core/frame/FrameOwner.h" #include "core/frame/FrameOwner.h"
#include "core/frame/UseCounter.h"
#include "core/html/HTMLIFrameElement.h" #include "core/html/HTMLIFrameElement.h"
#include "core/inspector/ConsoleMessage.h" #include "core/inspector/ConsoleMessage.h"
#include "core/inspector/ConsoleTypes.h" #include "core/inspector/ConsoleTypes.h"
...@@ -439,7 +439,7 @@ void StringifyAndParseMethodSpecificData( ...@@ -439,7 +439,7 @@ void StringifyAndParseMethodSpecificData(
for (size_t i = 0; i < arraysize(kBasicCardNetworks); ++i) { for (size_t i = 0; i < arraysize(kBasicCardNetworks); ++i) {
if (supported_methods.Contains(kBasicCardNetworks[i].name)) { if (supported_methods.Contains(kBasicCardNetworks[i].name)) {
UseCounter::Count( Deprecation::CountDeprecation(
&execution_context, &execution_context,
UseCounter::kPaymentRequestNetworkNameInSupportedMethods); UseCounter::kPaymentRequestNetworkNameInSupportedMethods);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment