square / react-native-square-reader-sdk

React Native Plugin for Square Reader SDK
Apache License 2.0
115 stars 34 forks source link

Fix exception when tipSettings is undefined. #198

Closed caleb-harrelson closed 4 months ago

caleb-harrelson commented 1 year ago

Summary

Fixes an exception TypeError: undefined is not an object (evaluating 'Object.prototype.hasOwnProperty.call(t,o)’) when tipSettings is not defined. tipSettings is supposed to be optional, and suppresses the tip screen when undefined, but a regression was introduced via #148 that forced it to be required and show a tip screen or the unhandled exception would result.

Related issues

Addresses regression in #148, outlined in this PR review (reviewed post release)

Changelog

Test Plan

The bug this fixes is reproducible by trying to start a checkout with tipSettings: undefined (tip screen suppressed). After this fix, the checkout flow will function properly.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

mansi-square commented 4 months ago

PR is already merged.