Paypal.Payment (Paypal v0.2.0)

Copy Markdown View Source

Perform payment actions for PayPal. Payments are authorized orders or captures.

Official PayPal API Documentation: PayPal Payments API v2

Summary

Functions

Capture an authorized payment.

Refund a captured payment by capture ID.

Show information about an authorized payment.

Void an authorized payment. This cancels or releases the authorized funds.

Functions

capture(id)

@spec capture(String.t()) ::
  {:ok, Paypal.Payment.Captured.t()}
  | {:error, Paypal.Common.Error.t() | term()}

Capture an authorized payment.

Official documentation: Capture Authorized Payment

refund(id, body \\ %{})

@spec refund(String.t(), map()) ::
  {:ok, Paypal.Payment.Refund.t()} | {:error, Paypal.Common.Error.t() | term()}

Refund a captured payment by capture ID.

Official documentation: Refund Captured Payment

show(id)

@spec show(String.t()) ::
  {:ok, Paypal.Payment.Info.t()} | {:error, Paypal.Common.Error.t() | term()}

Show information about an authorized payment.

Official documentation: Show Details for Authorized Payment

void(id)

@spec void(String.t()) :: :ok | {:error, Paypal.Common.Error.t() | term()}

Void an authorized payment. This cancels or releases the authorized funds.

Official documentation: Void Authorized Payment