### Install Buckaroo SDK Source: https://github.com/buckaroo-it/buckaroosdk_python/blob/master/README.md Install the Buckaroo SDK using pip. This is the recommended method for adding the library to your project. ```bash pip install buckaroo-sdk ``` -------------------------------- ### Import Buckaroo Client Source: https://github.com/buckaroo-it/buckaroosdk_python/blob/master/README.md Import the necessary Buckaroo client class into your Python project after installation. ```python from buckaroo import BuckarooClient ``` -------------------------------- ### Configure Buckaroo Client Source: https://github.com/buckaroo-it/buckaroosdk_python/blob/master/README.md Create and configure the Buckaroo client instance with your store and secret keys. Use 'test' mode for development and 'live' for production. ```python from buckaroo import BuckarooClient from buckaroo.services.payment_service import PaymentService # Get your store & secret key in your plaza. # mode="test" routes calls to the test environment; use "live" for production. client = BuckarooClient("STORE_KEY", "SECRET_KEY", mode="test") payments = PaymentService(client) ``` -------------------------------- ### Create Payment using Fluent Interface Source: https://github.com/buckaroo-it/buckaroosdk_python/blob/master/README.md Utilize the fluent interface for creating payments, chaining method calls to set payment details like currency, amount, and invoice number before initiating the payment. ```python response = ( payments.create_payment("creditcard") .currency("EUR") .amount(10.00) .invoice("UNIQUE-INVOICE-NO") .pay() ) ``` -------------------------------- ### Create Credit Card Payment Source: https://github.com/buckaroo-it/buckaroosdk_python/blob/master/README.md Create a credit card payment by specifying currency, amount, invoice number, and service parameters like the card brand. The response object can be inspected for success or failure. ```python # Create a new payment response = ( payments.create_payment("creditcard", { "currency": "EUR", "amount": 10.00, # The amount we want to charge "invoice": "UNIQUE-INVOICE-NO", # Each payment must contain a unique invoice number "service_parameters": {"brand": "visa"}, # Request to pay with Visa }) .description("Order #UNIQUE-INVOICE-NO") .pay() ) # Inspect the response from Buckaroo if response.is_successful(): print("transaction id:", response.get_transaction_id()) print("redirect:", response.get_redirect_url()) else: print("status message:", response.get_message()) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.