// Copyright © 2022 Olo Inc. All rights reserved. // This software is made available under the Olo Pay SDK License (See LICENSE.md file) package com.olopaysdkreactnative.extensions import com.facebook.react.bridge.Arguments import com.facebook.react.bridge.WritableMap import com.olo.olopay.data.Address import com.olopaysdkreactnative.data.DataKeys fun Address.toMap() : WritableMap { return Arguments.createMap().also { it.putString(DataKeys.Address1Key, this.address1) it.putString(DataKeys.Address2Key, this.address2) it.putString(DataKeys.Address3Key, this.address3) it.putString(DataKeys.LocalityKey, this.locality) it.putString(DataKeys.PostalCodeKey, this.postalCode) it.putString(DataKeys.CountryCodeKey, this.countryCode) it.putString(DataKeys.AdministrativeAreaKey, this.administrativeArea) it.putString(DataKeys.SortingCodeKey, "") // Not available on Android } }