Day1_2 nokia in-app payment
Upcoming SlideShare
Loading in...5
×
 

Day1_2 nokia in-app payment

on

  • 5,529 views

http://winstore.vn

http://winstore.vn

Statistics

Views

Total Views
5,529
Views on SlideShare
5,496
Embed Views
33

Actions

Likes
0
Downloads
14
Comments
0

1 Embed 33

http://openitvn.net 33

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Day1_2 nokia in-app payment Day1_2 nokia in-app payment Presentation Transcript

  • NOKIA IN-APP PAYMENT
  • / DEVELOPER DAY Nokia Internal Use Only CONTENTS • Introduction • What’s new • Benefits • Architecture and usage • Coding the API into your project
  • / DEVELOPER DAY Nokia Internal Use Only INTRODUCTION Durables * (e.g. new level in a game) Consumables (e.g. virtual currency) Nokia In-App Payment enables developers to sell digital content to consumers from within their application. This is targeted to Nokia Asha Software Platform and Series 40 Developer Platform
  • / DEVELOPER DAY Nokia Internal Use Only WHAT’S NEW The new Nokia In-App Payment marks Nokia’s renewed approach to IAP. The solution has been designed afresh with several new features. Most important, the new Nokia In-App Payment solution is easier to test and deploy! Feature Nokia In-App Payment (New) In-App Purchasing (To be deprecated) Single click buy flow S40 backward compatibility (6th Edition and above*) Payment without registration
  • / DEVELOPER DAY Nokia Internal Use Only BENEFITS Profitable solution Broadest reach Safe payment experience • 70% payout from gross selling price • Easy to integrate and maintain • Single click payment • Nokia’s brand adds credibility • Billing in 59markets with 158 operators • Unparalleledcoverage of devices
  • / DEVELOPER DAY Nokia Internal Use Only PROFITABLE SOLUTION Easy to integrate and maintain 70% payout from gross selling price
  • / DEVELOPER DAY Nokia Internal Use Only SEAMLESS AND SAFE EXPERIENCE Single click payment Brand credibility
  • / DEVELOPER DAY Nokia Internal Use Only LARGEST RANGE OF DEVICES
  • / DEVELOPER DAY Nokia Internal Use Only BROADEST REACH Live Operators ■ Full Country coverage ■ Partial Country coverage Operator billing live with - 158 operators - in 59 countries (status in April 2013)
  • / DEVELOPER DAY Nokia Internal Use Only ARCHITECTURE AND USAGE
  • / DEVELOPER DAY Nokia Internal Use Only ARCHITECTURE – COMPONENTS(1/3) • Nokia In-App Payment (NIAP) Library • Shipped as jar-file, which inlcudes all public classes and APIs for application to interface with the payment system. • Application needs to include this jar • Nokia In-App Payment Enabler • Contains all the functionalities implemented for the payment process • Communicates to backend server, shows UI screens for payment process • Installed to device through store client update, or when first usage of the Nokia In-App Paymant library occurs.
  • / DEVELOPER DAY Nokia Internal Use Only ARCHITECTURE - COMPONENTS(2/3) • App makes call to IAP function implemented in the NIAP library. • NIAP library communicates with device resident NIAP enabler (enabler installed if missing) • NIAP enabler then communicate with store backend to perform the purchase. • All outside device calls are encrypted and secure.
  • / DEVELOPER DAY Nokia Internal Use Only ARCHITECTURE - COMPONENTS(3/3)
  • / DEVELOPER DAY Nokia Internal Use Only USER JOURNEY User plays the game and reaches level 2 (premium) Actual purchase flow User return to the game to play level 2
  • / DEVELOPER DAY Nokia Internal Use Only ERROR SITUATIONS • Errors are handled in NIAP enabler, thus the Client code generally does not need to worry about it. • Error can be temporal in nature, thus user will be offered to try again with certain error situations. • usual related to connecting payment service, network issues or getting payment confirmation • Also there can be Fatal Errors which can not be recovered, then only option user can do, is to close payment process and go to the app for retry. Possible reasons includes: • Backend couldn’t be initiated • Operator billing not possible • Payment session time out
  • / DEVELOPER DAY Nokia Internal Use Only CODING THE NIAP
  • / DEVELOPER DAY Nokia Internal Use Only ADDING NIAP INTO YOUR APP Steps: 1. Add the library into the 2. Add Code required for the API usage into the project 3. Configure emulator 4. Use pre-defined Testing time product Ids for testing, and change them to real ones once your application logic is tested to work.
  • / DEVELOPER DAY Nokia Internal Use Only ADDING THE NIAP LIBRARY 1. Right click project name and select “properties” from the pop up menu When adding NIAP usage into a application, you also need to add the NIAP library into the project.This can be done with following steps: 2. select “Java build path” and “libraries” tab, and then click “Add external Jar” 3. Browse for the jar file and click ok 4. Select “Order and Export” tab, and tick the included library, and click Ok
  • / DEVELOPER DAY Nokia Internal Use Only NIAP API: COM.NOKIA.PAYMENT Interface Summary NPayListener Interface for Nokia In-App Payment Enabler callback functions. Class Summary NPayManager Payment flow control class, responsible for payment process. ProductData Product data class to hold the product catalogue information PurchaseData Payment response data clas to hold purchase results. Exception Summary NPayException Payment logical error exception.
  • / DEVELOPER DAY Nokia Internal Use Only CODING THE API INTO PROJECT (1/3) • All API parts are implemented under com.nokia.payment, so add imports. import com.nokia.payment.NPayException; import com.nokia.payment.NPayListener; import com.nokia.payment.NPayManager; import com.nokia.payment.ProductData; import com.nokia.payment.PurchaseData; public class .. extends MIDlet implements NPayListener…{ public void productDataReceived(ProductData[] dataItems) { // triggered when getProductData() is called for product info like price point } public void purchaseCompleted(PurchaseData purchaseData) { // triggered when purchaseProduct() is called. handles purchase response } public void restorableProductsReceived(ProductData[] arg0) { // triggered when getRestorableProducts() called for restorable product } • Implement NPayListener interface and add unimplemented methods.
  • / DEVELOPER DAY Nokia Internal Use Only CODING THE API INTO PROJECT (1/3) • Initialize NPayManager object in the startApp() method and pass one parameter, a reference to app MIDlet to it, and Register NPayListener interface with NPayManager paymentManager = new NPayManager(this); paymentManager.setNPayListener(this); • Request price for in-app items. paymentManager.getProductData(productIds); • Incase the library does not contain localized prices, then they are retrieved from the Nokia store via the NIAP enabler. This will cause the Application to be destroyed and re- launched. • Before starting the payment process, check the Nokia In-App Payment Enabler is installed, if doesn’t have then install it if (!paymentManager.isNPayAvailable()) { paymentManager.launchNPaySetup(); }
  • / DEVELOPER DAY Nokia Internal Use Only CODING THE API INTO PROJECT (1/3) • Prepare product ids – price point mapping in .jad file(Nokia-IAP-PricePoint- followed by product id, then a color(:), finally price point index) 1. Click ”Application Descriptor” in project files view to open the jad editor 2. Open ”Application Descriptor” tab add the values 3. Write the values into the file and save changes Nokia-IAP-Pricepoint-1023608: 1 Nokia-IAP-Pricepoint-1023625: 4 Nokia-IAP-Pricepoint-1023624: 3 Nokia-IAP-Pricepoint-1023623: 4 • Make the purchase using purchaseProduct(). Enabler starts the payment process here. String productId ="1023608"; paymentManager.purchaseProduct(productId);
  • / DEVELOPER DAY Nokia Internal Use Only CONFIGURING THE EMULATOR • Clear Overrule default handset behavior option in MIDP tab of Tools->preferences menu. • If this is not done the purchase process can be started, but the application will not be re- launched when returning from purchase confirmation. • Remember to restart the emulator to apply the changes made.
  • / DEVELOPER DAY Nokia Internal Use Only PRODUCT IDS FOR TESTING • There are several predefined product ids for testing in emulator and in the device defined in documentation. • The Offline test product ids are intended to be used with the emulator and online test product ids should be used with device testing • The Offline product ids are not making any connections to the Nokia store at all. • Trying to utilize the predefined online test product ids in emulator environment will cause the payment process to fail in all cases.. • Online product ids in the device doesn’t initiate the actual payment. Remember that device needs to have SIM card and online connectivity supported.
  • / DEVELOPER DAY Nokia Internal Use Only GET PRODUCT IDS (1/3) • Go to https://publish.nokia.com/ and Add new content item as usual • Make sure that Enable In-App purchase item option is selected, this allows you to add NIAP items into the added content item.
  • / DEVELOPER DAY Nokia Internal Use Only GET PRODUCT IDS (2/3) • Create In-App purchase item by clicking ‘Add In-App purchase’ button
  • / DEVELOPER DAY Nokia Internal Use Only GET PRODUCT IDS (3/3) • Submit to QA before it can be used
  • / DEVELOPER DAY Nokia Internal Use Only SUMMARY Register in-app purchase products, declare price points with Nokia Publish and retrieve product IDs Test your app using the in-app purchase flow Submit your final app to Nokia Publish and be ready to generate revenue Download and install Java Development Environment for Asha and Nokia In-App Payment library Update your application using the product IDs Implement in-app payment feature using the test product IDs provided in the documentation Test your app in the emulator or on device with the test purchase flow
  • / DEVELOPER DAY Nokia Internal Use Only SIGN UP FOR BETA ACCESS https://developer.nokia.com/Distribute/In-app_payment/
  • / DEVELOPER DAY Nokia Internal Use Only THANK YOU ! NOW TIME FOR QUESTIONS AND ANSWERS