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

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;
      }