Skip to content

Commit

Permalink
Minor changes in documentation and removed non implemented functions
Browse files Browse the repository at this point in the history
Removed the non-implemeted functions `capture/3`, `purchase/3`, `refund/3`, `void/2`, `store/2` and `unstore/2`.
  • Loading branch information
xC-Stony committed Mar 21, 2018
1 parent 3607110 commit 0a309f7
Showing 1 changed file with 2 additions and 120 deletions.
122 changes: 2 additions & 120 deletions lib/gringotts/gateways/securion_pay.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ defmodule Gringotts.Gateways.SecurionPay do
## The `opts` argument
Most `Gringotts` API calls accept an optional `keyword` list `opts` to supply
[optional arguments][extra-arg-docs] for transactions with the MONEI
[optional arguments][extra-arg-docs] for transactions with the SecurionPay
gateway. The following keys are supported:
| Key | Remark |
Expand Down Expand Up @@ -59,7 +59,7 @@ defmodule Gringotts.Gateways.SecurionPay do
alias Gringotts.{CreditCard, Response, Address}

@doc """
Authorize a credit card transaction.
Authorizes a credit card transaction.
The authorization validates the `card` details with the banking network,
places a hold on the transaction `amount` in the customer’s issuing bank and
Expand Down Expand Up @@ -118,124 +118,6 @@ defmodule Gringotts.Gateways.SecurionPay do
|> respond
end

@doc """
Captures a pre-authorized `amount`.
`amount` is transferred to the merchant account by SecurionPay used in the
pre-authorization referenced by `payment_id`.
## Note
> If there's anything noteworthy about this operation, it comes here.
> For example, does the gateway support partial, multiple captures?
## Example
> A barebones example using the bindings you've suggested in the `moduledoc`.
"""
@spec capture(String.t(), Money.t(), keyword) :: {:ok | :error, Response}
def capture(payment_id, amount, opts) do
# commit(args, ...)
end

@doc """
Transfers `amount` from the customer to the merchant.
SecurionPay attempts to process a purchase on behalf of the customer, by
debiting `amount` from the customer's account by charging the customer's
`card`.
## Note
> If there's anything noteworthy about this operation, it comes here.
## Example
> A barebones example using the bindings you've suggested in the `moduledoc`.
"""
@spec purchase(Money.t(), CreditCard.t(), keyword) :: {:ok | :error, Response}
def purchase(amount, card = %CreditCard{}, opts) do
# commit(args, ...)
end

@doc """
Voids the referenced payment.
This method attempts a reversal of a previous transaction referenced by
`payment_id`.
> As a consequence, the customer will never see any booking on his statement.
## Note
> Which transactions can be voided?
> Is there a limited time window within which a void can be perfomed?
## Example
> A barebones example using the bindings you've suggested in the `moduledoc`.
"""
@spec void(String.t(), keyword) :: {:ok | :error, Response}
def void(payment_id, opts) do
# commit(args, ...)
end

@doc """
Refunds the `amount` to the customer's account with reference to a prior transfer.
> Refunds are allowed on which kinds of "prior" transactions?
## Note
> The end customer will usually see two bookings/records on his statement. Is
> that true for SecurionPay?
> Is there a limited time window within which a void can be perfomed?
## Example
> A barebones example using the bindings you've suggested in the `moduledoc`.
"""
@spec refund(Money.t(), String.t(), keyword) :: {:ok | :error, Response}
def refund(amount, payment_id, opts) do
# commit(args, ...)
end

@doc """
Stores the payment-source data for later use.
> This usually enable "One Click" and/or "Recurring Payments"
## Note
> If there's anything noteworthy about this operation, it comes here.
## Example
> A barebones example using the bindings you've suggested in the `moduledoc`.
"""
@spec store(CreditCard.t(), keyword) :: {:ok | :error, Response}
def store(%CreditCard{} = card, opts) do
# commit(args, ...)
end

@doc """
Removes card or payment info that was previously `store/2`d
Deletes previously stored payment-source data.
## Note
> If there's anything noteworthy about this operation, it comes here.
## Example
> A barebones example using the bindings you've suggested in the `moduledoc`.
"""
@spec unstore(String.t(), keyword) :: {:ok | :error, Response}
def unstore(registration_id, opts) do
# commit(args, ...)
end

###############################################################################
# PRIVATE METHODS #
###############################################################################
Expand Down

0 comments on commit 0a309f7

Please sign in to comment.