Ejemplo n.º 1
0
    def create_profile(**kw):
        """create a user's profile

        arguments:
            REQUIRED:
                customer_id: L{unicode}

            OPTIONAL or CONDITIONAL:
                payment_profiles: L{list} containing L{dict}:
                    REQUIRED:
                        profile_type: L{CREDIT_CARD} (default) or L{BANK}
                        card_number: L{unicode} or L{int}, required with CREDIT_CARD
                        expiration_date: YYYY-MM, required with CREDIT_CARD
                        routing_number: 9 digits, required with BANK
                        account_number: 5 to 17 digits, required with BANK
                        name_on_account: required with BANK

                    OPTIONAL:
                        customer_type: L{INDIVIDUAL} or L{BUSINESS}
                        bill_first_name:
                        bill_last_name:
                        bill_company:
                        bill_address:
                        bill_city:
                        bill_state:
                        bill_zip:
                        bill_country:
                        bill_phone:
                        bill_fax:
                    all the above arguments can simply be passed
                    as method arguments if you need to create just
                    a single payment profile.

                description:
                email:
                account_type: L{ACCOUNT_CHECKING} or L{ACCOUNT_SAVINGS}
                        or L{ACCOUNT_BUSINESS_CHECKING}, only with BANK
                bank_name:
                ship_first_name:
                ship_last_name:
                ship_company:
                ship_address:
                ship_city:
                ship_state:
                ship_zip:
                ship_country:
                ship_phone:
                ship_fax:
        """
        return ('createCustomerProfileRequest', kw, xml.profile(**kw),
            x.validationMode(kw.get('validation_mode', VALIDATION_NONE)))
Ejemplo n.º 2
0
    def create_profile(**kw):
        """create a user's profile

        arguments:
            REQUIRED:
                customer_id: L{unicode}

            OPTIONAL or CONDITIONAL:
                payment_profiles: L{list} containing L{dict}:
                    REQUIRED:
                        profile_type: L{CREDIT_CARD} (default) or L{BANK}
                        card_number: L{unicode} or L{int}, required with CREDIT_CARD
                        expiration_date: YYYY-MM, required with CREDIT_CARD
                        routing_number: 9 digits, required with BANK
                        account_number: 5 to 17 digits, required with BANK
                        name_on_account: required with BANK

                    OPTIONAL:
                        customer_type: L{INDIVIDUAL} or L{BUSINESS}
                        bill_first_name:
                        bill_last_name:
                        bill_company:
                        bill_address:
                        bill_city:
                        bill_state:
                        bill_zip:
                        bill_country:
                        bill_phone:
                        bill_fax:
                    all the above arguments can simply be passed
                    as method arguments if you need to create just
                    a single payment profile.

                description:
                email:
                account_type: L{ACCOUNT_CHECKING} or L{ACCOUNT_SAVINGS}
                        or L{ACCOUNT_BUSINESS_CHECKING}, only with BANK
                bank_name:
                ship_first_name:
                ship_last_name:
                ship_company:
                ship_address:
                ship_city:
                ship_state:
                ship_zip:
                ship_country:
                ship_phone:
                ship_fax:
        """
        return ('createCustomerProfileRequest', kw, xml.profile(**kw),
                x.validationMode(kw.get('validation_mode', VALIDATION_NONE)))
Ejemplo n.º 3
0
    def validate_payment_profile(**kw):
        """validate a user's payment profile

        arguments:
            customer_profile_id: required
            customer_payment_profile_id: required
            customer_address_id: required
            validation_mode: L{VALIDATION_TEST} or L{VALIDATION_LIVE} or L{VALIDATION_NONE}, default L{VALIDATION_NONE}
        """
        return ('validateCustomerPaymentProfileRequest', kw,
                x.customerProfileId(kw['customer_profile_id']),
                x.customerPaymentProfileId(kw['customer_payment_profile_id']),
                x.customerShippingAddressId(kw['customer_address_id']),
                x.validationMode(kw.get('validation_mode', VALIDATION_NONE)))
Ejemplo n.º 4
0
    def validate_payment_profile(**kw):
        """validate a user's payment profile

        arguments:
            customer_profile_id: required
            customer_payment_profile_id: required
            customer_address_id: required
            validation_mode: L{VALIDATION_TEST} or L{VALIDATION_LIVE} or L{VALIDATION_NONE}, default L{VALIDATION_NONE}
        """
        return ('validateCustomerPaymentProfileRequest', kw,
            x.customerProfileId(kw['customer_profile_id']),
            x.customerPaymentProfileId(kw['customer_payment_profile_id']),
            x.customerShippingAddressId(kw.get('customer_address_id')),
            x.validationMode(kw.get('validation_mode', VALIDATION_NONE))
        )
Ejemplo n.º 5
0
    def create_payment_profile(**kw):
        """add to a user's profile a new payment profile

        arguments:
            REQUIRED:
                customer_profile_id: L{unicode} or L{int}
                all the arguments for payment_profiles (above) should
                    be provided as arguments to this method call
                validation_mode: L{VALIDATION_TEST}, L{VALIDATION_LIVE}, L{VALIDATION_NONE},
                    the different level of validation will try to run and immediately
                    void 0.01 transactions on live or test environment, L{VALIDATION_NONE}
                    will skip this test. By default it's L{VALIDATION_NONE}
        """
        return ('createCustomerPaymentProfileRequest', kw,
            x.customerProfileId(kw['customer_profile_id']),
            xml.paymentProfile(**kw),
            x.validationMode(kw.get('validation_mode', VALIDATION_NONE)) # none, testMode, liveMode
        )
Ejemplo n.º 6
0
    def create_payment_profile(**kw):
        """add to a user's profile a new payment profile

        arguments:
            REQUIRED:
                customer_profile_id: L{unicode} or L{int}
                all the arguments for payment_profiles (above) should
                    be provided as arguments to this method call
                validation_mode: L{VALIDATION_TEST}, L{VALIDATION_LIVE}, L{VALIDATION_NONE},
                    the different level of validation will try to run and immediately
                    void 0.01 transactions on live or test environment, L{VALIDATION_NONE}
                    will skip this test. By default it's L{VALIDATION_NONE}
        """
        return (
            'createCustomerPaymentProfileRequest',
            kw,
            x.customerProfileId(kw['customer_profile_id']),
            xml.paymentProfile(**kw),
            x.validationMode(
                kw.get('validation_mode',
                       VALIDATION_NONE))  # none, testMode, liveMode
        )