OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PaymentResponse_h | 5 #ifndef PaymentResponse_h |
6 #define PaymentResponse_h | 6 #define PaymentResponse_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class ScriptState; | 23 class ScriptState; |
24 | 24 |
25 class MODULES_EXPORT PaymentResponse final | 25 class MODULES_EXPORT PaymentResponse final |
26 : public GarbageCollectedFinalized<PaymentResponse>, | 26 : public GarbageCollectedFinalized<PaymentResponse>, |
27 public ScriptWrappable { | 27 public ScriptWrappable { |
28 DEFINE_WRAPPERTYPEINFO(); | 28 DEFINE_WRAPPERTYPEINFO(); |
29 WTF_MAKE_NONCOPYABLE(PaymentResponse); | 29 WTF_MAKE_NONCOPYABLE(PaymentResponse); |
30 | 30 |
31 public: | 31 public: |
32 PaymentResponse(payments::mojom::blink::PaymentResponsePtr, | 32 PaymentResponse(payments::mojom::blink::PaymentResponsePtr, |
33 PaymentCompleter*); | 33 PaymentCompleter*, |
| 34 const String& requestId); |
34 virtual ~PaymentResponse(); | 35 virtual ~PaymentResponse(); |
35 | 36 |
36 ScriptValue toJSONForBinding(ScriptState*) const; | 37 ScriptValue toJSONForBinding(ScriptState*) const; |
37 | 38 |
| 39 const String& requestId() const { return requestId_; } |
38 const String& methodName() const { return method_name_; } | 40 const String& methodName() const { return method_name_; } |
39 ScriptValue details(ScriptState*, ExceptionState&) const; | 41 ScriptValue details(ScriptState*, ExceptionState&) const; |
40 PaymentAddress* shippingAddress() const { return shipping_address_.Get(); } | 42 PaymentAddress* shippingAddress() const { return shipping_address_.Get(); } |
41 const String& shippingOption() const { return shipping_option_; } | 43 const String& shippingOption() const { return shipping_option_; } |
42 const String& payerName() const { return payer_name_; } | 44 const String& payerName() const { return payer_name_; } |
43 const String& payerEmail() const { return payer_email_; } | 45 const String& payerEmail() const { return payer_email_; } |
44 const String& payerPhone() const { return payer_phone_; } | 46 const String& payerPhone() const { return payer_phone_; } |
45 | 47 |
46 ScriptPromise complete(ScriptState*, const String& result = ""); | 48 ScriptPromise complete(ScriptState*, const String& result = ""); |
47 | 49 |
48 DECLARE_TRACE(); | 50 DECLARE_TRACE(); |
49 | 51 |
50 private: | 52 private: |
| 53 String requestId_; |
51 String method_name_; | 54 String method_name_; |
52 String stringified_details_; | 55 String stringified_details_; |
53 Member<PaymentAddress> shipping_address_; | 56 Member<PaymentAddress> shipping_address_; |
54 String shipping_option_; | 57 String shipping_option_; |
55 String payer_name_; | 58 String payer_name_; |
56 String payer_email_; | 59 String payer_email_; |
57 String payer_phone_; | 60 String payer_phone_; |
58 Member<PaymentCompleter> payment_completer_; | 61 Member<PaymentCompleter> payment_completer_; |
59 }; | 62 }; |
60 | 63 |
61 } // namespace blink | 64 } // namespace blink |
62 | 65 |
63 #endif // PaymentResponse_h | 66 #endif // PaymentResponse_h |
OLD | NEW |