-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.html
1342 lines (1340 loc) · 52.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name="generator" content=
"HTML Tidy for HTML5 for Mac OS X version 5.4.0">
<title>
Tokenized Card Payment
</title>
<script src='https://www.w3.org/Tools/respec/respec-w3c-common' async
class='remove'></script>
<script src='utils.js' class='remove'></script>
<script class='remove'>
var respecConfig = {
github: "https://github.com/w3c/webpayments-methods-tokenization/",
shortName: "tokenized-card",
edDraftURI: "https://w3c.github.io/webpayments-methods-tokenization/",
specStatus: "unofficial",
testSuiteURI: "https://w3c-test.org/payment-method-tokenized-card/",
editors: [
{
name: "Keyur Patel",
company: "Mastercard"
},
{
name: "Ian Jacobs",
company: "W3C"
},
],
formerEditors: [
{ name: "Kevin Hurley",
company: "Facebook"
},
{
name: "Roy McElmurry",
company: "Facebook"
}
],
useExperimentalStyles: true,
license: "w3c-software-doc",
wg: "Web Payments Working Group",
wgURI: "https://www.w3.org/Payments/WG/",
wgPublicList: "public-payments-wg",
issueBase: "https://github.com/w3c/webpayments-methods-tokenization/issues/",
localBiblio: {
"card-network-ids": {
"href": "https://www.w3.org/Payments/card-network-ids",
"publisher": "W3C",
"title": "Card Network Identifiers Approved for use with Payment Request API"
},
"EMVCO-TOKENIZATION": {
"href": "https://www.emvco.com/emv-technologies/payment-tokenisation/",
"publisher": "EMVCo",
"title": "EMV® Payment Tokenisation Specification – Technical Framework"
},
"EMVCO-3DS": {
"href": "https://www.emvco.com/emv-technologies/3d-secure/",
"publisher": "EMVCo",
"title": "EMV® 3-D Secure"
},
"webpayments-crypto": {
"href": "https://w3c.github.io/webpayments-crypto/",
"publisher": "W3C",
"title": "Payment Method Encryption"
},
"3ds": {
"href": "https://w3c.github.io/3ds/index.html",
"publisher": "W3C",
"title": "3-D Secure 2 with Payment Request API"
}
},
};
</script>
<style>
dt { margin-top: 0.75em; }
table { margin-top: 0.75em; border-collapse:collapse; border-style:hidden hidden none hidden }
table thead { border-bottom:solid }
table tbody th:first-child { border-left:solid }
table td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
li { margin-top: 0.5em; margin-bottom: 0.5em;}
</style>
</head>
<body>
<section id="abstract">
<p>
This specification defines a Payment Method used by the PaymentRequest
API [[!payment-request]] to support tokenized card payments.
</p>
</section>
<section id='sotd'>
<p>
The working group maintains <a href=
"https://github.com/w3c/webpayments-methods-tokenization/issues">a list
of all bug reports that the group has not yet addressed</a>. Pull
requests with proposed specification text for outstanding issues are
strongly encouraged.
</p>
</section>
<section class="informative">
<h2>
Introduction
</h2>
<p>
This specification addresses data security in credit or debit card
payments on the Web.
</p>
<p>
When making a card payment, the cardholder shares data with a merchant.
The sahred data has traditionally included the number embossed on the
card (the primary account number or PAN), the card expiry date,
cardholder name, and billing address.
</p>
<p>
There are a variety of ways to share this data: imprinting the card
(physically making use of the embossed numbers on the card), swiping
the card through magnetic stripe reader, providing the data through a
chip or contactless connection, typing it into a Web form, or reading
it aloud over the phone. These approaches differ in their convenience
and security.
</p>
<p>
Most notably, if the PAN is intercepted by a malicious actor (in a
merchant store or through a compromised Web site, for example), this
can lead to fraudulent reuse. The card payment ecosystem has chosen to
combat this risk by reducing the circulation of PANs, and instead
reducing attack vectors through more opaque and controlled data. By
accepting (and possibly storing) tokens instead of the PAN, merchants
can reduce the risk of fraud due to data compromise. This can lower
their costs to receive card payments and their liability for some types
of fraud.
</p>
<p>
EMVCo has published [[!EMVCO-TOKENIZATION]] and related documents that
replace the traditional PAN with a "network token" (as well as
additional data to help limit misuse of each network token). These are
called "network" tokens because card payment networks (e.g., American
Express, China Union Pay, Discover, JCB, Mastercard, and Visa) and
issuing banks offer relevant services. The current document describes
how to connect these service providers to the Payment Request
[[payment-request]] ecosystem so that merchants can request network and
issuer tokens, and users can use payment handlers that request these
tokens from service providers.
</p>
<p>
The network tokenization approach has gained some traction in "card
present" transactions, that is through physical terminals. Indeed, in
regions where merchants have migrated to terminals that accept network
tokens, fraud has tended to move online. This trend is an important
reason why the Web Payments Working Group seeks to increase the
security of card payments on the Web.
</p>
<section class="informative">
<h2>
Security Benefits of Network Tokenization
</h2>
<p>
Network tokenization offers several security benefits:
</p>
<ul>
<li>The data can include "domain controls" that reduce opportunities
for misuse, for example by limiting use of a token to a given site,
transaction, or time period.
</li>
<li>Some transactions includes per-transaction (or, "dynamic")
elements such as a ‘cryptogram’, ‘authentication value’ or ‘card
verification value’ to enable validation of authorized use.
</li>
</ul>
<p>
In addition, the current specification includes mechanisms to further
enhance security through encryption of potentially sensitive data.
</p>
</section>
<section class="informative">
<h2>
The Network Tokenization Ecosystem
</h2>
<p>
In [[!EMVCO-TOKENIZATION]] EMVCo describes the different roles in the
tokenization ecosystem as well as the data requirements that are
related through the current specification. Please consult that
document for authoriative definitions. For the purposes of this
introduction, here are brief descriptions of key roles:
</p>
<dl>
<dt>
Card Issuer
</dt>
<dd>
The card issuer is typically a bank that makes available a credit
or debit card to a customer, the cardholder.
</dd>
<dt>
Token Service Provider (TSP)
</dt>
<dd>
Token Service Providers perform a variety of tasks, especially the
generation and storage of tokens, mapping between PANs and tokens
(and vice versa), and validating token usage.
</dd>
<dt>
Token Requestor
</dt>
<dd>
The Token Requestor is authorized to request tokens from the Token
Service Provider. Different parties may be Token Requestors,
including merchants, parties that have a relationship with a
merchant (e.g., payment gateways), and parties that have
relationships with the user (e.g., payment handlers).
</dd>
</dl>
</section>
<section class="informative">
<h2>
Additional Benefits of Network Tokenization
</h2>
<p>
Network tokens offer additional benefits as well beyond security:
</p>
<ul>
<li>If a user's card number is lost, stolen or replaced, a merchant
may still use a stored token associated with the card for future
transactions.
</li>
<li>A merchant can reduce compliance burden in partnership with a
payment service provider though the use of <a>Token Reference
ID</a>s: the payment service provider stores the token while the
merchant stores the <a>Token Reference ID</a>.
</li>
</ul>
</section>
</section>
<section id="exampleData">
<h2>
Examples
</h2>
<section>
<h3>
Tokenized-Card Request Example
</h3>
<pre class="example">
const methodData = [{
supportedMethods: ['tokenized-card'],
data: {
supportedNetworks: ['mastercard','visa', 'amex', 'discover', 'jcb','unionpay'],
supportedTypes: ['credit','debit'],
usageType: 'one-time',
payeeID: '234987',
keyProviderURL: 'https://pspKeyProvider.example/tokenizedCardPublicKey',
}
}];
const details = {
displayItems: [
{
label: "Sub-total",
amount: { currency: "USD", value: "55.00" },
},
{
label: "Sales Tax",
amount: { currency: "USD", value: "5.00" },
},
],
total: {
label: "Total due",
// The total is USD$65.00 here because we need to
// add shipping (below). The selected shipping
// costs USD$5.00.
amount: { currency: "USD", value: "65.00" },
},
};
new PaymentRequest(methodData, details);
</pre>
</section>
<section>
<h3>
Tokenized-Card Response Example
</h3>
<p>
This example shows some fictitious Mastercard-specific response data.
</p>
<div class="example">
<pre>
{
displayLast4: "***6789",
displayExpiryMonth: "02",
displayExpiryYear: "22",
displayNetwork: "mastercard",
encryptedDetails: "QWxobHZ4bU4yWkt1QUFFU05GWjRHb0FCRkE9PQ==",
}
</pre>
<p>
When decrypted, the <code>encryptedDetails</code> data would be:
</p>
<pre>
{
cardNumber: "5413339000001513",
expiryMonth: "12",
expiryYear: "20",
cryptogram: "AlhlvxmN2ZKuAAESNFZ4GoABFA==",
typeOfCryptogram: "UCAF", // "Universal Card Authentication Field"
trid: "59812345678",
eci: "242", // Authorization and final transaction request with UCAF data
}
</pre>
</div>
</section>
</section>
<section class="informative">
<h2 id="use-cases-and-flows">
Use Cases and Flows
</h2>
<p>
This specification is designed to address these primary use cases:
</p>
<ul>
<li>Single transaction
</li>
<li>Recurring payments (same token, all subsequent transactions
approved through an initial agreement with the payer)
</li>
<li>Card-on-file payments (same token, subsequent transactions approved
individually by the payer)
</li>
</ul>
<p>
See the <a>TokenUsageType</a> for more information.
</p>
<p>
For these use cases, the individual payment methods support different
flows:
</p>
<dl>
<dt>
tokenized-card
</dt>
<dd>
This payment method covers several flows:
<ul>
<li>One-time usage of a token
</li>
<li>Recurring payments with a token
</li>
<li>Card-on-file use cases with the following assumptions. The
payee seeks a token and does not yet have any card information from
the payer. The response data includes a token, cryptogram, and
other information sufficient for an authorization request.
</li>
</ul>
</dd>
<dt>
token-reference
</dt>
<dd>
This payment method covers the same flows as
<code>tokenized-card</code> but relies on the payee (or their payment
service provider) having a backend integration to reach a <a>Token
Service Provider</a>. The payee expects to retrieve token,
cryptogram, and other information through backend APIs and therefore
only needs a reference via Payment Request API. In other words, the
existence of the backend integration means the payee requires less
data than with <code>tokenized-card</code>.
</dd>
<dt>
token-cryptogram
</dt>
<dd>
This payment method is for card-on-file use cases when the payee (or
their payment service provider) already has a token. The payee only
requires a new cryptogram for a subsequent transaction with the same
token. For this payment method, we assume the payee (or their payment
service provider) does <code>not</code> have a backend integration
that enables them to reach a <a>Token Service Provider</a> for the
cryptogram. Through this payment method, the payee leverages Payment
Request API and the user's Payment Handler to reach the original
<a>Token Service Provider</a>.
</dd>
</dl>
</section>
<section id="assumptions">
<h2>
Assumptions
</h2>
<ul>
<li>A payment handler MUST be able to access the services of one or
more <a>Token Service Providers</a>.
</li>
<li>A payee that uses Payment Request API is registered with its
<a data-link-for="TokenizedCardRequest">supportedNetworks</a>. This
specification does not address that registration process.
</li>
<li>An assertion by the payee of acceptance of one of the
<a data-link-for="TokenizedCardRequest">supportedNetworks</a> implies
acceptance of the network-specific <a data-link-for=
"EncryptedTokenizedCard">cryptogram</a> types.
</li>
</ul>
</section>
<section id="tokenized-card">
<h2>
Tokenized-Card Payment Method
</h2>
<p>
The <a>payment method identifier</a> string for the Tokenized Card
Payment method is <dfn><code>tokenized-card</code></dfn>.
</p>
<section data-dfn-for="TokenizedCardRequest" data-link-for=
"TokenizedCardRequest">
<h2>
<dfn>TokenizedCardRequest</dfn> dictionary
</h2>
<p>
This section describes payment method specific data that is supplied
as part of the <code>data</code> argument to the PaymentRequest
constructor.
</p>
<pre class="idl">
dictionary TokenizedCardRequest{
sequence<DOMString> supportedNetworks;
sequence<BasicCardType> supportedTypes;
required DOMString keyProviderURL;
TokenUsageType usageType;
DOMString payeeID;
};
</pre>
<p>
The <code>TokenizedCardRequest</code> dictionary contains the
following members:
</p>
<dl>
<dt>
<dfn>supportedNetworks</dfn> member
</dt>
<dd>
A sequence of identifiers for card networks that the payee accepts.
W3C maintains a <a data-cite="card-network-ids">list of approved
card network identifiers</a>.
</dd>
<dt>
<dfn>supportedTypes</dfn> member
</dt>
<dd>
A card can be of type "credit", "debit", or "prepaid", as derived
from the issuer identification number (the first eight digits of
the <a>primary account number</a> (PAN). The different types are
represented as the <a>BasicCardType</a> enum.
</dd>
<dt>
<dfn>usageType</dfn> member
</dt>
<dd>
A payee may request a <a>TokenUsageType</a>. If not present, the
value of this member defaults to "one-time".
</dd>
<dt>
<dfn>payeeID</dfn> member
</dt>
<dd>
This Member is an optional <a>Payment Network</a>-specific string
that the <a>Token Service Provider</a> may use to constrain the
token for us by a single party. This is called a "merchant
identifier" in the EMVCO Tokenization Specification.
</dd>
<dt>
<dfn>keyProviderURL</dfn> member
</dt>
<dd>
This member designates, via a URL, a public key trusted by the
<a>Token Service Provider</a>. The source of the key, therefore,
becomes the effective requestor of the tokenized-card from a
<a>Token Service Provider</a>'s perspective.
<p class="issue" title=
"What public key formats are acceptable, and any constraints?">
See <a href=
"https://github.com/w3c/webpayments-crypto/issues/1">What public
key formats are acceptable, and any constraints? #1</a> .
</p>
</dd>
</dl>
<p>
For more information about handling of <a>supportedNetworks</a> and
<a>supportedTypes</a> see the <a>steps to check if an instrument is
supported</a>.
</p>
<p class="issue" data-number="45"></p>
</section>
<section data-dfn-for="TokenUsageType" data-link-for="TokenUsageType">
<h2>
<dfn>TokenUsageType</dfn> enum
</h2>
<pre class="idl">
enum TokenUsageType { "one-time", "card-on-file", "recurring" };
</pre>
<dl>
<dt>
"<dfn>one-time</dfn>"
</dt>
<dd>
The payee expects to use the token for a single authorization. How
exactly the payee can use the token (e.g., for a charge, an update
to the authorization, a partial refund, a second partial shipment,
or incremental charges) is outside the scope of this specification.
</dd>
<dt>
"<dfn>card-on-file</dfn>"
</dt>
<dd>
The payee expects to re-use the token for as yet uknown future
transactions, including payer-initiated transactions and
payee-initiated transactions (e.g., for partial shipment,
incremental charges, and resubmission use cases).
</dd>
<dt>
"<dfn>recurring</dfn>"
</dt>
<dd>
The payee expects to re-use the token exclusively for a recurring
payment according to an agreement with the payer.
</dd>
</dl>
</section>
<section data-dfn-for="TokenizedCardResponse" data-link-for=
"TokenizedCardResponse">
<h2>
<dfn>TokenizedCardResponse</dfn> dictionary
</h2>
<pre class="idl">
dictionary TokenizedCardResponse {
DOMString cardholderName;
DOMString displayMaskedCard;
DOMString displayLast4;
required DOMString displayExpiryMonth;
required DOMString displayExpiryYear;
required DOMString displayNetwork;
DOMString par;
DOMString tokenReferenceID;
DOMString eci;
PaymentAddress? billingAddress;
required DOMString encryptedDetails;
};
</pre>
<dl>
<dt>
<dfn>cardholderName</dfn> member
</dt>
<dd>
The <a>card holder's name</a> as it appears on the <a>card</a>.
</dd>
<dt>
<dfn>displayLast4</dfn> member
</dt>
<dd>
It is common for applications to want to display recognizable
information about the user's card, without revealing sensitive
credentials. This value may be used as a hint, for the common case
of displaying the last four digits of the original PAN.
</dd>
<dt>
<dfn>displayMaskedCard</dfn> member
</dt>
<dd>
In some cases, the card issuer may provide an alternative hint to
<a>displayLast4</a>. Applications MAY use either
<a>displayLast4</a> or <a>displayMaskedCard</a> as a hint, and
SHOULD use only one of them to avoid confusion or leaking
information.
</dd>
<dt>
<dfn>displayExpiryMonth</dfn> member
</dt>
<dd>
A two-digit string for the actual expiry month of the card in the
range "01" to "12".
</dd>
<dt>
<dfn>displayExpiryYear</dfn> member
</dt>
<dd>
A four-digit string for the expiry year of the actual card in the
range "0000" to "9999".
</dd>
<dt>
<dfn>displayNetwork</dfn> member
</dt>
<dd>
The name of the actual <a>Payment Network</a> of the card.
</dd>
<dt>
<dfn>billingAddress</dfn> member
</dt>
<dd>
A <a>PaymentAddress</a> that represents the <a>billing address</a>
associated with the <a>card</a>, or null.
</dd>
<dt>
<dfn>par</dfn> member
</dt>
<dd>
This optional member is a <a>Payment Account Reference</a> (or
<abbr>PAR</abbr>), which enables merchants, acquirers and payment
processors to link transactions initiated with affiliated Payment
Tokens to transactions based on the underlying <a>primary account
number</a>. The value is a composite field consisting of 29
uppercase alphanumeric roman characters. See [[EMVCO-TOKENIZATION]]
for more details.
</dd>
<dt>
<dfn>tokenReferenceID</dfn> member
</dt>
<dd>
This optional member is a <a>Token Reference ID</a>, a substitute
for the <a data-lt=
"EncryptedTokenizedCard.cardNumber">cardNumber</a> that does not
expose information about the <a data-lt=
"EncryptedTokenizedCard.cardNumber">cardNumber</a> or the
underlying <a>primary account number</a>. It is a <a>Payment
Network</a>-specific string.
</dd>
<dt>
<dfn>eci</dfn> member
</dt>
<dd>
This optional member is an <a>Electronic Commerce Indicator</a>, a
<a>Payment Network</a>-specific string to indicate the results of
user authentication. For related discussion about authentication,
see [[3ds]].
</dd>
<dt>
<dfn>encryptedDetails</dfn> member
</dt>
<dd>
This member is a string that represents
<a>EncryptedTokenizedCard</a> information, encrypted with the
<a data-lt="TokenizedCardRequest.keyProviderURL">keyProviderURL</a>
according to [[webpayments-crypto]].
</dd>
</dl>
<section data-dfn-for="EncryptedTokenizedCard" data-link-for=
"EncryptedTokenizedCard">
<h2>
<dfn>EncryptedTokenizedCard</dfn> dictionary
</h2>
<p>
This dictionary defines the sensitive data that is to be encrypted.
Note that the fields of this dictionary do not themselves influence
the encryption.
</p>
<p class="issue" title=
"Should encryption of tokenized card payment data be optional?"
data-number="39"></p>
<pre class="idl">
dictionary EncryptedTokenizedCard {
required DOMString cardNumber;
required DOMString expiryMonth;
required DOMString expiryYear;
required DOMString cryptogram;
required DOMString typeOfCryptogram;
required DOMString trid;
DOMString tokenRequestorKey;
};
</pre>
<dl>
<dt>
<dfn>cardNumber</dfn> member
</dt>
<dd>
This member is a <a>Payment Token</a>.
</dd>
<dt>
<dfn>expiryMonth</dfn> member
</dt>
<dd>
A two-digit string of dynamic data in the range "01" to "12";
this does not represent the actual expiry month of the card.
</dd>
<dt>
<dfn>expiryYear</dfn> member
</dt>
<dd>
A four-digit string of dynamic data in the range "0000" to
"9999"; this does not represent the actual expiry year of the
card.
</dd>
<dt>
<dfn>cryptogram</dfn> member
</dt>
<dd>
This member is a <a>Token Cryptogram</a>. It is <a>Payment
Network</a>-specific and used to ensure the authenticity of the
transaction.
</dd>
<dt>
<dfn>typeOfCryptogram</dfn> member
</dt>
<dd>
This member is a <a>Payment Network</a>-specific string that
describes the <a>Token Cryptogram</a> type.
</dd>
<dt>
<dfn>trid</dfn> member
</dt>
<dd>
This member is a <a>Token Requestor ID</a>, an 11-digit numeric
value that identifies the <a>Token Requestor</a> (e.g., the
<a>payment handler</a>) and is used as part of authorization
flows.
</dd>
<dt>
<dfn>tokenRequestorKey</dfn> member
</dt>
<dd>
This member is a public key that belongs to the <a>Token
Requestor</a>. It is intended to be used in the
<code>token-cryptogram</code> payment method for card-on-file use
cases.
</dd>
</dl>
</section>
</section>
</section>
<section id="token-reference">
<h2>
Token-Reference Payment Method
</h2>
<p>
The <a>payment method identifier</a> string for the Token Reference
Payment method is <dfn><code>token-reference</code></dfn>.
</p>
<p class="issue" data-number="46"></p>
<section data-dfn-for="TokenReferenceRequest" data-link-for=
"TokenReferenceRequest">
<h2>
<dfn>TokenReferenceRequest</dfn> dictionary
</h2>
<p>
This section describes payment method specific data that is supplied
as part of the <code>data</code> argument to the PaymentRequest
constructor.
</p>
<pre class="idl">
dictionary TokenReferenceRequest{
sequence<DOMString> supportedNetworks;
sequence<BasicCardType> supportedTypes;
TokenUsageType usageType;
DOMString payeeID;
};
</pre>
<dl>
<dt>
<dfn>supportedNetworks</dfn> member
</dt>
<dd>
A sequence of identifiers for card networks that the payee accepts.
W3C maintains a <a data-cite="card-network-ids">list of approved
card network identifiers</a>.
</dd>
<dt>
<dfn>supportedTypes</dfn> member
</dt>
<dd>
A card can be of type "credit", "debit", or "prepaid", as derived
from the issuer identification number (the first eight digits of
the <a>primary account number</a> (PAN). The different types are
represented as the <a>BasicCardType</a> enum.
</dd>
<dt>
<dfn>usageType</dfn> member
</dt>
<dd>
A payee may request a <a>TokenUsageType</a>. If not present, the
value of this member defaults to "one-time".
</dd>
<dt>
<dfn>payeeID</dfn> member
</dt>
<dd>
This Member is an optional <a>Payment Network</a>-specific string
that the <a>Token Service Provider</a> may use to constrain the
token for us by a single party. This is called a "merchant
identifier" in the EMVCO Tokenization Specification.
</dd>
</dl>
</section>
<section data-dfn-for="TokenReferenceResponse" data-link-for=
"TokenReferenceResponse">
<h2>
<dfn>TokenReferenceResponse</dfn> dictionary
</h2>
<pre class="idl">
dictionary TokenReferenceResponse {
required DOMString tokenReferenceID;
required DOMString trid;
};
</pre>
<dl>
<dt>
<dfn>tokenReferenceID</dfn> member
</dt>
<dd>
This member is a <a>Payment Network</a>-specific <a>Token Reference
ID</a> that the payee uses on the backend to retrieve additional
information about the card.
</dd>
<dt>
<dfn>trid</dfn> member
</dt>
<dd>
This member is a <a>Token Requestor ID</a>, an 11-digit numeric
value that identifies the token requestor (e.g., the <a>payment
handler</a>) and is used as part of authorization flows.
</dd>
</dl>
</section>
</section>
<section id="token-cryptogram">
<h2>
Token-Cryptogram Payment Method
</h2>
<p>
The <a>payment method identifier</a> string for the Token Cryptogram
Payment method is <dfn><code>token-cryptogram</code></dfn>.
</p>
<p class="issue" data-number="44"></p>
<section data-dfn-for="TokenCryptogramRequest" data-link-for=
"TokenCryptogramRequest">
<h2>
<dfn>TokenCryptogramRequest</dfn> dictionary
</h2>
<p>
This section describes payment method specific data that is supplied
as part of the <code>data</code> argument to the PaymentRequest
constructor.
</p>
<pre class="idl">
dictionary TokenCryptogramRequest{
required DOMString tokenRequestorID;
DOMString tokenReferenceID;
DOMString encryptedCardNumber;
};
</pre>
<p>
The <code>TokenCryptogramRequest</code> dictionary contains the
following members:
</p>
<dl>
<dt>
<dfn>tokenReferenceID</dfn> member
</dt>
<dd>
This member is a <a>Payment Network</a>-specific <a>Token Reference
ID</a> that represents the stored token for which the payee is
requesting a new cryptogram.
</dd>
<dt>
<dfn>encryptedCardNumber</dfn> member
</dt>
<dd>
This optional member is an encrypted <a>Payment Token</a>. Although
the <a>tokenReferenceID</a> is preferred it may not always be
available, in which case the payee may provide this <a>Payment
Token</a> instead, encrypted with the <a data-link-for=
"EncryptedTokenizedCard">tokenRequestorKey</a>, for example that
was returned through the <code>tokenized-card</code> payment
response.
<p class="note">
Need more details on encryption.
</p>
</dd>
<dt>
<dfn>tokenRequestorID</dfn> member
</dt>
<dd>
This member identifies the payment handler used to request the
original token. It is an 11-digit numeric value that is a <a>Token
Requestor ID</a>. The user agent uses this information to provide a
path to the <a>Token Service Provider</a> through the payment
handler that requested the original token. It is assumed that the
payment handler also has a means to validate that the payee
requesting the cryptogram is authorized to do so.
</dd>
</dl>
</section>
<section data-dfn-for="TokenCryptogramResponse" data-link-for=
"TokenCryptogramResponse">
<h2>
<dfn>TokenCryptogramResponse</dfn> dictionary
</h2>
<pre class="idl">
dictionary TokenCryptogramResponse{
required DOMString cryptogram;
required DOMString typeOfCryptogram;
DOMString eci;
};
</pre>
<dl>
<dt>
<dfn>cryptogram</dfn> member
</dt>
<dd>
This member is a <a>Token Cryptogram</a>.
</dd>
<dt>
<dfn>typeOfCryptogram</dfn> member
</dt>
<dd>
This member is a <a>Payment Network</a>-specific string that
describes the <a>Token Cryptogram</a> type.
</dd>
<dt>
<dfn>eci</dfn> member
</dt>
<dd>
This optional member is an <a>Electronic Commerce Indicator</a>, a
<a>Payment Network</a>-specific string to indicate the results of
user authentication. For related discussion about authentication,
see [[3ds]].
</dd>
</dl>
</section>
</section>
<section id="interfacing">
<h2>
Interfacing with a payment request for tokenized-card
</h2>
<p class="note">
Currently these sections are for the <code>tokenized-card</code>
payment method; we will need similar algorithms for other payment
methods.
</p>
<section>
<h3>
Steps to check if a payment can be made
</h3>
<p>
The <dfn>steps to check if a payment can be made</dfn> by a Payment
Handler that handles "tokenized-card" takes
<a>TokenizedCardRequest</a> <var>request</var> as input. It returns
either true or false:
</p>
<ol class="algorithm">
<li>Let <var>cards</var> be a <a data-cite="infra#list">list</a> of
<a>cards</a> associated with this payment handler.
</li>
<li>If <var>cards</var> <a data-cite="infra#list-is-empty">is
empty</a>, return false.
</li>
<li>Let <var>networks</var> be an empty <code><a data-cite=
"!WEBIDL#idl-DOMString">DOMString</a></code> sequence.
</li>
<li>Let <var>types</var> be an empty <a>BasicCardType</a> sequence.
</li>
<li>Let <var>cryptograms</var> be an empty <code><a data-cite=
"!WEBIDL#idl-DOMString">DOMString</a></code> sequence.
</li>
<li>Let <var>usage</var> be the value of
<var>request</var>["usageType"] if present, otherwise set it to
"one-time". If the value of <var>usage</var> is not a legal value of
<a>TokenUsageType</a>, set <var>usage</var> to "one-time".
</li>
<li>If <var>request</var>["supportedTypes"] is present, append each
item in <var>request</var>["supportedTypes"] to <var>types</var>.
</li>
<li>If <var>request</var>["supportedNetworks"] is present, append
each item in <var>request</var>["supportedNetworks"] to
<var>networks</var>.
</li>
<li>For each <var>card</var> in <var>cards</var>:
<ol>
<li>Let <var>isSupported</var> be the result of running the
<a>steps to check if an instrument is supported</a>, passing in
<var>card</var>, <var>networks</var>, <var>types</var>,
<var>cryptograms</var>, <var>usage</var>
</li>
<li>If <var>isSupported</var> is true, then return true.
</li>
</ol>
</li>
<li>Return false.
</li>
</ol>
</section>
<section>
<h3>
Steps to check if an instrument is supported
</h3>
<p>
The <dfn>steps to check if an instrument is supported</dfn> takes as
input a <a>card</a> <var>card</var>, a <a data-cite=
"infra#list">list</a> of <a>type</a> <var>types</var>, a
<a data-cite="infra#list">list</a> of <a>network</a>
<var>networks</var>, and a <a data-link-for=
"TokenizedCardRequest">usageType</a> <var>usage</var>. It returns
true if the <var>card</var> is supported, false otherwise.
</p>
<ol class="algorithm">
<li>If <var>types</var> <a data-cite="!infra#list-is-empty">is
empty</a> and <var>networks</var> <a data-cite=
"!infra#list-is-empty">is empty</a> and <var>cryptograms</var>
<a data-cite="!infra#list-is-empty">is empty</a>, return true.