Skip to content

Latest commit

 

History

History
171 lines (125 loc) · 14.4 KB

File metadata and controls

171 lines (125 loc) · 14.4 KB

PaymentMethods.PaymentServiceTokens

Overview

Available Operations

  • list - List payment service tokens
  • create - Create payment service token
  • delete - Delete payment service token

list

List all gateway tokens stored for a payment method.

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_methods.payment_service_tokens.list(payment_method_id="ef9496d8-53a5-4aad-8ca2-00eb68334389", payment_service_id="fffd152a-9532-4087-9a4f-de58754210f0")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
payment_method_id str ✔️ The ID of the payment method ef9496d8-53a5-4aad-8ca2-00eb68334389
payment_service_id OptionalNullable[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.PaymentServiceTokens

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

Create a gateway tokens for a payment method.

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_methods.payment_service_tokens.create(payment_method_id="ef9496d8-53a5-4aad-8ca2-00eb68334389", payment_service_id="fffd152a-9532-4087-9a4f-de58754210f0", redirect_url="https://example.com/callback")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
payment_method_id str ✔️ The ID of the payment method ef9496d8-53a5-4aad-8ca2-00eb68334389
payment_service_id str ✔️ The ID of the payment method to use. fffd152a-9532-4087-9a4f-de58754210f0
redirect_url str ✔️ The redirect URL to redirect a buyer to after they have authorized the payment method. https://example.com/callback
merchant_account_id Optional[str] The ID of the merchant account to use for this request. default
security_code OptionalNullable[str] The 3 or 4 digit security code often found on the card. This often referred to as the CVV or CVD. 123
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.PaymentServiceToken

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

Delete a gateway tokens for a payment method.

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_methods.payment_service_tokens.delete(payment_method_id="ef9496d8-53a5-4aad-8ca2-00eb68334389", payment_service_token_id="703f2d99-3fd1-44bc-9cbd-a25a2d597886")

    # Use the SDK ...

Parameters

Parameter Type Required Description Example
payment_method_id str ✔️ The ID of the payment method ef9496d8-53a5-4aad-8ca2-00eb68334389
payment_service_token_id str ✔️ The ID of the payment service token 703f2d99-3fd1-44bc-9cbd-a25a2d597886
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 */*