Jump to content


Photo

Invoicing API: Java API Error: NumberFormatException


  • This topic is locked This topic is locked
1 reply to this topic

#1 thor2012

thor2012

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 18 August 2012 - 09:07 AM

I am using the java api examples to create an invoice. I think I have all of the fields required to issue the CreateAndSendInvoice method but I get a NumberFormatException: null when i issue:

CreateAndSendInvoiceResponse resp = invoiceSrvc.createAndSendInvoice(createRequest);

Here is what I have in my sdk_config.properties file:
service.Binding=NV
service.EndPoint=https://svcs.sandbox.paypal.com/Invoice/CreateAndSendInvoice
service.RedirectURL=https://www.sandbox.paypal.com/webscr&cmd=
service.DevCentralURL=https://developer.paypal.com



InvoiceType invoiceType = new InvoiceType();
invoiceType.setMerchantEmail("xxxxxxxxxxxxxxxx");
invoiceType.setPayerEmail("yyyyyyyyyyyyyyyyyyy");
invoiceType.setPaymentTerms( PaymentTermsType.DUEONRECEIPT );
invoiceType.setNumber("1");
invoiceType.setCurrencyCode( "USD");
List<InvoiceItemType> items = new ArrayList<InvoiceItemType>();
InvoiceItemListType invoiceItem = new InvoiceItemListType();
invoiceType.setCustomAmountLabel("test");
invoiceType.setCustomAmountValue( new Double(49.95));
invoiceType.setShippingAmount( new Double( 0.0 ));
items.add(new InvoiceItemType("Item1", new Double(1.0), new Double(49.95)));
invoiceItem.setItem(items);
invoiceType.setItemList(invoiceItem);


RequestEnvelope env = new RequestEnvelope("en_US");
CreateAndSendInvoiceRequest createRequest = new CreateAndSendInvoiceRequest( env, invoiceType );
InvoiceService invoiceSrvc = new InvoiceService(in);
CreateAndSendInvoiceResponse resp = invoiceSrvc.createAndSendInvoice(createRequest);


#2 thor2012

thor2012

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 25 November 2012 - 12:02 PM

Hi.. i still have not been able to solve this. Does anyone have any working JAVA API for invoicing examples?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users