Index: third_party/WebKit/Source/modules/payments/PaymentAddress.cpp |
diff --git a/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp b/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp |
index fea61124fe053db5ece1068b381675bf26e49f04..ded6d4c01c834fd31e4527257997b09a8ea722c6 100644 |
--- a/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp |
+++ b/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp |
@@ -4,6 +4,7 @@ |
#include "modules/payments/PaymentAddress.h" |
+#include "bindings/core/v8/V8ObjectBuilder.h" |
#include "wtf/text/StringBuilder.h" |
namespace blink { |
@@ -33,4 +34,21 @@ PaymentAddress::PaymentAddress(mojom::blink::PaymentAddressPtr address) |
PaymentAddress::~PaymentAddress() {} |
+ScriptValue PaymentAddress::toJSONForBinding(ScriptState* scriptState) const |
+{ |
+ V8ObjectBuilder result(scriptState); |
+ result.addString("country", country()); |
+ result.add("addressLine", addressLine()); |
+ result.addString("region", region()); |
+ result.addString("city", city()); |
+ result.addString("dependentLocality", dependentLocality()); |
+ result.addString("postalCode", postalCode()); |
+ result.addString("sortingCode", sortingCode()); |
+ result.addString("languageCode", languageCode()); |
+ result.addString("organization", organization()); |
+ result.addString("recipient", recipient()); |
+ result.addString("phone", phone()); |
+ return result.scriptValue(); |
+} |
+ |
} // namespace blink |