PayPal.Payments.Authorizations (pay_pal v0.0.7)

Documentation for PayPal.Payments.Authorizations

https://developer.paypal.com/docs/api/payments/#authorization

Summary

Functions

Capture an authorization

Show an authorization

Void an authorization

Functions

capture(authorization_id, params)

@spec capture(String.t(), map()) ::
  {:ok, map() | :not_found | :no_content | nil}
  | {:error, :unauthorised | :bad_network | any()}

Capture an authorization

docs

Possible returns:

  • {:ok, capture}

  • {:error, reason}

Examples

iex> PayPal.Payments.Authorizations.capture(authorization_id, %{

amount: %{
  currency: "USD",
  amount: "4.54"
},
is_final_capture: true

})

reauthorize(authorization_id, params)

@spec reauthorize(String.t(), map()) ::
  {:ok, map() | :not_found | :no_content | nil}
  | {:error, :unauthorised | :bad_network | any()}

Reauthorize a payment

docs

Possible returns:

  • {:ok, authorization}

  • {:error, reason}

Examples

iex> PayPal.Payments.Authorizations.capture(authorization_id, %{

amount: %{
  currency: "USD",
  amount: "4.54"
}

})

show(authorization_id)

@spec show(String.t()) ::
  {:ok, map() | :not_found | :no_content}
  | {:error, :unauthorised | :bad_network | any()}

Show an authorization

docs

Possible returns:

  • {:ok, authorization}

  • {:error, reason}

Examples

iex> PayPal.Payments.Authorizations.show(authorization_id)

void(authorization_id)

@spec void(String.t()) ::
  {:ok, map() | :not_found | :no_content | nil}
  | {:error, :unauthorised | :bad_network | any()}

Void an authorization

docs

Possible returns:

  • {:ok, authorization}

  • {:error, reason}

Examples

iex> PayPal.Payments.Authorizations.void(authorization_id)