<p>I would save the response to an incognito field (or fields) on your order (probably both the entire response and also just the fee separate out).</p>

<p><a href="https://github.com/mmikkel/IncognitoField-Craft" rel="nofollow">https://github.com/mmikkel/IncognitoField-Craft</a></p>

<p>The readonly incognito field is particularly good for this sort of thing - I use a bunch of these fields in a debug tab on my order layout to save useful things.</p>

<p>Just create the fields, add the fields to your order, and you update the values with the usual <code>&lt;input name="fields[fieldName]"&gt;</code> syntax with any cart operation, or use <code>setContentFromPost</code> if you're in a plugin:</p>

<pre><code>    $order-&gt;setContentFromPost(array(
        'fieldName' =&gt; $creditCardFee,
    ));
    craft()-&gt;commerce_orders-&gt;saveOrder($order);
</code></pre>

CC BY-SA 3.0
2016-10-27T00:21:31.827Z
2016-10-27T00:21:31.827Z
Jeremy Daalder
<p>How do I save and show the credit card fee on the order page. When I get the response from the gateway I too get the credit card fee amount but it's not being added to the order and isn't viewable anywhere - does anyone have any experience with that?</p>

CC BY-SA 3.0
2016-10-20T22:09:24.773Z
Just clarifying... the actual credit card fee comes back in a response from the gateway and you want to add that to the order for the customer to pay? Seems like an odd workflow.
Brad Bell
CC BY-SA 3.0
2016-10-20T22:20:28.083Z
I'm probably not making myself clear. The fee is paid on checkout through the gateway and is added to the total cost. I would like to register the fee on the final order in the CP. If the product cost $100 the total withdraw would be $100 + fee of $1 - total of $101. My question is - would I use adjusters or is there a better solution?
Beuschau
CC BY-SA 3.0
2016-10-21T06:55:22.997Z
Which gateway adds the fee to the payment after you send them the amount to charge?
Luke Holder
CC BY-SA 3.0
2016-10-21T07:41:44.803Z
Epay.dk - if a customer wants to pay with credit card there's a fee. A Danish credit card adds an extra cost of DKK 1,39 to every withdraw. The Webshop can chose to pay the fee or put it on the customer. If you choose to use international credit card the fee is different. In the gateway response there's a txnfee variable with the fee amount. You can see it in action here - it's in Danish. Http://ef.18digital.dk.
Beuschau
CC BY-SA 3.0
2016-10-21T20:54:39.820Z
Another question could be - how do I save all the response data from the gateway and make it viewable in the CP?
Beuschau
<plugin-craftcommerce>
Save and show card fee for Commerce plugin
# Save and show card fee for Commerce plugin

(Asked by: username_0 on 2016-10-20)

How do I save and show the credit card fee on the order page. When I get the response from the gateway I too get the credit card fee amount but it's not being added to the order and isn't viewable anywhere - does anyone have any experience with that?

**Tags:** plugin-craftcommerce
> **Comments:**
> **username_1**: Just clarifying... the actual credit card fee comes back in a response from the gateway and you want to add that to the order for the customer to pay? Seems like an odd workflow.  
> **username_0**: I'm probably not making myself clear. The fee is paid on checkout through the gateway and is added to the total cost. I would like to register the fee on the final order in the CP. If the product cost $100 the total withdraw would be $100 + fee of $1 - total of $101. My question is - would I use adjusters or is there a better solution?  
> **username_2**: Which gateway adds the fee to the payment after you send them the amount to charge?  
> **username_0**: Epay.dk - if a customer wants to pay with credit card there's a fee. A Danish credit card adds an extra cost of DKK 1,39 to every withdraw. The Webshop can chose to pay the fee or put it on the customer. If you choose to use international credit card the fee is different. In the gateway response there's a txnfee variable with the fee amount. You can see it in action here - it's in Danish. Http://ef.18digital.dk.  
> **username_0**: Another question could be - how do I save all the response data from the gateway and make it viewable in the CP?  

---

## 1 answers

### Answer by username_3 on 2016-10-27. Score: 1

I would save the response to an incognito field (or fields) on your order (probably both the entire response and also just the fee separate out).
https://github.com/mmikkel/IncognitoField-Craft
The readonly incognito field is particularly good for this sort of thing - I use a bunch of these fields in a debug tab on my order layout to save useful things.
Just create the fields, add the fields to your order, and you update the values with the usual  syntax with any cart operation, or use setContentFromPost if you're in a plugin:
    $order->setContentFromPost(array(
        'fieldName' => $creditCardFee,
    ));
    craft()->commerce_orders->saveOrder($order);


---

