PayPal.Payments.Orders (pay_pal v0.0.7)

Documentation for PayPal.Payments.Orders

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

Summary

Functions

Authorize an order

Capture an order

Show an order

Void an order

Functions

authorize(payment_id, params)

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

Authorize an order

docs

Possible returns:

  • {:ok, refund}

  • {:error, refund}

Examples

iex> PayPal.Payments.Orders.authorize(order_id, %{

amount: %{
  total: "1.50",
  currency: "USD"
}

})

capture(order_id, params)

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

Capture an order

docs

Possible returns:

  • {:ok, capture}

  • {:error, refund}

Examples

iex> PayPal.Payments.Orders.capture(order_id, %{

amount: %{
  total: "1.50",
  currency: "USD"
},
is_final_capture: true

})

show(order_id)

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

Show an order

docs

Possible returns:

  • {:ok, order}

  • {:error, reason}

Examples

iex> PayPal.Payments.Orders.show(order_id)

void(order_id)

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

Void an order

docs

Possible returns:

  • {:ok, order}

  • {:error, reason}

Examples

iex> PayPal.Payments.Orders.void(order_id)