I am intergrating google pay api to one of my angular project and trying to add the options into the code. but not be able to do that. error coming is error TS2554: Expected 2 arguments, but got 3.
. but in W3C it is code is new PaymentRequest(methodData, details, options);
. you can find the document here 2.4 Constructing a PaymentRequest
- Code snippets
- W3C document code
async function doPaymentRequest() {
try {
---->>>> const request = new PaymentRequest(methodData, details, options);
const response = await request.show();
await validateResponse(response);
} catch (err) {
// AbortError, SecurityError
console.error(err);
}
}
async function validateResponse(response) {
try {
const errors = await checkAllValuesAreGood(response);
if (errors.length) {
await response.retry(errors);
return validateResponse(response);
}
await response.complete("success");
} catch (err) {
// Something went wrong...
await response.complete("fail");
}
}
// Must be called as a result of a click
// or some explicit user action.
doPaymentRequest();
I am actually not be able to find the way to pass the third params inside angular.