# Override Payment styling

**Override UI elements of the Payments workflow.**

You can override the following elements of the InStore Payment module:

- [Styling of payment types](/instore/customization/override-core-module-styling/payment-styling-overrides.md#styling-of-payment-types)
- [Payment Totals box](/instore/customization/override-core-module-styling/payment-styling-overrides.md#add-payment-details-to-the-totals-box)

> For general information, see [Core module styling overrides overview](/instore/customization/override-core-module-styling/overview.md).
>
> To override strings, see [Override core strings](/instore/customization/override-core-module-styling/override-core-strings.md).
>
> For all keys that are used in the Payment screens, see [List of core strings](/instore/customization/override-core-module-styling/list-of-core-strings.md).

## Styling of payment types

Use the guides below to override the HTML structure of the payment types, including cash, cash drawer, change due, credit processing, and stored-value card entry workflows. You can also override the HTML structure for Pay On Account (POA) workflows.

### Payment types structure

```tsx title="Payment types layout"
<Grid className="instore-payment-entry-container">
  <Grid item xs={12} md={6} className="instore-payment-amount-section">
    <Grid item xs={12}>
      <Typography className="instore-payment-amount-header" />
    </Grid>
    <Grid item xs={12}>
      <KeypadEntry className="instore-payment-amount-keypad" />
    </Grid>
  </Grid>
  <Grid item xs={12} md={6} className="instore-payment-types-section">
    <Grid item xs={12}>
      <Typography className="instore-payment-types-header" />
    </Grid>
    <Grid item xs={12}>
      <Grid>
        <TenderButton className="instore-payment-types-button-${type}" />
        
      </Grid>
    </Grid>
  </Grid>
</Grid>
```

![InStore payment types override](https://docs.commercetools.com/instore/images/override-payment-types-html.jpg)

### Cash structure

```tsx title="Cash layout"
<Grid className="instore-payment-entry-container">
  <Grid item xs={12} md={6} className="instore-payment-amount-section">
    <Grid item xs={12}>
      <Typography className="instore-payment-amount-header" />
    </Grid>
    <Grid item xs={12}>
      <KeypadEntry className="instore-payment-amount-keypad" />
    </Grid>
  </Grid>
  <Grid item xs={12} md={6} className="instore-cash-section">
    <Grid item xs={12}>
      <Typography className="instore-cash-header" />
    </Grid>
    <Grid item xs={12}>
      <Grid>
        <Button className="instore-cash-button-${value}" /> 
      </Grid>
    </Grid>
  </Grid>
</Grid>
```

![InStore cash override](https://docs.commercetools.com/instore/images/override-cash-html.jpg)

### Cash drawer structure

```tsx title="Cash drawer layout"
<Grid>
  <Grid item xs={12} md={6}>
    <Grid item xs={12}>
      <Typography className="instore-cash-promp-drawer" />
    </Grid>
  </Grid>
</Grid>
```

![InStore cash drawer override](https://docs.commercetools.com/instore/images/override-cash-drawer-html.jpg)

### Change due structure

```tsx title="Change due layout"
<Grid className="instore-change-due-container">
  <Grid item xs={12}>
    <Typography className="instore-cash-change-row-0" />
    <Typography className="instore-cash-change-row-1" />
    <Typography className="instore-cash-change-row-2" />
    <Typography className="instore-cash-change-row-3" />
  </Grid>
</Grid>
```

![InStore change due override](https://docs.commercetools.com/instore/images/override-change-due-html.jpg)

### Credit processing structure

```tsx title="Credit processing layout"
<Grid className="instore-payment-entry-container">
  <Grid item xs={12}>
    <Typography className="instore-credit-process-label" />
    <Typography className="instore-credit-process-amount" />
  </Grid>
</Grid>
```

![InStore credit processing override](https://docs.commercetools.com/instore/images/override-credit-processing-html.jpg)

### Stored-value card entry structure

```tsx title="Stored-value card entry layout"
<Grid>
  <Grid item xs={12} md={6}>
    <Grid className="instore-gift-cart-header">
      <Grid item xs={12}>
        <Button className="instore-gift-cart-camera-button" />
        <Typography className="instore-gift-cart-label" />
      </Grid>
      <Grid item xs={12}>
        <KeypadEntry className="instore-gift-cart-keypad" />
      </Grid>
    </Grid>
  </Grid>
</Grid>
```

![InStore stored-value card override](https://docs.commercetools.com/instore/images/override-gift-card-html.jpg)

### HTML structures for Pay On Account

Use this wrapper to introduce the POA component:

```
<Paper elevation={0} className='instore-POA-paper-background'>
  <Container className='instore-POA-confirmation-container'>
```

### HTML structure for POA Company Name label and field

```
<>
  <Grid item xs={12} sm={6}>
    <Typography
      className='instore-POA-company-name-label'
    >
      {t('POA.companyName')}
    </Typography>
  </Grid>
  <Grid
    item
    xs={12}
    sm={6}
    className='instore-POA-company-name-field'
    >
    <Typography
      variant='subtitle1'
      id='customer-company-name'
    >
      {customer.company}
    </Typography>
  </Grid>
</>
```

### HTML structure for POA Authorized Purchaser label and field

```
<>
  <Grid item xs={12} sm={6}>
    <Typography
      variant='h6'
      id='instore-POA-authorised-purchaser-label'
    >
      {t('POA.authorizedPurchaser')}
    </Typography>
  </Grid>
  <Grid item xs={12} sm={6}>
    <Typography
      variant='subtitle1'
      className='instore-customer-authorised-purchaser-field'
    >
      {customer.first_name + ' ' + customer.last_name}
    </Typography>
  </Grid>
</>
```

### HTML structure for POA Customer Number label and field

```
<>
  <Grid item xs={12} sm={6}>
    <Typography
      variant='h6'
      className='instore-customer-number-label'
    >
      {t('POA.customerNumber')}
    </Typography>
  </Grid>
  <Grid item xs={12} sm={6}>
    <Typography
      variant='subtitle1'
      className='instore-customer-number-field'
    >
      {customer.customer_number}
    </Typography>
  </Grid>
</>
```

### HTML structure for POA Customer Email label and field

```
<>
  <Grid item xs={12} sm={6}>
    <Typography variant='h6' className='instore-customer-email-label'
    >
      {t('POA.customerEmail')}
    </Typography>
  </Grid>
  <Grid item xs={12} sm={6}>
    <Typography variant='subtitle1' className='instore-customer-email-field'
    >
      {customer.email}
    </Typography>
  </Grid>
</>
```

### HTML structure for POA Account IDs label and drop-down

```
<>
  <Grid item xs={12} sm={6}>
    <Typography variant='h6' className='instore-POA-account-id-label'
    >
      {t('POA.accountID')}
    </Typography>
  </Grid>
  <Grid item xs={12} sm={6}>
    <Typography variant='subtitle1' className='instore-customer-account-number'
    >
      {accountNumber}
    </Typography>
  </Grid>
  <Grid item xs={12} sm={6}>
    <FormControl className='instore-POA-account-dropdown'
    >
      <Select
      >
        <MenuItem
        >
          {account}
        </MenuItem>
      </Select>
    </FormControl>
  </Grid>
</>
```

### HTML structure for POA page divider

```
  <Grid item xs={12} sm={6}>
    <Divider variant='middle' className='instore-POA-divider' />
  </Grid>
```

### HTML structure for POA Payment Amount label and field

```
<>
  <Grid item xs={12} sm={6}>
    <Typography variant='h6' className='instore-POA-payment-amount-label'
    >
      {t('POA.paymentAmount')}
    </Typography>
  </Grid>
  <Grid item xs={12} sm={6}>
    <Typography variant='subtitle1' className='instore-poa-payment-amount'>
      {currentTenderAmount.toFormat(currencyInstance.currencyFormat)}
    </Typography>
  </Grid>
</>
```

### HTML structure for POA Purchase Order label and field

```
<>
  <Grid item xs={12} sm={6}>
    <Typography variant='h6' className='instore-purchase-order-label'
    >
      {t('POA.purchaseOrderLabel')}
    </Typography>
  </Grid>
  <Grid item xs={12} sm={6}>
    <TextField
      value={purchaseOrder}
      className='instore-POA-purchase-order-input'
    />
  </Grid>
</>
```

### HTML structure for POA navigation buttons

```
<Button
  className='instore-back-btn'
>
  {t('Common.buttons.back')}
</Button>
<Button
  className='instore-next-btn'
>
  {t('Common.buttons.next')}
</Button>
```

### Pay On Account HTML rendered on the UI

![InStore POA page](https://docs.commercetools.com/instore/images/poa-fields-page.jpg)

## Add payment details to the Totals box

You can add your own specific information to display to your colleagues at the top of the **Totals** box during checkout. For example, you can display loyalty benefits, customer entitlements, or applied discount information to help the colleague to explain the amount due for a customer.

The additional information is added within a flexibly sized component called the `MoneyBoxInjection`. You can call the InStore `moneyBoxInjection` property at render time.

To display payment details within the **Totals** box, do the following:

1. Follow the steps for overriding the theme and add the following to the `configuration`:

   ```
   Injector.inject({
     tenantId: "a1a1-b2b2-c3c3-d4d4",
     moneyBoxInjection: {
      items: [
        { label: "Shopper due 1000 Loyalty points on checkout", alignment: "center" },
        { type: "divider" },
        { label: "Stored value available to use: £180.50", alignment: "right" },
        { type: "divider" },
        { label: "Price Match Applied:", value: "-£10.00", alignment: "left" },
      ]
     }
   });
   ```

2. For each item in the `items` array, assign one of the following options:

   ```
   {
     "label": "Promo: Buy 1 Get 1 Free!",
     "value": "-£1.00",
     "alignment": "center"
   }
   ```

3. Implement a divider (a horizontal line) by inserting the following text:

   ```
   { "type": "divider" }
   ```

   Use theming described elsewhere in this topic to style line thickness, color, and spacing.

4. Use theming overrides to style the `MoneyBoxInjection` component. For example:
   ```
   MoneyBoxInjection: {
     styleOverrides: {
       root: {
         "&.instore-moneybox-injection": {
           textAlign: themeOptions.defaultTextAlign || "left",
           margin: themeOptions.moneyBoxMargin || "4px 0",
           fontSize: themeOptions.moneyBoxFontSize || "14px",
           color: themeOptions.moneyBoxTextColor || "#000",
           "& .instore-moneybox-item-left": { textAlign: "left" },
           "& .instore-moneybox-item-center": { textAlign: "center" },
           "& .instore-moneybox-item-right": { textAlign: "right" },
           "& .instore-moneybox-separator": {
             borderTop: `1px solid ${themeOptions.moneyBoxSeparatorColor || "rgba(0,0,0,0.3)"}`,
             margin: themeOptions.moneyBoxSeparatorSpacing || "4px 0",
           },
         }
       }
     }
   }
   ```

## Related pages

- [Area overview page with navigation](/instore.md)
- [Previous page: Overview](/instore/customization/override-core-module-styling/overview.md)
- [Next page: Override Refund styling](/instore/customization/override-core-module-styling/refund-styling-overrides.md)
- [Search documentation and API specs](/search.md)