Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums on April 1st. BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com


Reply
Developer
Posts: 415
Registered: ‎07-28-2010
My Device: 8000
My Carrier: hi

net.rimlib.blackberry.api.payment.payment exception:

Hello friends,

                     On device i am using appworld 3.1.0.60 version. when i am trying to purchase any item i am getting 

net.rimlib.blackberry.api.payment.payment exception.  what should i do? any one help me for that? 

                     i am using follwing code for purchasing..

 

public class ProductPurchaseV1 {
	
	static ProductPurchaseV1 objProductPurchase;
    private String digitalGoodName;
    private String digitalGoodSku;
    private String failureReason;
	private PaymentEngine engine = PaymentEngine.getInstance();
	private ProductPurchaseV1() {
		
	}
	public static ProductPurchaseV1 getInstance() {
		if(objProductPurchase == null) {
			objProductPurchase = new  ProductPurchaseV1();
		}
		return objProductPurchase;
	}

	public void setDigitalGoodName(String digitalGoodName) {
		this.digitalGoodName =digitalGoodName;
		
	}
	public String setDigitalGoodName() {
		return digitalGoodName;
		
	}
	public void setDigitalGoodSKU(String digitalGoodSku) {
		this.digitalGoodSku =digitalGoodSku;
		
	}
	public String setDigitalGoodSKU() {
		return digitalGoodSku;
		
	}
	public boolean startPurchase() throws IllegalArgumentException,IllegalApplicationException,PaymentServerException, UserCancelException,PaymentException  {
         PurchaseArgumentsBuilder arguments = new PurchaseArgumentsBuilder()
        .withDigitalGoodSku( digitalGoodSku )
        .withDigitalGoodName( digitalGoodName )
        .withMetadata( digitalGoodName )
        .withPurchasingAppName( "PushLegal" );
 		System.out.println("***************startPurchase************************");

            Purchase purchase = engine.purchase(arguments.build());
     		System.out.println("***************startPurchase retrn true************************");

             	return true;
      }
	
	public String getFailureReason() {
		return failureReason;
	}
    public boolean isAppworldInstalled() {
    	boolean b = false;
    	if(engine != null)
    		b = true;
    	return b;
    }
    
    public void installAppWorld() {
    	
    }
    
    public void updateAppWorld() {
   // 	engine.upDateAppWorld();
    }

 thanks and regards,

    ajay patil..

Highlighted
Trusted Contributor
Posts: 146
Registered: ‎03-22-2010
My Device: Not Specified

Re: net.rimlib.blackberry.api.payment.payment exception:

Developer
Posts: 415
Registered: ‎07-28-2010
My Device: 8000
My Carrier: hi

Re: net.rimlib.blackberry.api.payment.payment exception:

Thanks for reply me. actully my issue is solved. i want TransactionId in my current purchased.. i am using getTransactionId()  function but i am getting 0 alwasy..

public boolean startPurchase() throws IllegalArgumentException,IllegalApplicationException,PaymentServerException, UserCancelException,PaymentException,AppWorldUpdateRequired  {
         PurchaseArgumentsBuilder arguments = new PurchaseArgumentsBuilder()
        .withDigitalGoodSku( digitalGoodSku )
        .withDigitalGoodName( digitalGoodName )
        .withMetadata( digitalGoodName )
        .withPurchasingAppName( "PushLegal" );
        // System.out.println("digitalGoodSku"+digitalGoodSku+"--digitalGoodName"+digitalGoodName+"digitalGoodName");
    		System.out.println("***************startPurchase************************");
  			 Purchase purchase= engine.purchase(arguments.build());
         	transactionId=purchase.getTransactionId();// 
Here i am getting transactionID 0. where i am wrong?
         	System.out.println("***************startPurchase retrn true************************");
         	return true;
      }