# PurchasePathInterface

## Class Overview

Button Purchase Path takes regular Merchant URLs to products, categories or just the homepage and replaces them with a fully attributed Button Purchase Path, optimized for both conversion and user experience.

See [Button Developer Guide](https://developer.usebutton.com/guides/publishers/android/create-a-button-purchase-path)

## Summary

| Public Methods |
| --- |
| abstract<br> <br> <br> <br> <br> void | [fetch](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathInterface.html#fetch(com.usebutton.sdk.purchasepath.PurchasePathRequest,%20com.usebutton.sdk.purchasepath.PurchasePathListener))( [PurchasePathRequest](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathRequest.html) request, [PurchasePathListener](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathListener.html) listener)<br> <br> <br>Asynchronously fetch a Purchase Path with a request. |
| abstract<br> <br> <br> <br> <br> [PurchasePathExtension](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathExtension.html) | [getExtension](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathInterface.html#getExtension())()<br> <br> <br>Gets the current Purchase Path extension. |
| abstract<br> <br> <br> <br> <br> boolean | [isBrowserEnabled](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathInterface.html#isBrowserEnabled())()<br> <br> <br>Indicates if all urls would be opened in the webview |
| abstract<br> <br> <br> <br> <br> void | [setExtension](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathInterface.html#setExtension(com.usebutton.sdk.purchasepath.PurchasePathExtension))( [PurchasePathExtension](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathExtension.html) extension)<br> <br> <br>Sets a Purchase Path extension. |

## Public Methods

### public abstract void fetch( [PurchasePathRequest](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathRequest.html) request, [PurchasePathListener](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathListener.html) listener)

Asynchronously fetch a Purchase Path with a request.

#### Parameters

| request | request params including URL and optional publisher reference. |
| listener | callback to be invoked when the request is complete. |

### public abstract [PurchasePathExtension](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathExtension.html)getExtension()

Gets the current Purchase Path extension.

#### Returns

- the current Purchase path extension.

### public abstract boolean isBrowserEnabled()

Indicates if all urls would be opened in the webview

#### Returns

- true if enabled

### public abstract void setExtension( [PurchasePathExtension](https://building.usebutton.com/button-android/latest/reference/com/usebutton/sdk/purchasepath/PurchasePathExtension.html) extension)

Sets a Purchase Path extension.

_Note: The passed object will be strongly held by Button._

#### Parameters

| extension | this will override any existing extension. Pass `null` to remove the<br> current extension. |
