CheckoutSdk (CheckoutSDK v0.1.0)

Documentation for CheckoutSdk.

Link to this section Summary

Link to this section Functions

Link to this function

capture_payment(params)

https://api-reference.checkout.com/#operation/captureAPayment

## Examples

iex> CheckoutSdk.capture_payment(%{id: "pay_qzf4qcix7ezurgmdwai5w65oy4", amount: 100, reference: "reference"})
{:ok, %Responses.PaymentCapture{}}
Link to this function

create_customer(params)

https://api-reference.checkout.com/#operation/createCustomer

## Examples

iex> CheckoutSdk.create_customer(%{email: "tiberious_kirk1@gmail.com", name: "Tiberious Kirk"})
{:ok, %{id: "cus_sobjzu2jtgvurgnslxtjfdoh6u"}}
Link to this function

create_instrument(params)

https://api-reference.checkout.com/#operation/createAnInstrument

## Examples

iex> CheckoutSdk.create_instrument(%{type: "token", token: "tok_hblh3ceyhygenhqmypki3kiyxu"})
{:ok, %Responses.Instruments.CreateCard{}}

iex> CheckoutSdk.create_instrument(%{type: "bank_account", currency: "USD", country: "US", bank_code: "something here", account_type:  "cash"})
{:ok, %Responses.Instruments.CreateBankAccount{}}
Link to this function

delete_customer(id)

https://api-reference.checkout.com/#tag/Customers/paths/~1customers~1%7Bidentifier%7D/delete

## Examples

iex> CheckoutSdk.delete_customer("cus_zmcfxfdhec2udpilxpjyb5daue")
{:ok, "cus_dcpwo7ypgfzefcxsvukpl235d4 was deleted sucessfully"}
Link to this function

delete_instrument(id)

https://api-reference.checkout.com/#tag/Instruments/paths/~1instruments~1%7Bid%7D/delete

## Examples

iex> CheckoutSdk.delete_instrument("src_blvzu7xtwqcunjhs7k3smgbgii")
{:ok, "src_gwvz3x2q7zcubduwa73nuwoyoi was deleted sucessfully"}
Link to this function

get_customer_details(id)

https://api-reference.checkout.com/#operation/getCustomerDetails

## Examples

iex> CheckoutSdk.get_customer_details("cus_zmcfxfdhec2udpilxpjyb5daue")
{:ok, %Customers.Customer{}}
Link to this function

get_instrument_details(id)

https://api-reference.checkout.com/#operation/getInstrumentDetails

## Examples

iex> CheckoutSdk.get_instrument_details("src_yvqm6xgmiiouje5ysca25qkc5a")
{:ok, %Responses.Instruments.CardDetails{}}

iex> CheckoutSdk.get_instrument_details("src_yf7cb7y3cvmehg5frazq32sdyq")
{:ok, %Responses.Instruments.BankAccountDetails{}}
Link to this function

get_payment_details(payment_id)

https://api-reference.checkout.com/#operation/getPaymentDetails

## Examples

iex> CheckoutSdk.get_payment_details("pay_dw4eiq6hfuhulhaagvvd7ytnnq")
{:ok, "details"}
Link to this function

get_payment_list(reference, opts \\ %{})

https://api-reference.checkout.com/#tag/Payments/paths/~1payments/get

## Examples

iex> CheckoutSdk.get_payment_list("pay_qzf4qcix7ezurgmdwai5w65oy4")
Link to this function

request_payment_or_payout(params)

https://api-reference.checkout.com/#operation/requestAPaymentOrPayout

## Examples

iex> payment_params = %{
...>         type: "payment_payout",
...>         source: %{
...>           type: "id",
...>           id: "src_lni6s3c2ra4ufcgnyr7vbidz2u"
...>         },
...>         capture: false,
...>         currency: "USD",
...>         amount: 100,
...>         processing_channel_id: "pc_iiacs2ehunsu3d6inimxkvhlia"
...>       }
iex> CheckoutSdk.request_payment_or_payout(payment_params)
{:ok, %Responses.Payment{}}

CardPayout and BankPayout Requests are not working need to be configured with Checkout.com
Link to this function

update_customer(params)

https://api-reference.checkout.com/#tag/Customers/paths/~1customers~1%7Bidentifier%7D/patch

## Examples

iex> CheckoutSdk.update_customer(%{id: "cus_zmcfxfdhec2udpilxpjyb5daue", name: "Iwatski Yuko"})
{:ok, "update successful"}
Link to this function

update_instrument(params)

https://api-reference.checkout.com/#tag/Instruments/paths/~1instruments~1%7Bid%7D/patch

## Examples

iex> CheckoutSdk.update_instrument(%{type: "card", id: "src_blvzu7xtwqcunjhs7k3smgbgii", name: "Tiberous Kirk"})
{:ok, %Responses.Instruments.Update{}}

iex> CheckoutSdk.update_instrument(%{type: "bank_account", id: "src_bjmpkcgyfmie3drnxrtuaw6qsa", bank_code: "something"})
{:ok, %Responses.Instruments.Update{}}
Link to this function

void_payment(params)

https://api-reference.checkout.com/#operation/voidAPayment

## Examples

iex> CheckoutSdk.void_payment(%{id: "pay_dw4eiq6hfuhulhaagvvd7ytnnq"})
{:ok, "voided_payment"}