# AccountCreditRequest

## Program ID

MetraPipeline.AccountCreditRequestPlugin.1

## Description

Used to meter subscriber-based credit request. Does following before WriteProductView is executed:

- Evaluates if correct status string is being metered (only PENDING).

- Look if request amount qualifies for auto credit (this condition is set in config.xml for this plugin).

- If request qualifies for auto credit, set status to APPROVED, credit amount to request amount and meter AccountCredit session.

- Returns after execution.

## Required Input Properties

Tag name | Value type | Description
_AccountID | long | 123 is always meter (to solve the problem with displaying credit request across usage interval)
_Amount | decimal | Credit Request Amount
_Currency | string | Credit Request currency
Reason | string | Reason for Request TODO: To be later changed to ENUM
Status | string | Always PENDING, otherwise will be rejected
Description | string | Additional request comments
SubscriberAccountID | long | Actual requester’s account id

## Required Output Properties

Tag name | Value type | Description
Auto | STRING | If request qualifies for an automatic credit, this flag is set to “Y”, otherwise always “N”
Status | STRING | If request qualifies for an automatic credit, this field is set to “APPROVED”, otherwise stays “PENDING”
CreditAmount | decimal | If request qualifies for an automatic credit, this field is set to _Amount, otherwise 0

## Additional Configuration Tags

None.

## Configuration Example

<configdata>
<Auto>Auto</Auto>
<_AccountID>_AccountID</_AccountID>
<_Amount>_Amount</_Amount>
<_Currency>_Currency</_Currency>
<Reason>Reason</Reason>
<Status>Status</Status>
<Description>Description</Description>
<CreditAmount>CreditAmount</CreditAmount>
<SubscriberAccountID>SubscriberAccountID</SubscriberAccountID>
</configdata>