-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Address Lookup | ||
|
||
Address Lookup allows using your own or a 3rd party service (e.g. Google Maps, MapKit, ...) to lookup an address based on a search term. | ||
|
||
You can use Address Lookup by specifying the ``BillingAddressConfiguration/mode`` | ||
|
||
### Card Component | ||
```swift | ||
let cardConfiguration = CardComponent.Configuration() | ||
// Setting the billing address mode to lookup by providing | ||
// your own lookup provider conforming to "AddressLookupProvider" | ||
cardConfiguration.billingAddress.mode = .lookup(MyAddressLookupProvider()) | ||
|
||
let cardComponent = CardComponent(paymentMethod: paymentMethod, | ||
context: context, | ||
configuration: cardConfiguration) | ||
``` | ||
|
||
### Drop-In | ||
```swift | ||
let dropInConfiguration = DropInComponent.Configuration() | ||
// Setting the billing address mode to lookup by providing | ||
// your own lookup provider conforming to "AddressLookupProvider" | ||
dropInConfiguration.card.billingAddress.mode = .lookup(MyAddressLookupProvider()) | ||
|
||
let dropInComponent = DropInComponent(paymentMethods: paymentMethods, | ||
context: context, | ||
configuration: dropInConfiguration) | ||
``` | ||
|
||
For example implementations of the ``AddressLookupProvider`` check the ``DemoAddressLookupProvider`` or ``MapkitAddressLookupProvider`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters