Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing of preauthorization returns transaction instead of preauthorization data #19

Open
shezi opened this issue Sep 16, 2013 · 0 comments

Comments

@shezi
Copy link

shezi commented Sep 16, 2013

I've been trying to do a preauthorization for a payment. The preauthorization goes through and the response comes back correctly. However, the Paymill API does not return the preauthorization as the top-level object, but a transaction instead. So the call to p.preauthorize does return a Transaction object that is filled with the details of the transaction instead of the preauthorization.

This causes further payment against the preauthorization to fail.

Have a look at the following session for a clearer example:

>>> private_key = '84987a01b958ab5b750fe34013f3f171'
>>> token = '098f6bcd4621d373cade4e832627b4f6'
>>> p = pymill.Pymill(private_key)
>>> preauth = p.preauthorize(
...     amount=100,
...     currency="EUR",
...     description="example pre-auth",
...     token=token
... )
>>> print preauth
tran_351dde91c67338bd39a650a2aaff
>>> pprint(preauth.preauthorization)
{u'amount': u'100',
 u'app_id': None,
 u'client': {u'app_id': None,
             u'created_at': 1379352485,
             u'description': None,
             u'email': None,
             u'id': u'client_cb56cffde673004842ca',
             u'payment': [],
             u'subscription': None,
             u'updated_at': 1379352485},
 u'created_at': 1379352485,
 u'currency': u'EUR',
 u'id': u'preauth_7cb8754344991259b052',
 u'livemode': False,
 u'payment': {u'app_id': None,
              u'card_holder': u'',
              u'card_type': u'visa',
              u'client': u'client_cb56cffde673004842ca',
              u'country': None,
              u'created_at': 1379352485,
              u'expire_month': u'12',
              u'expire_year': u'2014',
              u'id': u'pay_e837057aee2982291f6d1043',
              u'last4': u'1111',
              u'type': u'creditcard',
              u'updated_at': 1379352485},
 u'status': u'closed',
 u'updated_at': 1379352485}
mbi pushed a commit to cruncher/pymill that referenced this issue Feb 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant