#include "third_party/blink/renderer/modules/payments/payment_request_event.h"
#include <utility>
#include "third_party/blink/public/mojom/payments/payment_request.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/to_v8_traits.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_address_errors.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_currency_amount.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_details_modifier.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_item.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_method_data.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_options.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_request_details_update.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_payment_shipping_option.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
#include "third_party/blink/renderer/core/workers/worker_location.h"
#include "third_party/blink/renderer/modules/payments/address_init_type_converter.h"
#include "third_party/blink/renderer/modules/payments/payments_validators.h"
#include "third_party/blink/renderer/modules/service_worker/respond_with_observer.h"
#include "third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h"
#include "third_party/blink/renderer/modules/service_worker/service_worker_window_client.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/wtf/text/atomic_string.h"
namespace blink {
PaymentRequestEvent* PaymentRequestEvent::Create(
const AtomicString& type,
const PaymentRequestEventInit* initializer,
mojo::PendingRemote<payments::mojom::blink::PaymentHandlerHost> host,
RespondWithObserver* respond_with_observer,
WaitUntilObserver* wait_until_observer,
ExecutionContext* execution_context) { … }
PaymentRequestEvent::PaymentRequestEvent(
const AtomicString& type,
const PaymentRequestEventInit* initializer,
mojo::PendingRemote<payments::mojom::blink::PaymentHandlerHost> host,
RespondWithObserver* respond_with_observer,
WaitUntilObserver* wait_until_observer,
ExecutionContext* execution_context)
: … { … }
PaymentRequestEvent::~PaymentRequestEvent() = default;
const AtomicString& PaymentRequestEvent::InterfaceName() const { … }
const String& PaymentRequestEvent::topOrigin() const { … }
const String& PaymentRequestEvent::paymentRequestOrigin() const { … }
const String& PaymentRequestEvent::paymentRequestId() const { … }
const HeapVector<Member<PaymentMethodData>>& PaymentRequestEvent::methodData()
const { … }
const ScriptValue PaymentRequestEvent::total(ScriptState* script_state) const { … }
const HeapVector<Member<PaymentDetailsModifier>>&
PaymentRequestEvent::modifiers() const { … }
const String& PaymentRequestEvent::instrumentKey() const { … }
const ScriptValue PaymentRequestEvent::paymentOptions(
ScriptState* script_state) const { … }
std::optional<HeapVector<Member<PaymentShippingOption>>>
PaymentRequestEvent::shippingOptions() const { … }
ScriptPromise<IDLNullable<ServiceWorkerWindowClient>>
PaymentRequestEvent::openWindow(ScriptState* script_state, const String& url) { … }
ScriptPromise<IDLNullable<PaymentRequestDetailsUpdate>>
PaymentRequestEvent::changePaymentMethod(ScriptState* script_state,
const String& method_name,
const ScriptValue& method_details,
ExceptionState& exception_state) { … }
ScriptPromise<IDLNullable<PaymentRequestDetailsUpdate>>
PaymentRequestEvent::changeShippingAddress(ScriptState* script_state,
AddressInit* shipping_address,
ExceptionState& exception_state) { … }
ScriptPromise<IDLNullable<PaymentRequestDetailsUpdate>>
PaymentRequestEvent::changeShippingOption(ScriptState* script_state,
const String& shipping_option_id,
ExceptionState& exception_state) { … }
void PaymentRequestEvent::respondWith(ScriptState* script_state,
ScriptPromiseUntyped script_promise,
ExceptionState& exception_state) { … }
void PaymentRequestEvent::Trace(Visitor* visitor) const { … }
void PaymentRequestEvent::OnChangePaymentRequestDetailsResponse(
payments::mojom::blink::PaymentRequestDetailsUpdatePtr response) { … }
void PaymentRequestEvent::OnHostConnectionError() { … }
}