web_payments_dummy package

Module contents

class web_payments_dummy.DummyProvider(capture=True, time_reserve=datetime.timedelta(0))[source]

Bases: web_payments.logic.BasicProvider

Dummy payment provider

capture(payment, amount=None, final=True)[source]

Capture a fraction of the total amount of a payment. Return amount captured or None

extra = {'is_dummy': True}
get_auth_token(now)[source]

Takes now, a datetime object with timezone utc, as argument

Must return (authentication token, datetime when it will expire)

datetime can be now to disable caching

get_form(payment, data=None)[source]

Converts payment into a form

process_data(payment, request)[source]

Process callback request from a payment provider. Default: return 404 if somebody tries it

refund(payment, amount=None)[source]

Refund payment, return amount which was refunded

release(payment)[source]

Annilates captured payment

Submodules

web_payments_dummy.forms module

class web_payments_dummy.forms.DummyForm(*, provider=None, payment=None, **kwargs)[source]

Bases: web_payments.forms.PaymentForm

RESPONSE_CHOICES = (('3ds-disabled', '3DS disabled'), ('3ds-redirect', '3DS redirect'), ('failure', 'Gateway connection error'), ('payment-error', 'Gateway returned unsupported response'))
fraud_status = <UnboundField(SelectField, (), {'choices': [('unknown', 'Unknown'), ('accept', 'Passed'), ('reject', 'Rejected'), ('review', 'Review')], 'validators': [<wtforms.validators.InputRequired object>]})>
gateway_response = <UnboundField(SelectField, (), {'choices': (('3ds-disabled', '3DS disabled'), ('3ds-redirect', '3DS redirect'), ('failure', 'Gateway connection error'), ('payment-error', 'Gateway returned unsupported response')), 'validators': [<wtforms.validators.InputRequired object>]})>
status = <UnboundField(SelectField, (), {'choices': [('waiting', 'Waiting for confirmation'), ('preauth', 'Pre-authorized'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected'), ('refunded', 'Refunded'), ('error', 'Error'), ('input', 'Input')], 'validators': [<wtforms.validators.InputRequired object>]})>
validate()[source]

Validates the form by calling validate on each field, passing any extra Form.validate_<fieldname> validators to the field validator.

verification_result = <UnboundField(SelectField, (), {'choices': [('waiting', 'Waiting for confirmation'), ('preauth', 'Pre-authorized'), ('confirmed', 'Confirmed'), ('rejected', 'Rejected'), ('refunded', 'Refunded'), ('error', 'Error'), ('input', 'Input'), ('', '')]})>