7 E-Commerce

7.1 Purchase Determination For Add-On Content

Always use the nn::ec::CTR::ContentInfo::IsOwned function to determine whether a particular add-on content item has been purchased.

Because the nn::ec::CTR::ContentInfo::IsOnDevice function determines whether add-on content exists on the SD card, it will return true as long as that content exists on the SD card, even if the system considers that content to be "not purchased".

You can use the following steps to check whether the purchase determination has been correctly handled.

  1. Prepare two SD cards (SD card A and SD card B).
    For downloadable applications, download the application on to each SD card.
  2. Purchase an item, and save it to SD Card A.
  3. Close the application, and replace SD Card A with SD Card B.
  4. In the purchase flow within the application, confirm that the item purchased in step 2 is displayed with some indication that it is purchased or that it is redownloadable.
  5. Use any of the following methods to delete the rights to the data title containing the item purchased in step 2, or simply delete the eShop account.
    1. If your application does not use NNIDs (Nintendo Network IDs):
      Use EcDevTool (or EcRightTool) to delete the rights to the data title. Use the version of the tool included in the same CTR-SDK version used by your application.
    2. If your application uses NNIDs:
      Use a version of EcDevTool from CTR-SDK 7.2.1 or later to delete the Nintendo eShop account.
      (Versions of EcDevTool prior to CTR-SDK 7.2.1 cannot delete Nintendo eShop accounts.)
  6. Still using SD Card B, display the item catalog in the purchase flow within the application.
  7. Close the application, and replace SD Card B with SD Card A.
  8. In the purchase flow within the application, confirm that the item purchased in step 2 is displayed with some indication that it has not been purchased.

 

Note:

Always perform step 6 with SD Card B inserted. The EC applet might delete the contents of SD Card A if you insert SD Card A and check the item without following the procedure above.

Error 009-1005 may sometimes occur upon download if you repurchase the same item after completing the entire procedure above, but this is by specification of the e-commerce system, and is not a problem with the application's implementation.

 

 

E-Commerce

Add-On Content

Purchase determination

NNID

Nintendo Network ID

EcDevTool

EcRightTool

Error 009-1005

 

7.2 Supporting Input of Item Download Codes in the Application

The 16-digit item download code written on the item download voucher is composed of both alphabetic characters and numbers.

For this reason, if the user enters item download codes within the application, provide an input method that allows the user to enter both alphabetic characters and numbers.

 

E-Commerce

Item Download Codes

 

7.3 Handling Corrupted Add-On Content

If add-on content gets corrupted, take care to ensure that this does not cause the application to lock up or prevent the user from progressing in the game. When you mount or load add-on content and discover that it is corrupted, display an error and return to the scene prior to accessing the add-on content. Alternatively, you can handle it in such ways as notifying the user of the fact that the add-on content could not be loaded, and then transitioning to a scene that does not use the add-on content.

If you discover that add-on content is corrupted when you call an e-commerce library function, handle it using nn::ec::ResultError, just like you would any other e-commerce library error. Likewise, when displaying errors other than SD Card insertion/removal errors, display the error code obtained with the nn::ec::ResultError::GetErrorCode function and the corresponding error message.

Note that it is acceptable to not display an error or notification if the application discovers corruption in add-on content without actually mounting or loading the add-on content. (For example, in cases where the application uses the purchase simply to change a flag and unlock data that was embedded within the application from the start.)

For details about error handling, see the "File System: Error Handling" page in the E-Commerce library Function Reference.

Use the following procedure to reproduce a situation where add-on content is corrupted.

  1. Insert the SD Card with the add-on content on it into a PC, open the pertinent APP file from the Nintendo 3DS/…/title/<ProgramID Hi32>/<ProgramID Lo32>/content/00000000 directory in a hex editor, and set the value for the first 4 bytes to 0.
  2. Insert the SD Card into a Nintendo 3DS, start the application, and go to the scene where the add-on content is loaded.

If your application performs error display for corrupted add-on content, then error code 009-4901 or 009-8111 will occur when you perform step 2.

 

E-Commerce

Add-On Content

Corruption of Add-On Content

Error Handling

nn::ec::ResultError

nn::ec::ResultError::GetErrorCode Function

Error 009-4901

Error 009-8111

 

 


CONFIDENTIAL