Skip to content

Latest commit

 

History

History
398 lines (334 loc) · 20.5 KB

CustomerPaymentMethodService.md

File metadata and controls

398 lines (334 loc) · 20.5 KB

CustomerPaymentMethodService

A list of all methods in the CustomerPaymentMethodService service. Click on the method name to view detailed information about that method.

Methods Description
get_customer_payment_methods Retrieve payment methods for a customer
create_customer_payment_method Add a payment method to a customer profile
get_customer_payment_method Retrieve a payment method for a specific customer
update_customer_payment_method Change or modify a payment method that was stored in a customer profile
delete_customer_payment_method This method triggers the Webhook - Payment Method Canceled webhook. This webhook contains more information than the response.

get_customer_payment_methods

Retrieve payment methods for a customer

  • HTTP Method: GET
  • Endpoint: /v1/customers/{customerId}/payment_methods

Parameters

Name Type Required Description
customer_id str customer Id
access_key str Unique access key provided by Rapyd for each authorized user.
content_type str Indicates that the data appears in JSON format. Set to application/json.
salt str Random string. Recommended length: 8-16 characters.
signature str Signature calculated for each request individually. See Request Signatures.
timestamp str Timestamp for the request, in Unix time (seconds).
category Category
starting_after str The ID of the coupon created before the first coupon you want to retrieve
ending_before str The ID of the coupon created after the last coupon you want to retrieve
limit str The maximum number of coupons to return. Range is 1-100. Default is 10
type_ str The type of payment method to find.
idempotency str A unique key that prevents the platform from creating the same object twice.

Return Type

InlineResponse200_41

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment
from rapyd_sdk.models import Category

sdk = RapydSdk(
    base_url=Environment.DEFAULT.value,
    timeout=10000
)

result = sdk.customer_payment_method.get_customer_payment_methods(
    customer_id="customerId",
    access_key="access_key",
    content_type="Content-Type",
    salt="salt",
    signature="signature",
    timestamp="timestamp",
    category="bank",
    starting_after="starting_after",
    ending_before="ending_before",
    limit="limit",
    type_="type",
    idempotency="idempotency"
)

print(result)

create_customer_payment_method

Add a payment method to a customer profile

  • HTTP Method: POST
  • Endpoint: /v1/customers/{customerId}/payment_methods

Parameters

Name Type Required Description
request_body CustomerIdPaymentMethodsBody The request body.
customer_id str customer Id
access_key str Unique access key provided by Rapyd for each authorized user.
content_type str Indicates that the data appears in JSON format. Set to application/json.
salt str Random string. Recommended length: 8-16 characters.
signature str Signature calculated for each request individually. See Request Signatures.
timestamp str Timestamp for the request, in Unix time (seconds).
idempotency str A unique key that prevents the platform from creating the same object twice.

Return Type

InlineResponse200_42

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment
from rapyd_sdk.models import CustomerIdPaymentMethodsBody

sdk = RapydSdk(
    base_url=Environment.DEFAULT.value,
    timeout=10000
)

request_body = CustomerIdPaymentMethodsBody(
    data={
        "amount_range_per_currency": [
            {
                "maximum_amount": 8.08,
                "minimum_amount": 2.44,
                "currency": "GBP"
            }
        ],
        "category": "bank",
        "country": "GB",
        "currencies": [
            "GBP"
        ],
        "fields": [
            {
                "code": "code",
                "is_required": True,
                "is_updatable": True,
                "instructions": "instructions",
                "name": "name",
                "numeric_code": "numeric_code",
                "required_fields": [
                    {
                        "code": "code",
                        "is_required": True,
                        "is_updatable": True,
                        "instructions": "instructions",
                        "name": "name",
                        "numeric_code": "numeric_code",
                        "type_": "boolean",
                        "regex": "regex",
                        "conditions": [
                            {
                                "description": "description",
                                "element_name": "element_name",
                                "operator": "operator",
                                "threshold_value": "sed inc"
                            }
                        ],
                        "description": "description"
                    }
                ],
                "type_": "boolean",
                "regex": "regex",
                "conditions": [
                    {
                        "description": "description",
                        "element_name": "element_name",
                        "operator": "operator",
                        "threshold_value": "sed inc"
                    }
                ],
                "description": "description"
            }
        ],
        "image": "image",
        "is_cancelable": True,
        "is_expirable": True,
        "is_online": False,
        "is_refundable": True,
        "is_tokenizable": True,
        "is_virtual": False,
        "maximum_expiration_seconds": 7.15,
        "minimum_expiration_seconds": 9.02,
        "multiple_overage_allowed": False,
        "name": "name",
        "payment_flow_type": "direct",
        "payment_options": [
            {
                "code": "code",
                "is_required": True,
                "is_updatable": True,
                "instructions": "instructions",
                "name": "name",
                "numeric_code": "numeric_code",
                "required_fields": [
                    {
                        "code": "code",
                        "is_required": True,
                        "is_updatable": True,
                        "instructions": "instructions",
                        "name": "name",
                        "numeric_code": "numeric_code",
                        "type_": "boolean",
                        "regex": "regex",
                        "conditions": [
                            {
                                "description": "description",
                                "element_name": "element_name",
                                "operator": "operator",
                                "threshold_value": "sed inc"
                            }
                        ],
                        "description": "description"
                    }
                ],
                "type_": "boolean",
                "regex": "regex",
                "conditions": [
                    {
                        "description": "description",
                        "element_name": "element_name",
                        "operator": "operator",
                        "threshold_value": "sed inc"
                    }
                ],
                "description": "description"
            }
        ],
        "status": "status",
        "supported_digital_wallet_providers": [
            "supported_digital_wallet_providers"
        ],
        "type_": "type",
        "virtual_payment_method_type": "virtual_payment_method_type",
        "is_restricted": False,
        "supports_subscription": False
    }
)

result = sdk.customer_payment_method.create_customer_payment_method(
    request_body=request_body,
    customer_id="customerId",
    access_key="access_key",
    content_type="Content-Type",
    salt="salt",
    signature="signature",
    timestamp="timestamp",
    idempotency="idempotency"
)

print(result)

get_customer_payment_method

Retrieve a payment method for a specific customer

  • HTTP Method: GET
  • Endpoint: /v1/customers/{customerId}/payment_methods/{pmtId}

Parameters

Name Type Required Description
customer_id str customer Id
pmt_id str Pmt Id
access_key str Unique access key provided by Rapyd for each authorized user.
content_type str Indicates that the data appears in JSON format. Set to application/json.
salt str Random string. Recommended length: 8-16 characters.
signature str Signature calculated for each request individually. See Request Signatures.
timestamp str Timestamp for the request, in Unix time (seconds).
idempotency str A unique key that prevents the platform from creating the same object twice.

Return Type

InlineResponse200_42

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment

sdk = RapydSdk(
    base_url=Environment.DEFAULT.value,
    timeout=10000
)

result = sdk.customer_payment_method.get_customer_payment_method(
    customer_id="customerId",
    pmt_id="pmtId",
    access_key="access_key",
    content_type="Content-Type",
    salt="salt",
    signature="signature",
    timestamp="timestamp",
    idempotency="idempotency"
)

print(result)

update_customer_payment_method

Change or modify a payment method that was stored in a customer profile

  • HTTP Method: POST
  • Endpoint: /v1/customers/{customerId}/payment_methods/{pmtId}

Parameters

Name Type Required Description
request_body CustomerPaymentMethod The request body.
customer_id str customer Id
pmt_id str Pmt Id
access_key str Unique access key provided by Rapyd for each authorized user.
content_type str Indicates that the data appears in JSON format. Set to application/json.
salt str Random string. Recommended length: 8-16 characters.
signature str Signature calculated for each request individually. See Request Signatures.
timestamp str Timestamp for the request, in Unix time (seconds).
idempotency str A unique key that prevents the platform from creating the same object twice.

Return Type

InlineResponse200_42

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment
from rapyd_sdk.models.customer_payment_method import CustomerPaymentMethod1

sdk = RapydSdk(
    base_url=Environment.DEFAULT.value,
    timeout=10000
)

request_body = CustomerPaymentMethod1(
    bic_swift="12345678XXX",
    account_last4="account_last4",
    id_="id",
    type_="type",
    category="bank",
    metadata={},
    image="image",
    webhook_url="webhook_url",
    supporting_documentation="supporting_documentation",
    next_action="3d_verification"
)

result = sdk.customer_payment_method.update_customer_payment_method(
    request_body=request_body,
    customer_id="customerId",
    pmt_id="pmtId",
    access_key="access_key",
    content_type="Content-Type",
    salt="salt",
    signature="signature",
    timestamp="timestamp",
    idempotency="idempotency"
)

print(result)

delete_customer_payment_method

This method triggers the Webhook - Payment Method Canceled webhook. This webhook contains more information than the response.

  • HTTP Method: DELETE
  • Endpoint: /v1/customers/{customerId}/payment_methods/{pmtId}

Parameters

Name Type Required Description
customer_id str customer Id
pmt_id str Pmt Id
access_key str Unique access key provided by Rapyd for each authorized user.
content_type str Indicates that the data appears in JSON format. Set to application/json.
salt str Random string. Recommended length: 8-16 characters.
signature str Signature calculated for each request individually. See Request Signatures.
timestamp str Timestamp for the request, in Unix time (seconds).
idempotency str A unique key that prevents the platform from creating the same object twice.

Return Type

InlineResponse200_43

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment

sdk = RapydSdk(
    base_url=Environment.DEFAULT.value,
    timeout=10000
)

result = sdk.customer_payment_method.delete_customer_payment_method(
    customer_id="customerId",
    pmt_id="pmtId",
    access_key="access_key",
    content_type="Content-Type",
    salt="salt",
    signature="signature",
    timestamp="timestamp",
    idempotency="idempotency"
)

print(result)