<commit_before>Balanced
--------

Payments platform for online marketplaces


Authentication
``````````````

::

    import balanced
    key = balanced.APIKey().save()
    balanced.configure(key.secret)


Create a buyer
``````````````

::

    from balanced import Account

    buyer = Account(
        name='<NAME>',  # Optional
        email_address='<EMAIL>',
        credit_card={
            'name': '<NAME>',  # Optional
            'card_number': '4111111111111111',
            'expiration_month': 4,
            'expiration_year': 2014,
            'security_code': '807',  # Optional
            'street_address': '167 West 74th Street',  # Optional
            'postal_code': '10023',  # Optional
            'country_code': 'USA',  # Default
            'phone_number': '+16505551234'  # Optional
        }
    ).save()


Debit a buyer
`````````````

::

    buyer.debit(
        20000,
        appears_on_statement_as='example.com'  # Default: marketplace domain
        description='Beat by Dr. Dre'  # Optional
    )


Create a merchant (individual person)
`````````````````````````````````````

::

    from balanced import Account

    merchant = Account(
        name='<NAME>',  # Optional
        email_address='<EMAIL>',
        merchant={
            'type': 'person',
            'name': '<NAME>',
            'tax_id': '393483992',  # SSN in the US
            'street_address': '167 West 74th Street',  # Home address
            'postal_code': '10023',
            'dob': '1842-01',  # YYYY-MM
            'phone_number': '+16505551234',
        },
        bank_account={  # Optional
            'name': '<NAME>',
            'account_number': '28304871049',
            'bank_code': '121042882'  # Routing number in the US
        }
    )


Create a merchant (Business)
`````````````````````````````

::

    from balanced import Account

    merchant = Account(
        name='<NAME>',  # Optional
        email_address='<EMAIL>',
        merchant={<commit_msg>minor updates<commit_after>Balanced
--------

Payments platform for online marketplaces


Authentication
``````````````

::

    import balanced
    key = balanced.APIKey().save()
    balanced.configure(key.secret)


Create a marketplace
````````````````````
You have to create a marketplace before creating accounts to
debit and credit.

::

    Marketplace().save()


Create a buyer
``````````````

::

    from balanced import Account

    buyer = Account(
        name='<NAME>',  # Optional
        email_address='<EMAIL>',
        card={
            'name': '<NAME>',  # Optional
            'card_number': '4111111111111111',
            'expiration_month': 4,
            'expiration_year': 2014,
            'security_code': '807',  # Optional
            'street_address': '167 West 74th Street',  # Optional
            'postal_code': '10023',  # Optional
            'country_code': 'USA',  # Default
            'phone_number': '+16505551234'  # Optional
        }
    ).save()


Debit a buyer
`````````````

::

    debit = buyer.debit(
        20000,
        appears_on_statement_as='example.com'  # Default: marketplace domain
        description='Beat by Dr. Dre'  # Optional
    )


Refund a debit
``````````````

::

    debit.refund()



Create a merchant (individual person)
`````````````````````````````````````

::

    from balanced import Account

    merchant = Account(
        name='<NAME>',  # Optional
        email_address='<EMAIL>',
        merchant={
            'type': 'person',
            'name': '<NAME>',
            'tax_id': '393483992',  # SSN in the US
            'street_address': '167 West 74th Street',  # Home address
            'postal_code': '10023',
            'dob': '1842-01',  # YYYY-MM
            'phone_number': '+16505551234',
        },
        bank_account={  # Optional
            'name': '<NAME>',
            'account_number': '28304871049',
            'bank_code': '121042882'  # Routing number in the US
        }
    ).save()


Create a merchant (Business)
`````````````````````````````

::

    from balanced import Account

    merchant = Account(
        name='<NAME>',  # Optional
        email_address='<EMAIL>',
        merchant={
{'fraction_non_alphanumeric': 0.1786736641221374, 'fraction_numerical': 0.05057251908396947, 'mean_word_length': 2.1813353566009104, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6756519', 'n_tokens_mistral': 1458, 'n_tokens_neox': 1243, 'n_words': 289}