CheckoutSdk (CheckoutSDK v0.1.1)
Documentation for CheckoutSdk
.
Link to this section Summary
Link to this section Functions
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{}}
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"}}
create_instrument(params)
https://api-reference.checkout.com/#operation/createAnInstrument
## Examples
iex> CheckoutSdk.create_instrument(%{type: "token", token: "tok_qwznocrsf56e3cb5kjsnqif2pe"})
{: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{}}
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"}
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"}
get_customer_details(id)
https://api-reference.checkout.com/#operation/getCustomerDetails
## Examples
iex> CheckoutSdk.get_customer_details("cus_zmcfxfdhec2udpilxpjyb5daue")
{:ok, %Customers.Customer{}}
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{}}
get_payment_details(payment_id)
https://api-reference.checkout.com/#operation/getPaymentDetails
## Examples
iex> CheckoutSdk.get_payment_details("pay_dw4eiq6hfuhulhaagvvd7ytnnq")
{:ok, "details"}
get_payment_list(reference, opts \\ %{})
https://api-reference.checkout.com/#tag/Payments/paths/~1payments/get
## Examples
iex> CheckoutSdk.get_payment_list("pay_qzf4qcix7ezurgmdwai5w65oy4")
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
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"}
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{}}
void_payment(params)
https://api-reference.checkout.com/#operation/voidAPayment
## Examples
iex> CheckoutSdk.void_payment(%{id: "pay_dw4eiq6hfuhulhaagvvd7ytnnq"})
{:ok, "voided_payment"}