<doc>
	<legacy_id></legacy_id>
	<name>purchaseStateUpdate</name>
	<type>message</type>

	<syntax>
		<example>purchaseStateUpdate <i>purchaseID, productID, state</i></example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Sent by the store to notify the app of any changes in state to the purchase request.</summary>

	<examples>
<example><p>on purchaseStateUpdate pPurchaseID, pProductID, pState</p><p> switch pState</p><p>  case "paymentReceived"</p><p>   answer "payment received!"</p><p>   offerPurchasedProduct pProductID      </p><p>   mobileStoreConfirmPurchase pProductID</p><p>   mobileStoreDisablePurchaseUpdates</p><p>         </p><p>  case "error"</p><p>   answer "Error occured during purchase handling:" &amp;&amp; mobileStorePurchaseError(pPurchaseID)</p><p>   mobileStoreDisablePurchaseUpdates</p><p>         </p><p>  case "invalidSKU"</p><p>   answer "Invalid SKU."</p><p>   mobileStoreDisablePurchaseUpdates</p><p>         </p><p>  case "alreadyEntitled"</p><p>   answer "Already Owned."</p><p>   mobileStoreDisablePurchaseUpdates</p><p>         </p><p>  case "restored"</p><p>   answer "restored!"</p><p>   offerPurchasedProduct pProductID         </p><p>   mobileStoreConfirmPurchase pProductID</p><p>   mobileStoreDisablePurchaseUpdates</p><p>         </p><p>  case "cancelled"</p><p>   answer "Purchase Cancelled:" &amp;&amp; pProductID</p><p>   mobileStoreDisablePurchaseUpdates</p><p>               </p><p> end switch</p><p>end purchaseStateUpdate</p></example>
	</examples>

	<history>
		<introduced version="6.7">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
	</classification>

	<references>
		<function tag="mobileStoreCanMakePurchase">mobileStoreCanMakePurchase function</function>
		<function tag="mobileStorePurchasedProducts">mobileStorePurchasedProducts function</function>
		<function tag="mobileStorePurchaseError">mobileStorePurchaseError function</function>
		<function tag="mobileStoreProductProperty">mobileStoreProductProperty function</function>
		<command tag="mobileStoreEnablePurchaseUpdates">mobileStoreEnablePurchaseUpdates command</command>
		<command tag="mobileStoreDisablePurchaseUpdates">mobileStoreDisablePurchaseUpdates command</command>
		<command tag="mobileStoreConsumePurchase">mobileStoreConsumePurchase command</command>
		<command tag="mobileStoreConfirmPurchase">mobileStoreConfirmPurchase command</command>
		<command tag="mobileStoreRestorePurchases">mobileStoreRestorePurchases command</command>
		<command tag="mobileStoreSetProductType">mobileStoreSetProductType command</command>
		<command tag="mobileStoreRequestProductDetails">mobileStoreRequestProductDetails command</command>
		<command tag="mobileStoreMakePurchase">mobileStoreMakePurchase command</command>
		<command tag="mobileStoreVerifyPurchase">mobileStoreVerifyPurchase command</command>
		<message tag="productDetailsReceived">productDetailsReceived message</message>
		<message tag="productRequestError">productRequestError message</message>
	</references>

	<description>
	<overview>Use the <b>purchaseStateUpdate</b> message to notify the app of any changes in state to the purchase request.</overview>

		<parameters>
  <parameter>
    <name>purchaseID</name>
    <description>Is the identifier of the purchase request</description>
  </parameter>
  <parameter>
    <name>productID</name>
    <description>Is the product identifier for which the purchase request was made</description>
  </parameter>
  <parameter>
    <name>state</name>
    <description>Is the state of the purchase request : </description>
    <options title="">
      <option>
        <item>initialized</item>
        <description>the purchase request has been created but not sent</description>
      </option>
      <option>
        <item>sendingRequest</item>
        <description>the purchase request is being sent to the store</description>
      </option>
      <option>
        <item>paymentReceived</item>
        <description>the requested item has been paid for. The item should now be delivered to the user and confirmed via the mobileStoreConfirmPurchase command</description>
      </option>
      <option>
        <item>alreadyEntitled</item>
        <description>the requested product is already owned and cannot be purchased again</description>
      </option>
      <option>
        <item>invalidSKU</item>
        <description>the requested item does not exist in the store listing</description>
      </option>
      <option>
        <item>complete</item>
        <description>the purchase has now been paid for and delivered</description>
      </option>
      <option>
        <item>restored</item>
        <description>the purchase has been restored after a call to mobileStoreRestorePurchases. The purchase should now be delivered to the user and confirmed via the mobileStoreConfirmPurchase command</description>
      </option>
      <option>
        <item>cancelled</item>
        <description>the purchase was cancelled by the user before payment was received</description>
      </option>
      <option>
        <item>error</item>
        <description>an error occured during the payment request. More detailed information is available from the mobileStorePurchaseError function</description>
      </option>
    </options>
  </parameter>		</parameters>

	<value></value>
	<comments>The message <b>purchaseStateUpdate</b> is used to notify the app of any changes in state to the purchase request. It is sent by the store in response to new purchase requests or restore completed purchases requests.</comments>
	</description>
</doc>