# give/4.18.0/src/PaymentGateways/Gateways/Offline/resources/formBuilder/addOfflineAttributes.ts

GiveWP – Donation Plugin and Fundraising Platform, version 4.18.0. 32 lines.

- Page: https://pluginprobe.com/plugins/give/4.18.0/code/src/PaymentGateways/Gateways/Offline/resources/formBuilder/addOfflineAttributes.ts
- Raw: https://pluginprobe.com/plugins/give/4.18.0/raw/src/PaymentGateways/Gateways/Offline/resources/formBuilder/addOfflineAttributes.ts
- Modified: 2023-10-16T17:55:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.18.0/code/src/PaymentGateways/Gateways/Offline/resources/formBuilder/addOfflineAttributes.ts#L10-L20`.

```typescript
declare const window: {
    giveOfflineGatewaySettings: {
        defaultInstructions: string;
    };
} & Window;

export const offlineAttributes = {
    offlineEnabled: {
        type: 'boolean',
        default: true,
    },
    offlineUseGlobalInstructions: {
        type: 'boolean',
        default: true,
    },
    offlineDonationInstructions: {
        type: 'string',
        default: window.giveOfflineGatewaySettings.defaultInstructions,
    },
};

export default function addAttribute(settings, name) {
    if (name === 'givewp/payment-gateways') {
        settings.attributes = {
            ...settings.attributes,
            offlineAttributes,
        };
    }

    return settings;
}

```
