Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1560)

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentResponse.cpp

Issue 2054823002: PaymentRequest: complete() method should take PaymentComplete enum value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/payments/PaymentResponse.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentResponse.cpp b/third_party/WebKit/Source/modules/payments/PaymentResponse.cpp
index 66362d69ad24ad5e43b0193dec218e96b7c1646d..4c7c6ac50ce66771845ebb3de60e014d5117960a 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentResponse.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentResponse.cpp
@@ -29,9 +29,14 @@ ScriptValue PaymentResponse::details(ScriptState* scriptState, ExceptionState& e
return ScriptValue(scriptState, fromJSONString(scriptState, m_stringifiedDetails, exceptionState));
}
-ScriptPromise PaymentResponse::complete(ScriptState* scriptState, bool success)
+ScriptPromise PaymentResponse::complete(ScriptState* scriptState, const String& result)
{
- return m_paymentCompleter->complete(scriptState, success);
+ PaymentComplete convertedResult = Unknown;
+ if (result == "success")
+ convertedResult = Success;
+ if (result == "fail")
+ convertedResult = Fail;
+ return m_paymentCompleter->complete(scriptState, convertedResult);
}
DEFINE_TRACE(PaymentResponse)

Powered by Google App Engine
This is Rietveld 408576698