1

I have a task using the StripeForce Stripe Client. I've been trying to do the following.

Once an invoice is created on stripe, to use the webhook invoice.created and then add a line item to the invoice that was just created before process the invoice on Salesforce.

I'm trying now to use the addLineItem method but nothing gets added, and get nothing on the logs.

I've tried calling it like this

StripeInvoiceItemResponse li = invoice.addLineItem(3);
System.debug('### Invoice Line Item invoice: ' + li.invoice_id);
System.debug('### Invoice line item id: ' + li.id);

or simply

invoice.addLineItem(3);

Nothing gets added to the invoice on stripe so I don't know exactly what am I missing.

  • what does your network tab tell you, or console?) – glls May 20 '17 at 0:30
  • As glls commented, what are the Developer Console debug logs telling you? – Daniel Ballinger May 20 '17 at 7:49
  • Looking at the open source, exceptions get mapped to a null return value. I presume your li is not null, so the problem probably does not lie in the code you have posted but rather in the logic of what you are doing as defined by earlier code or the setup on Stripe. – Keith C May 20 '17 at 15:05
  • How can I see the network tab or dev console if this is using webhooks between Stripe and Salesforce? – Federico Giust May 22 '17 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.