Please Select Your Location
Australia
Österreich
België
Canada
Canada - Français
中国
Česká republika
Denmark
Deutschland
France
HongKong
Iceland
Ireland
Italia
日本
Korea
Latvija
Lietuva
Lëtzebuerg
Malta
المملكة العربية السعودية (Arabic)
Nederland
New Zealand
Norge
Polska
Portugal
Russia
Saudi Arabia
Southeast Asia
España
Suisse
Suomi
Sverige
台灣
Ukraine
United Kingdom
United States
Please Select Your Location
België
Česká republika
Denmark
Iceland
Ireland
Italia
Latvija
Lietuva
Lëtzebuerg
Malta
Nederland
Norge
Polska
Portugal
España
Suisse
Suomi
Sverige

Classes

IAPurchaseListener.QueryResponse

public class QueryResponse
{
    public string order_id { get; set; }
    public string purchase_id { get; set; }
    public string status { get; set; }//the value of status is "created" or "processing" or "success" or "failure" or "expired"
    public string price { get; set; }
    public string currency { get; set; }
    public long paid_timestamp { get; set; }
}
Parameter Type Description
order_id string Unique order id generated by client. If empty, shows purchase_id instead
purchase_id string Purchase ID
status string Purchase status. Possible values include created , processing , success , failure , and expired .
price string Total price
currency string Currency code
paid_timestamp long Time of payment in Unix time

This class stores purchase information for the OnQuerySuccess() callback and the function Query() when querying a single item.

IAPurchaseListener.QueryListResponse

public class QueryListResponse
{
    public int total { get; set; }
    public int from { get; set; }
    public int to { get; set; }
    public List<QueryResponse2> purchaseList;
}
Parameter Type Description
total int Total number of entries, starting from 1.
from int [Not in use] Query start range, default 1 .
to int [Not in use] Query end range, default == total .
purchaseList List< QueryResponse2 >

This class stores purchase data for the OnQuerySuccess() callback and the function Query() when querying the full list of end user purchases. Purchases are returned as a list of type QueryResponse2 .

IAPurchaseListener.QueryResponse2

public class QueryResponse2
{
    public string order_id { get; set; }
    public string app_id { get; set; }
    public string purchase_id { get; set; }
    public string user_data { get; set; }
    public string price { get; set; }
    public string currency { get; set; }
    public long paid_timestamp { get; set; }
}
Parameter Type Description
order_id string Unique order ID generated by client. If empty, shows purchase_id instead
purchase_id string Purchase ID
user_data string Item name provided by Request()
price string Total price
currency string Currency code
paid_timestamp long Payment time in Unix time

This class stores purchase information for the class QueryList() as part of a larger list.

IAPurchaseListener.Subscription

public class Subscription
{
    public string app_id { get; set; }
    public string order_id { get; set; }
    public string subscription_id { get; set; }
    public string price { get; set; }
    public string currency { get; set; }
    public long subscribed_timestamp { get; set; }
    public TimePeriod free_trial_period { get; set; }
    public TimePeriod charge_period { get; set; }
    public int number_of_charge_period { get; set; }
    public string plan_id { get; set; }
    public string plan_name { get; set; }
    //the value of status is "created" or "processing" or "failure" or "expired" or "ACTIVE" or "NON_RENEWING" or "CANCELED"
    public string status { get; set; }
    public StatusDetail status_detail { get; set; }
}
Parameter Type Description
app_id string App ID from the VIVEPORT Developer Console
order_id string Unique purchase ID which can be used for query or cancellation
subscription_id string ID of the specific subscription
price string Price in user currency as a string in format "1.50"
currency string See currency list
subscribed_timestamp long Time the end user subscribed
free_trial_period TimePeriod Free trial length. This is fixed, so it doesn’t count down as the trial progresses.
charge_period TimePeriod Unit of subscription charged, such as “month” or “day”
number_of_charge_period int Number of charge periods
plan_id string Plan ID set by the developer
plan_name string Plan name set by the developer
status string Status string set by developer
status_detail StatusDetail Information about payment history

This class stores data for functions related to subscriptions. Subscription is often returned as an array for functions that return subscription lists.

For charge periods, specify month or day. The number of charge periods represents the number of that unit in the length of the subscription. For example: charge_period.timetype == “month” , charge_period.value == 1 , and number_of_charge_period == 12 would result in a subscription billed monthly that lasts for one year.

IAPurchaseListener.StatusDetail

public class StatusDetail
{
    public long date_next_charge { get; set; }
    public StatusDetailTransaction[] transactions { get; set; }
    public string cancel_reason { get; set; }
}
Parameter Type Description
date_next_charge long Date of next billing
transactions StatusDetailTransaction []
cancel_reason string Reason for cancellation, see below

This class stores data about transactions for the Subscription class.

Possible values of cancel_reason

Value Description
CANCEL End user cancelled
OUT_OF_PERIOD Subscription elapsed
PAYMENT_FAIL Too many payment retries

IAPurchaseListener.StatusDetailTransaction

public class StatusDetailTransaction
{
    public long create_time { get; set; }
    public string payment_method { get; set; }
    public string status { get; set; }    
    //paymentFailed/pendingWebhook/finish
}
Parameter Type Description
create_time long Order time in Unix time
payment_method string Payment method
status string Current status. Possible values include paymentFailed , pendingWebhook , or finish .

This class stores data for functions related to payment methods for the Subscription class.

IAPurchaseListener.TimePeriod

public class TimePeriod
{
    public string time_type { get; set; }
    public int value { get; set; }
}
Parameter Type Description
time_type string "month" or "day"
value int Number of time_type in a TimePeriod

This class stores information about payment and subscription time lengths for the Subscription class. For example, a subscription billed every six months might have a time_type of “month” and a value of 6 .