PayPal.Payments.Orders (pay_pal v0.0.7)
Documentation for PayPal.Payments.Orders
Summary
Functions
@spec authorize(String.t(), map()) :: {:ok, map() | :not_found | :no_content | nil} | {:error, :unauthorised | :bad_network | any()}
Authorize an order
Possible returns:
{:ok, refund}
{:error, refund}
Examples
iex> PayPal.Payments.Orders.authorize(order_id, %{
amount: %{
total: "1.50",
currency: "USD"
}
})
@spec capture(String.t(), map()) :: {:ok, map() | :not_found | :no_content} | {:error, :unauthorised | :bad_network | any()}
Capture an order
Possible returns:
{:ok, capture}
{:error, refund}
Examples
iex> PayPal.Payments.Orders.capture(order_id, %{
amount: %{
total: "1.50",
currency: "USD"
},
is_final_capture: true
})
@spec show(String.t()) :: {:ok, map() | :not_found | :no_content} | {:error, :unauthorised | :bad_network | any()}
Show an order
Possible returns:
{:ok, order}
{:error, reason}
Examples
iex> PayPal.Payments.Orders.show(order_id)
@spec void(String.t()) :: {:ok, map() | :not_found | :no_content} | {:error, :unauthorised | :bad_network | any()}
Void an order
Possible returns:
{:ok, order}
{:error, reason}
Examples
iex> PayPal.Payments.Orders.void(order_id)