Index: ios/web/public/payments/payment_request.h |
diff --git a/ios/web/public/payments/payment_request.h b/ios/web/public/payments/payment_request.h |
index 51eeefadaf8f6be9221fb587e8c303d926cbc83a..20b25df50b27d02eeeb64ed8858d8f1f86ba1a52 100644 |
--- a/ios/web/public/payments/payment_request.h |
+++ b/ios/web/public/payments/payment_request.h |
@@ -9,8 +9,9 @@ |
#include "base/strings/string16.h" |
-// C++ bindings for the PaymentRequest API. Conforms to the 18 July 2016 |
-// editor's draft at https://w3c.github.io/browser-payment-api/. |
+// C++ bindings for the PaymentRequest API. Conforms to the following specs: |
+// https://w3c.github.io/browser-payment-api/ (18 July 2016 editor's draft) |
+// https://w3c.github.io/webpayments-methods-card/ (31 May 2016 editor's draft) |
namespace base { |
class DictionaryValue; |
@@ -28,6 +29,9 @@ class PaymentAddress { |
bool operator==(const PaymentAddress& other) const; |
bool operator!=(const PaymentAddress& other) const; |
+ // Populates |value| with the properties of this PaymentAddress. |
+ void ToDictionaryValue(base::DictionaryValue* value) const; |
+ |
// The CLDR (Common Locale Data Repository) region code. For example, US, GB, |
// CN, or JP. |
base::string16 country; |
@@ -261,11 +265,47 @@ class PaymentRequest { |
PaymentOptions options; |
}; |
+// Contains the response from the PaymentRequest API when a user accepts |
+// payment with a Basic Payment Card payment method (which is currently the only |
+// method supported on iOS). |
+class BasicCardResponse { |
+ public: |
+ BasicCardResponse(); |
+ BasicCardResponse(const BasicCardResponse& other); |
+ ~BasicCardResponse(); |
+ |
+ bool operator==(const BasicCardResponse& other) const; |
+ bool operator!=(const BasicCardResponse& other) const; |
+ |
+ // Populates |value| with the properties of this BasicCardResponse. |
+ void ToDictionaryValue(base::DictionaryValue* value) const; |
+ |
+ // The cardholder's name as it appears on the card. |
+ base::string16 cardholder_name; |
+ |
+ // The primary account number (PAN) for the payment card. |
+ base::string16 card_number; |
+ |
+ // A two-digit string for the expiry month of the card in the range 01 to 12. |
+ base::string16 expiry_month; |
+ |
+ // A two-digit string for the expiry year of the card in the range 00 to 99. |
+ base::string16 expiry_year; |
+ |
+ // A three or four digit string for the security code of the card (sometimes |
+ // known as the CVV, CVC, CVN, CVE or CID). |
+ base::string16 card_security_code; |
+ |
+ // The billing address information associated with the payment card. |
+ PaymentAddress billing_address; |
+}; |
+ |
// Information provided in the Promise returned by a call to |
// PaymentRequest.show(). |
class PaymentResponse { |
public: |
PaymentResponse(); |
+ PaymentResponse(const PaymentResponse& other); |
~PaymentResponse(); |
bool operator==(const PaymentResponse& other) const; |
@@ -278,11 +318,9 @@ class PaymentResponse { |
// to fulfil the transaction. |
base::string16 method_name; |
- // A JSON-serialized object that provides a payment method specific message |
- // used by the merchant to process the transaction and determine successful |
- // fund transfer. This data is returned by the payment app that satisfies the |
- // payment request. |
- base::string16 details; |
+ // A credit card response object used by the merchant to process the |
+ // transaction and determine successful fund transfer. |
+ BasicCardResponse details; |
}; |
} // namespace web |