How to record payment provider (e.g. PayPal) fees as operational expenses

2015-12-15 Thread Morten Jensen
Hi,

We are using PayPal to make and take payments but we are not using the
PayPal gateway for payments and are instead using our own order and
payments integration flow.

We typically create an order of say £100 and once the client pays we
generate the invoice. The problem is that we may only get e.g. £97 after
paypal fees and we need to record the £3 as an operational expense (I have
set-up GL account 709100 PayPal fees for this) while still invoicing the
client for the £100 - after all, the client did pay £100 (and therefore
order adjustments don't seem to cut it either?)

Our business model prevents us from asking the client to foot the actual
fees at buyer's end. Just like what would be the case on e.g. ebay etc.

The problem we face is that only recording £97 prevents the order from
being completed because there's £3 outstanding. Recording £100 means that
our PayPal financial account will not reconcile because it doesn't reflect
the reality that only a single £97 payment was made - instead we would have
+£100 and a separate compensating transaction of -£3 on the financial
account, which doesn't seem right either.

I tried to create a manual GL transaction (and also got the code for
automatic working in the same way) on the remaining £3 on the invoice id
and payment id to 709100 - but it's not immediately clear to me what the
account source should be.

Could anyone shed any light on how to go about this?

For reference, we will be integrating with many more payment providers that
offer payments both ways over time; and therefore this is not just a PayPal
integration issue for us in terms of recording fees.

Thanks in advance for your assistance.

Best regards,
Morten Jensen


Re: How to record payment provider (e.g. PayPal) fees as operational expenses

2015-12-15 Thread Morten Jensen
Hi again,

I should probably add btw. that I had a look at the PayPalServices.java and
PayPayEvents.java files for inspiration on this. I notice that the latter
retrieves the fee via String paymentFee = request.getParameter("mc_fee") -
but as far is I can make out that is just ignored, i.e. not at all used
later.

Thanks.
Morten

On Tue, Dec 15, 2015 at 8:18 AM, Morten Jensen  wrote:

> Hi,
>
> We are using PayPal to make and take payments but we are not using the
> PayPal gateway for payments and are instead using our own order and
> payments integration flow.
>
> We typically create an order of say £100 and once the client pays we
> generate the invoice. The problem is that we may only get e.g. £97 after
> paypal fees and we need to record the £3 as an operational expense (I have
> set-up GL account 709100 PayPal fees for this) while still invoicing the
> client for the £100 - after all, the client did pay £100 (and therefore
> order adjustments don't seem to cut it either?)
>
> Our business model prevents us from asking the client to foot the actual
> fees at buyer's end. Just like what would be the case on e.g. ebay etc.
>
> The problem we face is that only recording £97 prevents the order from
> being completed because there's £3 outstanding. Recording £100 means that
> our PayPal financial account will not reconcile because it doesn't reflect
> the reality that only a single £97 payment was made - instead we would have
> +£100 and a separate compensating transaction of -£3 on the financial
> account, which doesn't seem right either.
>
> I tried to create a manual GL transaction (and also got the code for
> automatic working in the same way) on the remaining £3 on the invoice id
> and payment id to 709100 - but it's not immediately clear to me what the
> account source should be.
>
> Could anyone shed any light on how to go about this?
>
> For reference, we will be integrating with many more payment providers
> that offer payments both ways over time; and therefore this is not just a
> PayPal integration issue for us in terms of recording fees.
>
> Thanks in advance for your assistance.
>
> Best regards,
> Morten Jensen
>
>
>
>
>
>
>
>
>
>
>
>


Re: JobPoller: Problems reading values from serviceengine.xml file

2015-12-15 Thread Scott Gray
That's a problem in the older versions caused by concurrent access to the
cached dom model of the serviceengine.xml file. The dom doesn't support
concurrent reads and you'll intermittently see this problem.

The only solution is to store the serviceengine configuration in POJOs
rather than caching the dom.  It's a pain to change because the cached dom
is referenced all over.  I believe Adrian converted it to POJOs in one of
the later versions, you could always try backporting that to your version.

Regards

Scott
On 6 Dec 2015 12:51, "Len Shein"  wrote:

> All
>
> Had an issue in which Pending Jobs in Job sandbox were not starting.
>
> Found the folliwng in the log file:
>
> 2015-12-05 18:09:01,480 (org.ofbiz.service.job.JobPoller@9240189) [
> JobPoller.java:295:ERROR] Problems reading values from serviceengine.xml
> file [java.lang.NumberFormatException: null]. Using defaults.
>
> JobPoller code at line 295
>
>
>
> *private* *int* minThreads() {
>
> *int* min = *MIN_THREADS*;
>
>
>
> *try* {
>
> min = Integer.*parseInt*(ServiceConfigUtil.*getElementAttr*(
> "thread-pool", "min-threads"));
>
> } *catch* (NumberFormatException nfe) {
>
> Debug.*logError*("Problems reading values from
> serviceengine.xml file [" + nfe.toString() + "]. Using defaults.",
> *module*);
>
> }
>
> *return* min;
>
> }
>
>
>
> Removed “serviceengine.xml” from *Cache Name* resource.ResourceLoaders.
>
> Removing this cleared the issue and all PENDING jobs kicked off.
>
>
>
> We are using Ofbiz 10 ( which I understand is no longer supported).
>
>  However asking the community if anyone has any clues as how the
> serviceengine.xml could be corrupted in such a way that the Job Poller is
> unable to read from it?
>
>
>
>
>
>
>
> Len Shein
>
> lsh...@solveda.com
>
>
>
> Office: 516.742.7888 ext.225
>
> Home Office: 732.333.4303
>
> Cell: 917.882.8515
>
>
>
>
>


RE: JobPoller: Problems reading values from serviceengine.xml file

2015-12-15 Thread Len Shein
Thanks Scott, I'll take a look.

Regards
Len

-Original Message-
From: Scott Gray [mailto:scott.g...@hotwaxsystems.com] 
Sent: Tuesday, December 15, 2015 5:41 PM
To: user@ofbiz.apache.org
Subject: Re: JobPoller: Problems reading values from serviceengine.xml file

That's a problem in the older versions caused by concurrent access to the 
cached dom model of the serviceengine.xml file. The dom doesn't support 
concurrent reads and you'll intermittently see this problem.

The only solution is to store the serviceengine configuration in POJOs rather 
than caching the dom.  It's a pain to change because the cached dom is 
referenced all over.  I believe Adrian converted it to POJOs in one of the 
later versions, you could always try backporting that to your version.

Regards

Scott
On 6 Dec 2015 12:51, "Len Shein"  wrote:

> All
>
> Had an issue in which Pending Jobs in Job sandbox were not starting.
>
> Found the folliwng in the log file:
>
> 2015-12-05 18:09:01,480 (org.ofbiz.service.job.JobPoller@9240189) [ 
> JobPoller.java:295:ERROR] Problems reading values from 
> serviceengine.xml file [java.lang.NumberFormatException: null]. Using 
> defaults.
>
> JobPoller code at line 295
>
>
>
> *private* *int* minThreads() {
>
> *int* min = *MIN_THREADS*;
>
>
>
> *try* {
>
> min = 
> Integer.*parseInt*(ServiceConfigUtil.*getElementAttr*(
> "thread-pool", "min-threads"));
>
> } *catch* (NumberFormatException nfe) {
>
> Debug.*logError*("Problems reading values from 
> serviceengine.xml file [" + nfe.toString() + "]. Using defaults.", 
> *module*);
>
> }
>
> *return* min;
>
> }
>
>
>
> Removed “serviceengine.xml” from *Cache Name* resource.ResourceLoaders.
>
> Removing this cleared the issue and all PENDING jobs kicked off.
>
>
>
> We are using Ofbiz 10 ( which I understand is no longer supported).
>
>  However asking the community if anyone has any clues as how the 
> serviceengine.xml could be corrupted in such a way that the Job Poller 
> is unable to read from it?
>
>
>
>
>
>
>
> Len Shein
>
> lsh...@solveda.com
>
>
>
> Office: 516.742.7888 ext.225
>
> Home Office: 732.333.4303
>
> Cell: 917.882.8515
>
>
>
>
>



Re: How to record payment provider (e.g. PayPal) fees as operational expenses

2015-12-15 Thread Pierre Smits
Hi Morten,

Order adjustments to be able to process the difference is not the way to
go. The payment fee is operational expense (OPEX), as a result of the
business decision you (or your company) took. Changing the order, after the
customer consented to the terms, involves more than just your internal
processes. More explanation to your auditors, which leads to more
operational expense.

The way to deal with the difference is at the moment of the reconciliation
of the transaction in the financial account. De payment the customer did
(in this case via PayPal) is for 100% and the deduction incurred due to
using Paypal should be regarded as payment or financial transaction cost.
So, your AR position reduces with 100%, OPEX increases with 3% and the
balance of the associated financial increases with 97%.

In double entry accounting terms:

   - Dt 97% - gl account of the fin. account (associated with your Paypal
   fin.account
   - Dt 3% - gl account for the OPEX
   - Cr 100% - gl for AR, and in the sub ledger the invoice gets reconciled
   with the payment by the customer.

I trust the above helps.

Best regards,

Pierre Smits

ORRTIZ.COM 
OFBiz based solutions & services

OFBiz Extensions Marketplace
http://oem.ofbizci.net/oci-2/

On Tue, Dec 15, 2015 at 9:18 AM, Morten Jensen  wrote:

> Hi,
>
> We are using PayPal to make and take payments but we are not using the
> PayPal gateway for payments and are instead using our own order and
> payments integration flow.
>
> We typically create an order of say £100 and once the client pays we
> generate the invoice. The problem is that we may only get e.g. £97 after
> paypal fees and we need to record the £3 as an operational expense (I have
> set-up GL account 709100 PayPal fees for this) while still invoicing the
> client for the £100 - after all, the client did pay £100 (and therefore
> order adjustments don't seem to cut it either?)
>
> Our business model prevents us from asking the client to foot the actual
> fees at buyer's end. Just like what would be the case on e.g. ebay etc.
>
> The problem we face is that only recording £97 prevents the order from
> being completed because there's £3 outstanding. Recording £100 means that
> our PayPal financial account will not reconcile because it doesn't reflect
> the reality that only a single £97 payment was made - instead we would have
> +£100 and a separate compensating transaction of -£3 on the financial
> account, which doesn't seem right either.
>
> I tried to create a manual GL transaction (and also got the code for
> automatic working in the same way) on the remaining £3 on the invoice id
> and payment id to 709100 - but it's not immediately clear to me what the
> account source should be.
>
> Could anyone shed any light on how to go about this?
>
> For reference, we will be integrating with many more payment providers that
> offer payments both ways over time; and therefore this is not just a PayPal
> integration issue for us in terms of recording fees.
>
> Thanks in advance for your assistance.
>
> Best regards,
> Morten Jensen
>


Re: How to record payment provider (e.g. PayPal) fees as operational expenses

2015-12-15 Thread Pierre Smits
Hi Morten,

Feel free to create an improvement issue in our JIRA regarding the unused
parameter, so that this can be tracked.

Best regards

Pierre Smits

ORRTIZ.COM 
OFBiz based solutions & services

OFBiz Extensions Marketplace
http://oem.ofbizci.net/oci-2/

On Tue, Dec 15, 2015 at 9:41 AM, Morten Jensen  wrote:

> Hi again,
>
> I should probably add btw. that I had a look at the PayPalServices.java and
> PayPayEvents.java files for inspiration on this. I notice that the latter
> retrieves the fee via String paymentFee = request.getParameter("mc_fee") -
> but as far is I can make out that is just ignored, i.e. not at all used
> later.
>
> Thanks.
> Morten
>
> On Tue, Dec 15, 2015 at 8:18 AM, Morten Jensen 
> wrote:
>
> > Hi,
> >
> > We are using PayPal to make and take payments but we are not using the
> > PayPal gateway for payments and are instead using our own order and
> > payments integration flow.
> >
> > We typically create an order of say £100 and once the client pays we
> > generate the invoice. The problem is that we may only get e.g. £97 after
> > paypal fees and we need to record the £3 as an operational expense (I
> have
> > set-up GL account 709100 PayPal fees for this) while still invoicing the
> > client for the £100 - after all, the client did pay £100 (and therefore
> > order adjustments don't seem to cut it either?)
> >
> > Our business model prevents us from asking the client to foot the actual
> > fees at buyer's end. Just like what would be the case on e.g. ebay etc.
> >
> > The problem we face is that only recording £97 prevents the order from
> > being completed because there's £3 outstanding. Recording £100 means that
> > our PayPal financial account will not reconcile because it doesn't
> reflect
> > the reality that only a single £97 payment was made - instead we would
> have
> > +£100 and a separate compensating transaction of -£3 on the financial
> > account, which doesn't seem right either.
> >
> > I tried to create a manual GL transaction (and also got the code for
> > automatic working in the same way) on the remaining £3 on the invoice id
> > and payment id to 709100 - but it's not immediately clear to me what the
> > account source should be.
> >
> > Could anyone shed any light on how to go about this?
> >
> > For reference, we will be integrating with many more payment providers
> > that offer payments both ways over time; and therefore this is not just a
> > PayPal integration issue for us in terms of recording fees.
> >
> > Thanks in advance for your assistance.
> >
> > Best regards,
> > Morten Jensen
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>