braintree / braintree-ios-drop-in

Braintree Drop-in for iOS
https://developers.braintreepayments.com
MIT License
98 stars 77 forks source link

Add missing error handling for No Recent Payments #388

Closed scannillo closed 1 year ago

scannillo commented 1 year ago

Background

This GitHub Issue (https://github.com/braintree/braintree-ios-drop-in/issues/383) surfaced a case where we are returning back (nil, nil) to the merchant when they call the mostRecentPaymentMethod() function.

Apparently, our tests were asserting/expecting to return (nil, nil) when no recent payment methods were found). I think this is weird and confusing behavior.

This PR treats this (nil, nil) case as a bug and fixes it by returning a proper merchant-facing error in the case of an empty vault list returned from the Gateway.

Summary

Authors

@scannillo

scannillo commented 1 year ago

Bitcode CI failure addressed here.

jaxdesmarais commented 1 year ago

Bitcode CI failure addressed here.

Just merged this into master!