Skip to content

Latest commit

 

History

History
324 lines (226 loc) · 23.9 KB

README.md

File metadata and controls

324 lines (226 loc) · 23.9 KB

ApplePay

(apple_pay)

Overview

Available Operations

Any domains that will be used to accept payments must first be verified with Apple.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/apple-pay.write scope.

Any domains that will be used to accept payments must first be verified with Apple.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/apple-pay.write scope.

Read our Apple Pay tutorial to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/apple-pay.read scope.

  • create_session - Create a session with Apple Pay to facilitate a payment.

Read our Apple Pay tutorial to learn more. A successful response from this endpoint should be passed through to Apple Pay unchanged.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/apple-pay.write scope.

  • link_token - Connect an Apple Pay token to the specified account.

Read our Apple Pay tutorial to learn more. The token data is defined by Apple Pay and should be passed through from Apple Pay's response unmodified.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.write scope.

register_merchant_domains

Add domains to be registered with Apple Pay.

Any domains that will be used to accept payments must first be verified with Apple.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/apple-pay.write scope.

Example Usage

from moovio_sdk import Moov
from moovio_sdk.models import components


with Moov(
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

    res = moov.apple_pay.register_merchant_domains(account_id="c62b8770-bdbc-406f-8160-fddb553f5b33", domains=[
        "checkout.classbooker.dev",
    ])

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
account_id str ✔️ ID of the Moov account representing the merchant.
display_name Optional[str] A UTF-8 string to display in the Buy button.
domains List[str] A unique list of fully-qualified, top-level or sub-domain names where you will accept Apple Pay. [
"checkout.classbooker.dev"
]
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.RegisterApplePayMerchantDomainsResponse

Errors

Error Type Status Code Content Type
errors.GenericError 400 application/json
errors.APIError 4XX, 5XX */*

update_merchant_domains

Add or remove domains to be registered with Apple Pay.

Any domains that will be used to accept payments must first be verified with Apple.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/apple-pay.write scope.

Example Usage

from moovio_sdk import Moov
from moovio_sdk.models import components


with Moov(
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

    res = moov.apple_pay.update_merchant_domains(account_id="4dfea880-7ff8-42f8-bc8d-392cba179113", add_domains=[
        "pay.classbooker.dev",
    ], remove_domains=[
        "checkout.classbooker.dev",
    ])

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
account_id str ✔️ ID of the Moov account representing the merchant.
add_domains List[str] A unique list of fully-qualified, top-level or sub-domain names to add. [
"pay.classbooker.dev"
]
remove_domains List[str] A unique list of fully-qualified, top-level or sub-domain names to remove. [
"checkout.classbooker.dev"
]
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.UpdateApplePayMerchantDomainsResponse

Errors

Error Type Status Code Content Type
errors.GenericError 400 application/json
errors.APIError 4XX, 5XX */*

get_merchant_domains

Get domains registered with Apple Pay.

Read our Apple Pay tutorial to learn more.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/apple-pay.read scope.

Example Usage

from moovio_sdk import Moov
from moovio_sdk.models import components


with Moov(
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

    res = moov.apple_pay.get_merchant_domains(account_id="5f873241-11ec-45e4-929d-00a704a9b582")

    # Handle response
    print(res)

Parameters

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

Response

operations.GetApplePayMerchantDomainsResponse

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

create_session

Create a session with Apple Pay to facilitate a payment.

Read our Apple Pay tutorial to learn more. A successful response from this endpoint should be passed through to Apple Pay unchanged.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/apple-pay.write scope.

Example Usage

from moovio_sdk import Moov
from moovio_sdk.models import components


with Moov(
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

    res = moov.apple_pay.create_session(account_id="7f4bef45-927c-48cf-9312-d337467ac9fb", domain="checkout.classbooker.dev", display_name="Kaylee40")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
account_id str ✔️ ID of the Moov account representing the merchant.
domain str ✔️ A fully qualified top-level or sub-domain name where you will accept Apple Pay. Should not include "https". checkout.classbooker.dev
display_name str ✔️ A UTF-8 string to display in the Buy button.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CreateApplePaySessionResponse

Errors

Error Type Status Code Content Type
errors.GenericError 400, 409, 422 application/json
errors.APIError 4XX, 5XX */*

link_token

Connect an Apple Pay token to the specified account.

Read our Apple Pay tutorial to learn more. The token data is defined by Apple Pay and should be passed through from Apple Pay's response unmodified.

To access this endpoint using an access token you'll need to specify the /accounts/{accountID}/cards.write scope.

Example Usage

from moovio_sdk import Moov
from moovio_sdk.models import components


with Moov(
    security=components.Security(
        username="",
        password="",
    ),
) as moov:

    res = moov.apple_pay.link_token(account_id="3f415d64-c57f-409e-80d0-cb8bd8246ace", token={
        "payment_data": {
            "version": "EC_v1",
            "data": "3+f4oOTwPa6f1UZ6tG...CE=",
            "signature": "MIAGCSqGSIb3DQ.AAAA==",
            "header": {
                "ephemeral_public_key": "MFkwEK...Md==",
                "public_key_hash": "l0CnXdMv...D1I=",
                "transaction_id": "32b...4f3",
            },
        },
        "payment_method": {
            "display_name": "Visa 1234",
            "network": "Visa",
            "type": "debit",
        },
        "transaction_identifier": "32b...4f3",
    }, billing_contact={
        "address_lines": [
            "123 Sesame Street",
        ],
        "locality": "Phoenix",
        "postal_code": "30345",
        "administrative_area": "AZ",
        "country_code": "US",
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
account_id str ✔️ ID of the Moov account representing the cardholder.
token components.LinkApplePayToken ✔️ Contains the user's payment information as returned from Apple Pay.

Refer to Apple's documentation
for more information.
billing_contact Optional[components.AppleBillingContact] Billing contact information as returned from Apple Pay.

Refer to Apple's documentation
for more information.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.LinkApplePayTokenResponse

Errors

Error Type Status Code Content Type
errors.GenericError 400, 409 application/json
errors.LinkApplePayError 422 application/json
errors.APIError 4XX, 5XX */*