示例#1
0
def subscribe(
    *,
    url: str,
    app_token: Optional[str] = None,
    api_key: Optional[str] = None,
    session: Optional[ApiSession] = None,
) -> SubscribeResponse:
    """
    Subscribes to payment request related notifications. One payment
    request subscription can be active at a time. When this request
    is repeated, the existing payment request subscription is
    overwritten. The application must have payment request permission
    to complete this request.

    https://developer.abnamro.com/api-products/tikkie/reference-documentation#tag/Payment-request-notification

    :param url: URL where notifications must be sent using a webhook or callback.
    :param app_token: The App Token generated in the Tikkie Business Portal.
    :param api_key: The API Key obtained from the ABN developer portal.
    :param session: An optional API session class. If not passed the global API session will be used
    """
    s = session if session else get_session()
    payload = {"url": url}

    response = s.post(
        "paymentrequestssubscription",
        json=payload,
        app_token=app_token,
        api_key=api_key,
    )
    return SubscribeResponse.parse_raw(response.content)
示例#2
0
def get_payment(
    *,
    qr_id: str,
    payment_token: str,
    app_token: Optional[str] = None,
    api_key: Optional[str] = None,
    session: Optional[ApiSession] = None,
) -> IdealQrPayment:
    """
    Retrieves details of a specific payment made against a specific
    iDeal QR based on the token and ID value. The application must
    have iDeal QR permission to complete this request.

    https://developer.abnamro.com/api-products/tikkie/reference-documentation#operation/getIDealQRPayment

    :param qr_id: Number of the page to be returned.
    :param payment_token: Number of items on a page.
    :param app_token: The App Token generated in the Tikkie Business Portal.
    :param api_key: The API Key obtained from the ABN developer portal.
    :param session: An optional API session class. If not passed the global API session will be used
    """
    s = session if session else get_session()
    response = s.get(
        f"idealqrs/{qr_id}/payments/{payment_token}",
        app_token=app_token,
        api_key=api_key,
    )
    return IdealQrPayment.parse_raw(response.content)
示例#3
0
def get(
    payment_request_token: str,
    payment_token: str,
    app_token: Optional[str] = None,
    api_key: Optional[str] = None,
    session: Optional[ApiSession] = None,
) -> Payment:
    """
    Retrieves details of a specific payment made against a specific payment request based on the value of the tokens.
    The application must have payment request permission to complete this request.

    https://developer.abnamro.com/api-products/tikkie/reference-documentation#operation/getPayment

    :param payment_request_token: Token identifying the payment request.
    :param payment_token: Token identifying one payment of a payment request
    :param app_token: The App Token generated in the Tikkie Business Portal.
    :param api_key: The API Key obtained from the ABN developer portal.
    :param session: An optional API session class. If not passed the global API session will be used
    """
    s = session if session else get_session()
    response = s.get(
        f"paymentrequests/{payment_request_token}/payments/{payment_token}",
        app_token=app_token,
        api_key=api_key,
    )
    return Payment.parse_raw(response.content)
def get(
    bundle_id: str,
    app_token: Optional[str] = None,
    api_key: Optional[str] = None,
    session: Optional[ApiSession] = None,
) -> Bundle:
    """
    Retrieves a specific bundle based on a bundle identifier. The
    application must have transactions permission to complete this
    request.

    https://developer.abnamro.com/api-products/tikkie/reference-documentation#operation/getBundle

    :param bundle_id: Identifier for the bundle.
    :param app_token: The App Token generated in the Tikkie Business Portal.
    :param api_key: The API Key obtained from the ABN developer portal.
    :param session: An optional API session class. If not passed the global API session will be used
    """
    s = session if session else get_session()
    response = s.get(
        f"transactionbundles/{bundle_id}",
        app_token=app_token,
        api_key=api_key,
    )
    return Bundle.parse_raw(response.content)
示例#5
0
def create_changeable(
    *,
    description: str,
    expiry_date_time: datetime,
    max_amount_in_cents: int,
    reference_id: str = None,
    single_pay: bool = None,
    image_size: int = None,
    min_amount_in_cents: int = None,
    app_token: Optional[str] = None,
    api_key: Optional[str] = None,
    session: Optional[ApiSession] = None,
) -> IdealQr:
    """
    https://developer.abnamro.com/api-products/tikkie/reference-documentation#tag/iDeal-QR

    :param description: Description of the iDeal QR request, which the payer or payers see.
    :param expiry_date_time: The date and time at which the iDeal QR expires and can no longer be paid. The expiration is accurate up to minutes.
    :param max_amount_in_cents: The maximum amount the user can enter for the iDeal QR.
    :param reference_id: ID for the reference of the API consumer.
    :param single_pay: Indicates whether the iDeal QR can be paid once, or multiple times.
    :param image_size: Size of the QR code image in pixels. It can be between 100 and 2000 pixels inclusive.
    :param min_amount_in_cents: The minimum amount the user can enter for the iDeal QR.
    :param app_token: The App Token generated in the Tikkie Business Portal.
    :param api_key: The API Key obtained from the ABN developer portal.
    :param session: An optional API session class. If not passed the global API session will be used
    """
    s = session if session else get_session()
    payload = {
        "description": description,
        "expiryDateTime": format_datetime(expiry_date_time),
        "amountChangeable": True,
        "maxAmountInCents": max_amount_in_cents,
    }
    if reference_id is not None:
        payload["referenceId"] = reference_id
    if single_pay is not None:
        payload["singlePay"] = single_pay
    if image_size is not None:
        payload["imageSize"] = image_size
    if expiry_date_time is not None:
        payload["expiryDateTime"] = format_datetime(expiry_date_time)
    if min_amount_in_cents is not None:
        payload["minAmountInCents"] = min_amount_in_cents

    response = s.post("idealqrs",
                      app_token=app_token,
                      api_key=api_key,
                      json=payload)
    return IdealQr.parse_raw(response.content)
示例#6
0
def delete(
    app_token: Optional[str] = None,
    api_key: Optional[str] = None,
    session: Optional[ApiSession] = None,
) -> None:
    """
    Deletes a subscription. The application must have iDeal QR
    permission to complete this request.

    :param app_token: The App Token generated in the Tikkie Business Portal.
    :param api_key: The API Key obtained from the ABN developer portal.
    :param session: An optional API session class. If not passed the global API session will be used

    https://developer.abnamro.com/api-products/tikkie/reference-documentation#operation/deleteIDealQRNotifications
    """
    s = session if session else get_session()
    s.delete("idealqrssubscription", app_token=app_token, api_key=api_key)
示例#7
0
def create(
    *,
    payment_request_token: str,
    payment_token: str,
    description: str,
    amount_in_cents: int,
    reference_id: Optional[str] = None,
    app_token: Optional[str] = None,
    api_key: Optional[str] = None,
    session: Optional[ApiSession] = None,
) -> Refund:
    """
    Creates a refund for a specific payment

    The maximum amount which can be refunded for a payment is the
    amount paid plus €25.00. The application must have payment request
    permission and the refund permission to complete this request.

    https://developer.abnamro.com/api-products/tikkie/reference-documentation#tag/Refund

    :param payment_request_token: Token identifying the payment request.
    :param payment_token: Token identifying one payment of a payment request
    :param description: Description of the payment request, which the payer or payers see.
    :param amount_in_cents: Amount in cents of the payment request (euros). If this value is not specified, an open payment request is created.
    :param reference_id: ID for the reference of the API consumer.
    :param app_token: The App Token generated in the Tikkie Business Portal.
    :param api_key: The API Key obtained from the ABN developer portal.
    :param session: An optional API session class. If not passed the global API session will be used
    """
    s = session if session else get_session()
    payload = {
        "description": description,
        "amountInCents": amount_in_cents,
    }
    if reference_id is not None:
        payload["referenceId"] = reference_id

    response = s.post(
        f"paymentrequests/{payment_request_token}/payments/{payment_token}/refunds",
        json=payload,
        app_token=app_token,
        api_key=api_key,
    )
    return Refund.parse_raw(response.content)
示例#8
0
def get_all_payments(
    *,
    qr_id: str,
    page_size: int,
    page_number: int,
    from_date_time: Optional[datetime] = None,
    to_date_time: Optional[datetime] = None,
    app_token: Optional[str] = None,
    api_key: Optional[str] = None,
    session: Optional[ApiSession] = None,
) -> GetAllIdealQrPaymentsResponse:
    """
    Retrieves payments made against a specific iDeal QR based on the
    parameters provided. The application must have iDeal QR
    permission to complete this request.

    https://developer.abnamro.com/api-products/tikkie/reference-documentation#operation/getIDealQR

    :param page_size: Number of the page to be returned.
    :param page_number: Number of items on a page.
    :param from_date_time:The time you start searching for items. Refers to the creation date for payment requests and iDeal QRs, and refers to the bundle date for transaction bundles.
    :param to_date_time: The time you stop searching for items. Refers to the creation date for payment requests and iDeal QRs, and refers to the bundle date for transaction bundles.
    :param app_token: The App Token generated in the Tikkie Business Portal.
    :param api_key: The API Key obtained from the ABN developer portal.
    :param session: An optional API session class. If not passed the global API session will be used
    """
    s = session if session else get_session()
    params: JsonDict = {
        "pageSize": page_size,
        "pageNumber": page_number,
    }
    if from_date_time is not None:
        params["fromDateTime"] = from_date_time
    if to_date_time is not None:
        params["toDateTime"] = to_date_time

    response = s.get(
        f"idealqrs/{qr_id}/payments",
        params=params,
        app_token=app_token,
        api_key=api_key,
    )
    return GetAllIdealQrPaymentsResponse.parse_raw(response.content)
示例#9
0
def get(
    *,
    qr_id: str,
    app_token: Optional[str] = None,
    api_key: Optional[str] = None,
    session: Optional[ApiSession] = None,
) -> IdealQr:
    """
    Retrieves a specific iDeal QR based on a token value. The
    application must have iDeal QR permission to complete this
    request.

    :param qr_id: Identifier for iDeal QR.
    :param app_token: The App Token generated in the Tikkie Business Portal.
    :param api_key: The API Key obtained from the ABN developer portal.
    :param session: An optional API session class. If not passed the global API session will be used

    https://developer.abnamro.com/api-products/tikkie/reference-documentation#operation/createPaymentRequest
    """
    s = session if session else get_session()
    response = s.get(f"idealqrs/{qr_id}", app_token=app_token, api_key=api_key)
    return IdealQr.parse_raw(response.content)
示例#10
0
def create_application(
    app_token: Optional[str] = None,
    api_key: Optional[str] = None,
    session: Optional[ApiSession] = None,
) -> CreateSandboxApplicationResponse:
    """
    Creates an app in the sandbox for you to use with this API. This
    operation does not work in the production environment.

    https://developer.abnamro.com/api-products/tikkie/reference-documentation#tag/Sandbox-app

    :param app_token: The App Token generated in the Tikkie Business Portal.
    :param api_key: The API Key obtained from the ABN developer portal.
    :param session: An optional API session class. If not passed the global API session will be used
    """
    s = session if session else get_session()
    response = s.post(
        "sandboxapps",
        app_token=app_token,
        api_key=api_key,
    )
    return CreateSandboxApplicationResponse.parse_raw(response.content)