Exemple #1
0
def withdraw(bank_account_id, params, connect_key=None):
    if not bank_account_id or not params:
        raise error.InvalidRequestError(
            "Bank account id and params cannot be empty", 400)
    return api_resource.post(
        params, '{}/{}/withdraw'.format(RESOURCE_URL, bank_account_id),
        connect_key)
Exemple #2
0
def authorize(charge_id, auth_code):
    if not charge_id:
        raise error.InvalidRequestError("Charge id cannot be empty", 400)
    if not auth_code:
        raise error.InvalidRequestError("auth_code cannot be empty", 400)

    params = {'auth_code': auth_code}
    return api_resource.post(params, '{}/{}/authorize'.format(RESOURCE_URL, charge_id), None)
Exemple #3
0
def set_default(card_id, user_api_token):
    if not card_id:
        raise error.InvalidRequestError("Card id cannot be empty", 400)
    if not user_api_token:
        raise error.InvalidRequestError("user_api_token cannot be empty", 400)
    params = {'user_api_token': user_api_token}
    return api_resource.post(params,
                             '{}/{}/set_default'.format(RESOURCE_URL,
                                                        card_id), None)
Exemple #4
0
def cancel(charge_id, connect_key=None):
    if not charge_id:
        raise error.InvalidRequestError("Charge id cannot be empty", 400)
    return api_resource.post(None, '{}/{}/cancel'.format(RESOURCE_URL, charge_id), connect_key)
Exemple #5
0
def validate(charge_id, params, connect_key=None):
    if not charge_id:
        raise error.InvalidRequestError("Charge id cannot be empty", 400)
    return api_resource.post(params, '{}/{}/validate'.format(RESOURCE_URL, charge_id), connect_key)
Exemple #6
0
def create(params, connect_key=None):
    if not params:
        raise error.InvalidRequestError("Params cannot be empty", 400)
    return api_resource.post(params, RESOURCE_URL, connect_key)
Exemple #7
0
def authorize(params, connect_key=None):
    if not params:
        raise error.InvalidRequestError("Params cannot be empty", 400)
    return api_resource.post(params, '{}/signup_login'.format(RESOURCE_URL),
                             connect_key)
Exemple #8
0
def charge_existing(card_id):
    if not card_id:
        raise error.InvalidRequestError("Card id cannot be empty", 400)
    params = {'txn_id': card_id}
    return api_resource.post(params, '/credit_card_charges/charge_card', None)
Exemple #9
0
def charge_guest(params):
    if not params:
        raise error.InvalidRequestError("Params cannot be empty", 400)
    return api_resource.post(params, '/credit_card_charges/charge_card_guest',
                             None)
Exemple #10
0
def add(params):
    if not params:
        raise error.InvalidRequestError("Params cannot be empty", 400)
    return api_resource.post(params, RESOURCE_URL, None)