List of all Iphone and Blackberry Development codes in a one click Iphone,objective C,xcode,blackberry Development,iOS Development

Tuesday, December 11, 2012

Blackberry In-App Payment

The Payment Service enables you to leverage a range of business models through the sale of digital goods within your applications. The Payment Service is easy to implement and provides end users with a fast, consistent, and secure purchase experience.
The Payment Service is flexible, and enables you to implement a variety of subscription and renewal options in your apps. For example, you can offer auto-renewing subscriptions, free renewals for a specified period of time, or reduced-rate renewals.

 First download and add the payment sdk jar file to your project click here.
  1. Setup a 'sandbox' account using the BlackBerry App World vendor portal
  2. Upload your app into BlackBerry App world but don't publish it, just save it and leave it in draft state
  3. Also in the vendor portal, set up your digital goods (the things available for in-app purchase)
  4. On your BlackBerry, load App World and login with your sandbox account email address.
  5. Within any screen in App World press ALT+TST and enter the SKU or ID of your test app.
  6. You can then download the test version of your app (which is not available to anyone else)
  7. Once the app is downloaded and installed you will be able to test your in app payments.
 Use the following codes for the payment-


 private PaymentEngine engine = PaymentEngine.getInstance();

 PurchaseArgumentsBuilder arguments = new PurchaseArgumentsBuilder().withDigitalGoodSku( "sku-from the appworld").withDigitalGoodName( "name of the good").withMetadata( ""name of the good") .withPurchasingAppName( "Payment Service SDK Demo" );
                   

                            try
                           {
                               Purchase purchase = engine.purchase(arguments.build());
                               Dialog.inform("Purchase of " + purchase.getMetadata()
                                   + " is successful.");
                           }
                           catch (IllegalArgumentException e)
                           {
                               Dialog.inform(e.getMessage());
                           }
                           catch (PaymentException e)
                           {
                               Dialog.inform(e.getMessage());
                           }