def bank_slip(self, **kwargs): fields = ( ('processor_id', {'translated_name': 'processorID'}), ('reference_num', {'translated_name': 'referenceNum'}), ('ip_address', {'translated_name': 'ipAddress', 'required': False}), ('billing_name', {'translated_name': 'billing/name'}), ('billing_address', {'translated_name': 'billing/address', 'required': False}), ('billing_address2', {'translated_name': 'billing/address2', 'required': False}), ('billing_city', {'translated_name': 'billing/city', 'required': False}), ('billing_state', {'translated_name': 'billing/state', 'required': False}), ('billing_postalcode', {'translated_name': 'billing/postalcode', 'required': False}), ('billing_country', {'translated_name': 'billing/country', 'required': False}), ('billing_phone', {'translated_name': 'billing/phone', 'required': False}), ('billing_email', {'translated_name': 'billing/email', 'required': False}), ('shipping_name', {'translated_name': 'shipping/name', 'required': False}), ('shipping_address', {'translated_name': 'shipping/address', 'required': False}), ('shipping_address2', {'translated_name': 'shipping/address2', 'required': False}), ('shipping_city', {'translated_name': 'shipping/city', 'required': False}), ('shipping_state', {'translated_name': 'shipping/state', 'required': False}), ('shipping_postalcode', {'translated_name': 'shipping/postalcode', 'required': False}), ('shipping_country', {'translated_name': 'shipping/country', 'required': False}), ('shipping_phone', {'translated_name': 'shipping/phone', 'required': False}), ('shipping_email', {'translated_name': 'shipping/email', 'required': False}), ('expiration_date', {'translated_name': 'transactionDetail/payType/boleto/expirationDate'}), ('number', {'translated_name': 'transactionDetail/payType/boleto/number'}), ('instructions', {'translated_name': 'transactionDetail/payType/boleto/instructions', 'required': False}), ('charge_total', {'translated_name': 'payment/chargeTotal'}), ) requester = PaymentRequester(fields, kwargs) return self.send(command='sale', requester=requester, resource=PaymentResource)
def cancel(self, **kwargs): fields = (('transaction_id', {'translated_name': 'transactionID'}), ) requester = PaymentRequester(fields, kwargs) return self.send(command='void', requester=requester, resource=PaymentResource)
def chargeback(self, **kwargs): fields = ( ('order_id', {'translated_name': 'orderID'}), ('reference_num', {'translated_name': 'referenceNum'}), ('charge_total', {'translated_name': 'payment/chargeTotal'}), ) requester = PaymentRequester(fields, kwargs) return self.send(command='return', requester=requester, resource=PaymentResource)
def capture(self, **kwargs): fields = ( ('order_id', {'translated_name': 'orderID'}), ('reference_num', {'translated_name': 'referenceNum'}), ('ip_address', {'translated_name': 'ipAddress', 'required': False}), ('charge_total', {'translated_name': 'payment/chargeTotal'}), ) requester = PaymentRequester(fields, kwargs) return self.send(command='capture', requester=requester, resource=PaymentResource)
def get_fraud_check_iframe(self, **kwargs): fields = ( ('order_id', {}), ) requester = PaymentRequester(fields, kwargs) params = { 'm': self.maxid, 's': requester.cleaned_data.get('order_id'), 'h': md5('{0}*{1}'.format(self.maxid, requester.cleaned_data.get('order_id'))).hexdigest() } url = 'https://testauthentication.maxipago.net/redirection_service/logo?{0}'.format(urlencode(params)) return '<iframe width="1" height="1" frameborder="0" src="{0}"></iframe>'.format(url)
def direct(self, **kwargs): fields = ( ('processor_id', {'translated_name': 'processorID'}), ('reference_num', {'translated_name': 'referenceNum'}), ('fraud_check', {'translated_name': 'fraudCheck', 'required': False}), ('ip_address', {'translated_name': 'ipAddress', 'required': False}), ('billing_name', {'translated_name': 'billing/name', 'required': False}), ('billing_address', {'translated_name': 'billing/address', 'required': False}), ('billing_address2', {'translated_name': 'billing/address2', 'required': False}), ('billing_city', {'translated_name': 'billing/city', 'required': False}), ('billing_state', {'translated_name': 'billing/state', 'required': False}), ('billing_postalcode', {'translated_name': 'billing/postalcode', 'required': False}), ('billing_country', {'translated_name': 'billing/country', 'required': False}), ('billing_phone', {'translated_name': 'billing/phone', 'required': False}), ('billing_email', {'translated_name': 'billing/email', 'required': False}), ('shipping_name', {'translated_name': 'shipping/name', 'required': False}), ('shipping_address', {'translated_name': 'shipping/address', 'required': False}), ('shipping_address2', {'translated_name': 'shipping/address2', 'required': False}), ('shipping_city', {'translated_name': 'shipping/city', 'required': False}), ('shipping_state', {'translated_name': 'shipping/state', 'required': False}), ('shipping_postalcode', {'translated_name': 'shipping/postalcode', 'required': False}), ('shipping_country', {'translated_name': 'shipping/country', 'required': False}), ('shipping_phone', {'translated_name': 'shipping/phone', 'required': False}), ('shipping_email', {'translated_name': 'shipping/email', 'required': False}), ('card_number', {'translated_name': 'transactionDetail/payType/creditCard/number', 'required': False}), ('card_expiration_month', {'translated_name': 'transactionDetail/payType/creditCard/expMonth', 'required': False}), ('card_expiration_year', {'translated_name': 'transactionDetail/payType/creditCard/expYear', 'required': False}), ('card_cvv', {'translated_name': 'transactionDetail/payType/creditCard/cvvNumber', 'required': False}), ('customer_id', {'translated_name': 'transactionDetail/payType/onFile/customerId', 'required': False}), ('token', {'translated_name': 'transactionDetail/payType/onFile/token', 'required': False}), ('charge_total', {'translated_name': 'payment/chargeTotal'}), ('installments', {'translated_name': 'payment/creditInstallment/numberOfInstallments', 'required': False}), ('installments_interest', {'translated_name': 'payment/creditInstallment/chargeInterest', 'required': False}), ) requester = PaymentRequester(fields, kwargs) return self.send(command='sale', requester=requester, resource=PaymentResource)
def bank_slip(self, **kwargs): fields = ( ('processor_id', { 'translated_name': 'processorID' }), ('reference_num', { 'translated_name': 'referenceNum' }), ('customerid_ext', { 'translated_name': 'customerIdExt' }), ('ip_address', { 'translated_name': 'ipAddress', 'required': False }), ('billing_name', { 'translated_name': 'billing/name' }), ('billing_address', { 'translated_name': 'billing/address', 'required': False }), ('billing_address2', { 'translated_name': 'billing/address2', 'required': False }), ('billing_city', { 'translated_name': 'billing/city', 'required': False }), ('billing_state', { 'translated_name': 'billing/state', 'required': False }), ('billing_postalcode', { 'translated_name': 'billing/postalcode', 'required': False }), ('billing_country', { 'translated_name': 'billing/country', 'required': False }), ('billing_phone', { 'translated_name': 'billing/phone', 'required': False }), ('billing_email', { 'translated_name': 'billing/email', 'required': False }), ('billing_company_name', { 'translated_name': 'billing/companyName', 'required': False }), ('shipping_name', { 'translated_name': 'shipping/name', 'required': False }), ('shipping_address', { 'translated_name': 'shipping/address', 'required': False }), ('shipping_address2', { 'translated_name': 'shipping/address2', 'required': False }), ('shipping_city', { 'translated_name': 'shipping/city', 'required': False }), ('shipping_state', { 'translated_name': 'shipping/state', 'required': False }), ('shipping_postalcode', { 'translated_name': 'shipping/postalcode', 'required': False }), ('shipping_country', { 'translated_name': 'shipping/country', 'required': False }), ('shipping_phone', { 'translated_name': 'shipping/phone', 'required': False }), ('shipping_email', { 'translated_name': 'shipping/email', 'required': False }), ('expiration_date', { 'translated_name': 'transactionDetail/payType/boleto/expirationDate' }), ('number', { 'translated_name': 'transactionDetail/payType/boleto/number' }), ('instructions', { 'translated_name': 'transactionDetail/payType/boleto/instructions', 'required': False }), ('format', { 'translated_name': 'transactionDetail/payType/boleto/format', 'required': False }), ## desconto ('discount_date', { 'translated_name': 'transactionDetail/payType/boleto/discount/date', 'required': False }), ('discount_type', { 'translated_name': 'transactionDetail/payType/boleto/discount/type', 'required': False }), ('discount_value', { 'translated_name': 'transactionDetail/payType/boleto/discount/value', 'required': False }), ## multa ('charge_date', { 'translated_name': 'transactionDetail/payType/boleto/charge/date', 'required': False }), ('charge_type', { 'translated_name': 'transactionDetail/payType/boleto/charge/type', 'required': False }), ('charge_value', { 'translated_name': 'transactionDetail/payType/boleto/charge/value', 'required': False }), ## juros, taxas ('interestRate_date', { 'translated_name': 'transactionDetail/payType/boleto/interestRate/date', 'required': False }), ('interestRate_type', { 'translated_name': 'transactionDetail/payType/boleto/interestRate/type', 'required': False }), ('interestRate_value', { 'translated_name': 'transactionDetail/payType/boleto/interestRate/value', 'required': False }), ('interestRate_frequency', { 'translated_name': 'transactionDetail/payType/boleto/interestRate/frequency', 'required': False }), ('charge_total', { 'translated_name': 'payment/chargeTotal' })) requester = PaymentRequester(fields, kwargs) return self.send(command='sale', requester=requester, resource=PaymentResource)
def create_recurring(self, **kwargs): fields = ( ('processor_id', { 'translated_name': 'processorID' }), ('reference_num', { 'translated_name': 'referenceNum' }), ('ip_address', { 'translated_name': 'ipAddress', 'required': False }), ('billing_name', { 'translated_name': 'billing/name', 'required': False }), ('billing_address', { 'translated_name': 'billing/address', 'required': False }), ('billing_address2', { 'translated_name': 'billing/address2', 'required': False }), ('billing_city', { 'translated_name': 'billing/city', 'required': False }), ('billing_state', { 'translated_name': 'billing/state', 'required': False }), ('billing_postalcode', { 'translated_name': 'billing/postalcode', 'required': False }), ('billing_country', { 'translated_name': 'billing/country', 'required': False }), ('billing_phone', { 'translated_name': 'billing/phone', 'required': False }), ('billing_email', { 'translated_name': 'billing/email', 'required': False }), ('shipping_name', { 'translated_name': 'shipping/name', 'required': False }), ('shipping_address', { 'translated_name': 'shipping/address', 'required': False }), ('shipping_address2', { 'translated_name': 'shipping/address2', 'required': False }), ('shipping_city', { 'translated_name': 'shipping/city', 'required': False }), ('shipping_state', { 'translated_name': 'shipping/state', 'required': False }), ('shipping_postalcode', { 'translated_name': 'shipping/postalcode', 'required': False }), ('shipping_country', { 'translated_name': 'shipping/country', 'required': False }), ('shipping_phone', { 'translated_name': 'shipping/phone', 'required': False }), ('shipping_email', { 'translated_name': 'shipping/email', 'required': False }), ('card_number', { 'translated_name': 'transactionDetail/payType/creditCard/number' }), ('card_expiration_month', { 'translated_name': 'transactionDetail/payType/creditCard/expMonth' }), ('card_expiration_year', { 'translated_name': 'transactionDetail/payType/creditCard/expYear' }), ('card_cvv', { 'translated_name': 'transactionDetail/payType/creditCard/cvvNumber', 'required': False }), ('charge_total', { 'translated_name': 'payment/chargeTotal' }), ('currency_code', { 'translated_name': 'payment/currencyCode', 'required': True }), ('recurring_action', { 'translated_name': 'recurring/action', 'default': 'new' }), ('recurring_start', { 'translated_name': 'recurring/startDate' }), ('recurring_frequency', { 'translated_name': 'recurring/frequency' }), ('recurring_period', { 'translated_name': 'recurring/period' }), ('recurring_installments', { 'translated_name': 'recurring/installments' }), ('recurring_failure_threshold', { 'translated_name': 'recurring/failureThreshold', 'required': False }), ) requester = PaymentRequester(fields, kwargs) return self.send(command='recurringPayment', requester=requester, resource=PaymentResource)