The existingPaymentMethodRequired
property in the IsReadyToPayRequest object is marked as optional but the documentation does not state what the property's default value is.
What value does this property fall back to if I don't specify it?
The existingPaymentMethodRequired
property's default value, at the time of writing, is false
.
You can validate this by calling the PaymentsClient.isReadyToPay(request:) method with an IsReadyToPayRequest object which omits the existingPaymentMethodRequired
property and with the following setup:
IsReadyToPayRequest.allowedAuthMethods
array is set to ["PAN_ONLY","CRYPTOGRAM_3DS"]
.You will see that the PaymentsClient.isReadyToPay(request:) method returns true
with this setup just as it does when the IsReadyToPayRequest.existingPaymentMethodRequired
property is specified and set to false
.