Skip to content

Latest commit

 

History

History
306 lines (211 loc) · 15.6 KB

README.md

File metadata and controls

306 lines (211 loc) · 15.6 KB

CheckoutSDK

(checkout)

Overview

Coming soon - Hosted checkout.

Available Operations

create_checkout

Create a checkout that allows an end user to make a payment on Moov's hosted checkout page.

Example Usage

from moov import Moov
import os

s = Moov(
    gateway_auth=os.getenv("MOOV_GATEWAY_AUTH", ""),
)

res = s.checkout.create_checkout(account_id="46c65cbe-6a25-4fde-a710-624abb99bac0", create_checkout_request={
    "partner_account_id": "e76d386c-3709-47a7-83af-51912a3d5acc",
    "display": {
        "title": "<value>",
        "description": "nerve represent although joyously executor shell",
        "call_to_action": "<value>",
    },
    "transfer": {
        "destination": {
            "payment_method_id": "ec7e1848-dc80-4ab0-8827-dd7fc0737b43",
            "card_details": {
                "dynamic_descriptor": "WhlBdy *Yoga 11-12",
            },
            "ach_details": {
                "company_entry_description": "Gym Dues",
                "originating_company_name": "Whole Body Fit",
            },
        },
        "amount": {
            "currency": "USD",
            "value": 1204,
        },
    },
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
account_id str ✔️ ID of the account.
create_checkout_request models.CreateCheckoutRequest ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CreateCheckoutResponse

Errors

Error Type Status Code Content Type
models.Error1 400 application/json
models.SDKError 4XX, 5XX */*

list_checkouts

List all the checkouts created under a Moov account.

Example Usage

from moov import Moov
import os

s = Moov(
    gateway_auth=os.getenv("MOOV_GATEWAY_AUTH", ""),
)

res = s.checkout.list_checkouts(account_id="6b62cb18-17aa-48ea-be36-e3e245d35b3d")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
account_id str ✔️ ID of the account.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ListCheckoutsResponse

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

get_checkout

Retrieve a checkout by code.

Example Usage

from moov import Moov
import os

s = Moov(
    gateway_auth=os.getenv("MOOV_GATEWAY_AUTH", ""),
)

res = s.checkout.get_checkout(account_id="ecdf464a-abde-493e-8398-3318da6bc559", checkout_code="uc7ZYKrMhi")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
account_id str ✔️ ID of the account.
checkout_code str ✔️ Unique code of the checkout. uc7ZYKrMhi
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.GetCheckoutResponse

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

update_checkout

Update a checkout by code.

Example Usage

from moov import Moov
import os

s = Moov(
    gateway_auth=os.getenv("MOOV_GATEWAY_AUTH", ""),
)

res = s.checkout.update_checkout(account_id="5a2c6478-c2cb-447e-8752-6c84d1002454", checkout_code="uc7ZYKrMhi", update_checkout_request={
    "transfer": {
        "destination": {
            "payment_method_id": "ec7e1848-dc80-4ab0-8827-dd7fc0737b43",
            "card_details": {
                "dynamic_descriptor": "WhlBdy *Yoga 11-12",
            },
            "ach_details": {
                "company_entry_description": "Gym Dues",
                "originating_company_name": "Whole Body Fit",
            },
        },
        "amount": {
            "currency": "USD",
            "value": 1204,
        },
    },
})

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
account_id str ✔️ ID of the account.
checkout_code str ✔️ Unique code of the checkout. uc7ZYKrMhi
update_checkout_request models.UpdateCheckoutRequest ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.UpdateCheckoutResponse

Errors

Error Type Status Code Content Type
models.Error1 400 application/json
models.SDKError 4XX, 5XX */*

disable_checkout

Disable a checkout by code rendering it unusable.

Example Usage

from moov import Moov
import os

s = Moov(
    gateway_auth=os.getenv("MOOV_GATEWAY_AUTH", ""),
)

res = s.checkout.disable_checkout(account_id="9868a400-24d2-4d92-a925-1a7d475b7b57", checkout_code="uc7ZYKrMhi")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
account_id str ✔️ ID of the account.
checkout_code str ✔️ Unique code of the checkout. uc7ZYKrMhi
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.DisableCheckoutResponse

Errors

Error Type Status Code Content Type
models.SDKError 4XX, 5XX */*

get_checkout_qr_code

Retrieve the checkout link encoded in a QR code. Use the Accept header to specify the format of the response. Supported formats are application/json and image/png.

Example Usage

from moov import Moov
import os

s = Moov(
    gateway_auth=os.getenv("MOOV_GATEWAY_AUTH", ""),
)

res = s.checkout.get_checkout_qr_code(account_id="cbf5ab2f-6b53-4023-83de-b2b409367bd0", checkout_code="uc7ZYKrMhi")

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description Example
account_id str ✔️ ID of the account.
checkout_code str ✔️ Unique code of the checkout. uc7ZYKrMhi
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.GetCheckoutQRCodeResponse

Errors

Error Type Status Code Content Type
models.Error1 400, 409 application/json
models.SDKError 4XX, 5XX */*