def create_profile_transaction(**kw): """create a new transaction in the user's profile NOTE: The response doesn't conform exactly to the XML output given in the authorize.net documentation. The direct response has been translated into a dictionary. The list of keys is in the source. arguments: REQUIRED: amount: L{float} or L{decimal.Decimal} customer_profile_id: L{unicode} or L{int} customer_payment_profile_id: L{unicode} or L{int} profile_type: L{VOID}, L{AUTH_ONLY}, L{CAPTURE_ONLY}, L{AUTH_CAPTURE}, L{PRIOR_AUTH_CAPTURE}, L{CREDIT} (default AUTH_ONLY) approval_code: L{unicode}, 6 chars authorization code of an original transaction (only for CAPTURE_ONLY) OPTIONAL: tax_amount: tax_name: tax_descr: ship_amount: ship_name: ship_description: duty_amount: duty_name: duty_description: line_items: list of dictionaries with the following arguments: item_id: required name: required description: required quantity: required unit_price: required taxable: customer_address_id: invoice_number: description: purchase_order_number: tax_exempt: L{bool}, default False recurring: L{bool}, default False ccv: """ # This is a work-around to not make the code in gen_xml.py worse # than it already is. Basically no amount is needed in case of a # VOID transaction, but the code in gen_xml.transaction requires # an amount. This should eventually be moved in gen_xml.py. if kw.get('profile_type') == VOID: kw['amount'] = None return 'createCustomerProfileTransactionRequest', kw, xml.transaction(**kw)
def create_profile_transaction(**kw): """create a new transaction in the user's profile NOTE: The response doesn't conform exactly to the XML output given in the authorize.net documentation. The direct response has been translated into a dictionary. The list of keys is in the source. arguments: REQUIRED: amount: L{float} or L{decimal.Decimal} customer_profile_id: L{unicode} or L{int} customer_payment_profile_id: L{unicode} or L{int} profile_type: L{AUTH_ONLY}, L{CAPTURE_ONLY}, L{AUTH_CAPTURE}, L{PRIOR_AUTH_CAPTURE}, L{CREDIT} (default AUTH_ONLY) approval_code: L{unicode}, 6 chars authorization code of an original transaction (only for CAPTURE_ONLY) OPTIONAL: tax_amount: tax_name: tax_descr: ship_amount: ship_name: ship_description: duty_amount: duty_name: duty_description: line_items: list of dictionaries with the following arguments: item_id: required name: required description: required quantity: required unit_price: required taxable: customer_address_id: invoice_number: description: purchase_order_number: tax_exempt: L{bool}, default False recurring: L{bool}, default False ccv: """ return 'createCustomerProfileTransactionRequest', kw, xml.transaction( **kw)
def create_profile_transaction(**kw): """create a new transaction in the user's profile NOTE: The response doesn't conform exactly to the XML output given in the authorize.net documentation. The direct response has been translated into a dictionary. The list of keys is in the source. arguments: REQUIRED: amount: L{float} or L{decimal.Decimal} customer_profile_id: L{unicode} or L{int} customer_payment_profile_id: L{unicode} or L{int} profile_type: L{AUTH_ONLY}, L{CAPTURE_ONLY}, L{AUTH_CAPTURE}, L{PRIOR_AUTH_CAPTURE}, L{CREDIT} (default AUTH_ONLY) approval_code: L{unicode}, 6 chars authorization code of an original transaction (only for CAPTURE_ONLY) OPTIONAL: tax_amount: tax_name: tax_descr: ship_amount: ship_name: ship_description: duty_amount: duty_name: duty_description: line_items: list of dictionaries with the following arguments: item_id: required name: required description: required quantity: required unit_price: required taxable: customer_address_id: invoice_number: description: purchase_order_number: tax_exempt: L{bool}, default False recurring: L{bool}, default False ccv: """ return 'createCustomerProfileTransactionRequest', kw, xml.transaction(**kw)