public class

MerchantAction

extends Object
implements Parcelable
java.lang.Object
   ↳ com.usebutton.sdk.models.MerchantAction

Class Overview

Defines a merchant link action for asynchronous resolution including redirects.

Summary

Nested Classes
interface MerchantAction.OnCompleteListener Interface definition for a callback to be invoked when a merchant action is complete. 
Constants
int RESULT_CODE_ATTRIBUTED_ACTION_ENDED An attributed action is available and was presented to the user.
int RESULT_CODE_ERROR An error was encountered while fetching the merchant action.
int RESULT_CODE_NO_ACTION_STARTED No attributed action is available and no fallback behavior was started.
int RESULT_CODE_UNATTRIBUTED_ACTION_ENDED No attributed action is available and a fallback behavior was presented to the user.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<MerchantAction> CREATOR
Public Constructors
MerchantAction(Uri url)
Creates a new merchant action with a URL.
MerchantAction(Uri url, String publisherReference)
Creates a new merchant action with a URL and a publisher reference.
Protected Constructors
MerchantAction(Parcel in)
Public Methods
int describeContents()
String getPublisherReference()
Uri getUrl()
URL tryUrlForAction()
Returns a valid URL or `null` if invalid.
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int RESULT_CODE_ATTRIBUTED_ACTION_ENDED

An attributed action is available and was presented to the user.

Constant Value: 2 (0x00000002)

public static final int RESULT_CODE_ERROR

An error was encountered while fetching the merchant action.

Constant Value: -1 (0xffffffff)

public static final int RESULT_CODE_NO_ACTION_STARTED

No attributed action is available and no fallback behavior was started.

Constant Value: 0 (0x00000000)

public static final int RESULT_CODE_UNATTRIBUTED_ACTION_ENDED

No attributed action is available and a fallback behavior was presented to the user.

Constant Value: 1 (0x00000001)

Fields

public static final Creator<MerchantAction> CREATOR

Public Constructors

public MerchantAction (Uri url)

Creates a new merchant action with a URL.

Parameters
url The url of a merchant or link provider (may include redirects).

public MerchantAction (Uri url, String publisherReference)

Creates a new merchant action with a URL and a publisher reference.

Parameters
url The url of a merchant or link provider (may include redirects).
publisherReference A token to be associated with all downstream orders, transactions and webhooks. (Max 100 chars.)

Protected Constructors

protected MerchantAction (Parcel in)

Public Methods

public int describeContents ()

public String getPublisherReference ()

public Uri getUrl ()

public URL tryUrlForAction ()

Returns a valid URL or `null` if invalid.

public void writeToParcel (Parcel dest, int flags)