# `Worldpay.Partner.Notifications`
[🔗](https://github.com/iamkanishka/worldpay/blob/v1.0.0/lib/worldpay/access/partner.ex#L130)

Worldpay **Transaction Notification API** — parse partner transaction notifications.

Worldpay sends authorized transaction details to your HTTPS endpoint
for debit, credit, and gift card transactions.

## Setup

Your notification URL is registered with Worldpay IM.
IP whitelist your WAF to allow Worldpay notification IPs.

## Usage

In your webhook controller, parse the incoming notification:

    {:ok, notification} = Worldpay.Partner.Notifications.parse(body)
    notification.transaction_type  # => :credit_sale | :debit_sale | :gift_card | ...
    notification.amount            # => 1999
    notification.approval_number   # => "123456"

# `notification`

```elixir
@type notification() :: %{
  transaction_type: atom(),
  amount: non_neg_integer() | nil,
  approval_number: String.t() | nil,
  card_type: String.t() | nil,
  card_last4: String.t() | nil,
  merchant_id: String.t() | nil,
  terminal_id: String.t() | nil,
  transaction_date: String.t() | nil,
  reference_number: String.t() | nil,
  raw: map()
}
```

# `parse`

```elixir
@spec parse(String.t() | %{required(String.t()) =&gt; term()}) :: {:ok, notification()}
```

Parse a partner transaction notification body.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
