Skip to content

Latest commit

 

History

History
435 lines (327 loc) · 52.7 KB

File metadata and controls

435 lines (327 loc) · 52.7 KB

PaymentServices

Overview

Available Operations

  • list - List payment services
  • create - Configure a payment service
  • get - Get payment service
  • update - Update a configured payment service
  • delete - Delete a configured payment service
  • verify - Verify payment service credentials
  • session - Create a session for a payment service definition

list

List the configured payment services.

Example Usage

from gr4vy import Gr4vy
import os


with Gr4vy(
    merchant_account_id="default",
    bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""),
) as g_client:

    res = g_client.payment_services.list(cursor="ZXhhbXBsZTE", limit=20, deleted=True)

    while res is not None:
        # Handle items

        res = res.next()

Parameters

Parameter Type Required Description Example
method OptionalNullable[models.Method] Return any payment service for this method.
cursor OptionalNullable[str] A pointer to the page of results to return. ZXhhbXBsZTE
limit Optional[int] The maximum number of items that are at returned. 20
deleted OptionalNullable[bool] Return any deleted payment service. true
merchant_account_id Optional[str] The ID of the merchant account to use for this request. default
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ListPaymentServicesResponse

Errors

Error Type Status Code Content Type
errors.Error400 400 application/json
errors.Error401 401 application/json
errors.Error403 403 application/json
errors.Error404 404 application/json
errors.Error405 405 application/json
errors.Error409 409 application/json
errors.HTTPValidationError 422 application/json
errors.Error425 425 application/json
errors.Error429 429 application/json
errors.Error500 500 application/json
errors.Error502 502 application/json
errors.Error504 504 application/json
errors.APIError 4XX, 5XX */*

create

Configures a new payment service for use by merchants.

Example Usage

from gr4vy import Gr4vy
import os


with Gr4vy(
    merchant_account_id="default",
    bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""),
) as g_client:

    res = g_client.payment_services.create(display_name="Stripe", payment_service_definition_id="stripe-card", fields=[
        {
            "key": "api_key",
            "value": "key-12345",
        },
    ], accepted_currencies=[
        "USD",
        "EUR",
        "GBP",
    ], accepted_countries=[
        "US",
        "DE",
        "GB",
    ], three_d_secure_enabled=True, settlement_reporting_enabled=True)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
display_name str ✔️ The display name for the payment service. Stripe
payment_service_definition_id str ✔️ The definition ID of the service to configure. stripe-card
fields List[models.FieldT] ✔️ The non-secret credential fields that have been configured for this payment service. Any secret fields are omitted.
accepted_currencies List[str] ✔️ A list of currencies for which this service is enabled, in ISO 4217 three-letter code format. [
"USD",
"EUR",
"GBP"
]
accepted_countries List[str] ✔️ A list of countries for which this service is enabled, in ISO two-letter code format. [
"US",
"DE",
"GB"
]
merchant_account_id Optional[str] The ID of the merchant account to use for this request. default
reporting_fields List[models.FieldT] The non-secret reporting fields that have been configured for this payment service. Any secret fields are omitted.
position OptionalNullable[int] Deprecated field used to define the order in which to process payment services 1
active OptionalNullable[bool] Defines if this payment service is currently active. Example 1: true
Example 2: false
three_d_secure_enabled Optional[bool] Defines if this payment service has 3DS enabled. true
merchant_profile Dict[str, Nullable[models.MerchantProfileScheme]] An object containing a key for each supported card schemes, and for each key an object with the 3DS profile for this service for that scheme.
payment_method_tokenization_enabled OptionalNullable[bool] Defines if this payment service support payment method tokenization. true
network_tokens_enabled OptionalNullable[bool] Defines if this payment service supports network tokens. true
open_loop OptionalNullable[bool] Defines if this payment service is open loop. true
settlement_reporting_enabled Optional[bool] Defines if this payment service has settlement reporting enabled. true
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.PaymentService

Errors

Error Type Status Code Content Type
errors.Error400 400 application/json
errors.Error401 401 application/json
errors.Error403 403 application/json
errors.Error404 404 application/json
errors.Error405 405 application/json
errors.Error409 409 application/json
errors.HTTPValidationError 422 application/json
errors.Error425 425 application/json
errors.Error429 429 application/json
errors.Error500 500 application/json
errors.Error502 502 application/json
errors.Error504 504 application/json
errors.APIError 4XX, 5XX */*

get

Get the details of a configured payment service.

Example Usage

from gr4vy import Gr4vy
import os


with Gr4vy(
    merchant_account_id="default",
    bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""),
) as g_client:

    res = g_client.payment_services.get(payment_service_id="fffd152a-9532-4087-9a4f-de58754210f0")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
payment_service_id str ✔️ the ID of the payment service fffd152a-9532-4087-9a4f-de58754210f0
merchant_account_id Optional[str] The ID of the merchant account to use for this request. default
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.PaymentService

Errors

Error Type Status Code Content Type
errors.Error400 400 application/json
errors.Error401 401 application/json
errors.Error403 403 application/json
errors.Error404 404 application/json
errors.Error405 405 application/json
errors.Error409 409 application/json
errors.HTTPValidationError 422 application/json
errors.Error425 425 application/json
errors.Error429 429 application/json
errors.Error500 500 application/json
errors.Error502 502 application/json
errors.Error504 504 application/json
errors.APIError 4XX, 5XX */*

update

Updates the configuration of a payment service.

Example Usage

from gr4vy import Gr4vy
import os


with Gr4vy(
    merchant_account_id="default",
    bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""),
) as g_client:

    res = g_client.payment_services.update(payment_service_id="fffd152a-9532-4087-9a4f-de58754210f0", settlement_reporting_enabled=True)

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
payment_service_id str ✔️ the ID of the payment service fffd152a-9532-4087-9a4f-de58754210f0
merchant_account_id Optional[str] The ID of the merchant account to use for this request. default
display_name OptionalNullable[str] The display name for the payment service. Stripe
fields List[models.VoidableField] The non-secret credential fields that have been configured for this payment service. Any secret fields are omitted.
reporting_fields List[models.VoidableField] The non-secret reporting fields that have been configured for this payment service. Any secret fields are omitted.
position OptionalNullable[int] Deprecated field used to define the order in which to process payment services 1
accepted_currencies List[str] A list of currencies for which this service is enabled, in ISO 4217 three-letter code format. [
"USD",
"EUR",
"GBP"
]
accepted_countries List[str] A list of countries for which this service is enabled, in ISO two-letter code format. [
"US",
"DE",
"GB"
]
active OptionalNullable[bool] Defines if this payment service is currently active. Example 1: true
Example 2: false
three_d_secure_enabled OptionalNullable[bool] Defines if this payment service has 3DS enabled. true
merchant_profile Dict[str, Nullable[models.MerchantProfileScheme]] An object containing a key for each supported card schemes, and for each key an object with the 3DS profile for this service for that scheme.
payment_method_tokenization_enabled OptionalNullable[bool] Defines if this payment service support payment method tokenization. true
network_tokens_enabled OptionalNullable[bool] Defines if this payment service supports network tokens. true
open_loop OptionalNullable[bool] Defines if this payment service is open loop. true
settlement_reporting_enabled Optional[bool] Defines if this payment service has settlement reporting enabled. true
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.PaymentService

Errors

Error Type Status Code Content Type
errors.Error400 400 application/json
errors.Error401 401 application/json
errors.Error403 403 application/json
errors.Error404 404 application/json
errors.Error405 405 application/json
errors.Error409 409 application/json
errors.HTTPValidationError 422 application/json
errors.Error425 425 application/json
errors.Error429 429 application/json
errors.Error500 500 application/json
errors.Error502 502 application/json
errors.Error504 504 application/json
errors.APIError 4XX, 5XX */*

delete

Deletes all the configuration of a payment service.

Example Usage

from gr4vy import Gr4vy
import os


with Gr4vy(
    merchant_account_id="default",
    bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""),
) as g_client:

    g_client.payment_services.delete(payment_service_id="fffd152a-9532-4087-9a4f-de58754210f0")

    # Use the SDK ...

Parameters

Parameter Type Required Description Example
payment_service_id str ✔️ the ID of the payment service fffd152a-9532-4087-9a4f-de58754210f0
merchant_account_id Optional[str] The ID of the merchant account to use for this request. default
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Errors

Error Type Status Code Content Type
errors.Error400 400 application/json
errors.Error401 401 application/json
errors.Error403 403 application/json
errors.Error404 404 application/json
errors.Error405 405 application/json
errors.Error409 409 application/json
errors.HTTPValidationError 422 application/json
errors.Error425 425 application/json
errors.Error429 429 application/json
errors.Error500 500 application/json
errors.Error502 502 application/json
errors.Error504 504 application/json
errors.APIError 4XX, 5XX */*

verify

Verify the credentials of a configured payment service

Example Usage

from gr4vy import Gr4vy
import os


with Gr4vy(
    merchant_account_id="default",
    bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""),
) as g_client:

    res = g_client.payment_services.verify(payment_service_definition_id="stripe-card", fields=[])

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
payment_service_definition_id str ✔️ The ID of the payment service definition to verify the fields against stripe-card
fields List[models.FieldT] ✔️ The fields and their values, or a set of updated fields to merge with existing values.
merchant_account_id Optional[str] The ID of the merchant account to use for this request. default
payment_service_id OptionalNullable[str] The optional ID of the configured payment service. New fields will be merged with any existing fields already stored before they are verified. fffd152a-9532-4087-9a4f-de58754210f0
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

Any

Errors

Error Type Status Code Content Type
errors.Error400 400 application/json
errors.Error401 401 application/json
errors.Error403 403 application/json
errors.Error404 404 application/json
errors.Error405 405 application/json
errors.Error409 409 application/json
errors.HTTPValidationError 422 application/json
errors.Error425 425 application/json
errors.Error429 429 application/json
errors.Error500 500 application/json
errors.Error502 502 application/json
errors.Error504 504 application/json
errors.APIError 4XX, 5XX */*

session

Creates a session for a payment service that supports sessions.

Example Usage

from gr4vy import Gr4vy
import os


with Gr4vy(
    merchant_account_id="default",
    bearer_auth=os.getenv("GR4VY_BEARER_AUTH", ""),
) as g_client:

    res = g_client.payment_services.session(payment_service_id="fffd152a-9532-4087-9a4f-de58754210f0", request_body={

    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
payment_service_id str ✔️ the ID of the payment service fffd152a-9532-4087-9a4f-de58754210f0
request_body Dict[str, Any] ✔️ N/A
merchant_account_id Optional[str] The ID of the merchant account to use for this request. default
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.CreateSession

Errors

Error Type Status Code Content Type
errors.Error400 400 application/json
errors.Error401 401 application/json
errors.Error403 403 application/json
errors.Error404 404 application/json
errors.Error405 405 application/json
errors.Error409 409 application/json
errors.HTTPValidationError 422 application/json
errors.Error425 425 application/json
errors.Error429 429 application/json
errors.Error500 500 application/json
errors.Error502 502 application/json
errors.Error504 504 application/json
errors.APIError 4XX, 5XX */*