Automatically applying a fee for each pay

Hi,

How I can do this?

I tried a sample with PaymentActivity and example was working how I expected.



co.poynt.api.model.Fee fee = new co.poynt.api.model.Fee();
fee.setAmount(123l);
fee.setName(“Test”);
fee.setId(1001l);
//fee.setPercentage(20f);
fee.setAppliedBeforeTax(false);

        List<Fee> fees = new ArrayList<Fee>();
        fees.add(fee);

        order.setFees(fees);

        payment.setOrder(order);
        payment.setOrderId(order.getId().toString());

        // tip can be preset
        //payment.setTipAmount(500l);
        OrderAmounts orderAmounts = order.getAmounts();
        orderAmounts.setNetTotal(orderAmounts.getNetTotal() + fee.getAmount());
        orderAmounts.setFeeTotal(fee.getAmount());
        order.setAmounts(orderAmounts);
        payment.setAmount(order.getAmounts().getNetTotal());

But I don’t know how I can do the same with payment frame in Poynt Register.

Could you please help me?

Thank you!

To add fee to an order you need to manage the order yourself like the register app does.
Does that answer your question? if not please explain what you are planning to do

no, I need automatically apply a fee for each order, not manually through UI

To add it programmatically you need to manage orders from your app, you cannot programmatically add fee to orders from register app