Reply
Member
Posts: 3
Registered: ‎03-24-2017
Accepted Solution

Python: Charge-Credit-Card using Nonce from Accept.JS

Hi All,

I am looking for an example or some guidance on charging a card in python via the nonce received from Accept.JS

I see within apicontractsv1.paymentType(), opagueData, which based on the xml example posted here: im guessing is where the magic happens. I'm just not sure how to set it.

Does it take a dictionary with 'dataDescriptor' and 'dataValue' where dataValue = nonce?

 

Any help or example would be greatly appreciated. Realistically the same script found here, just sub credit card info for nonce.

Thanks in advance!
Andrew


Accepted Solutions
Solution
Accepted by topic author ar090
‎03-26-2017 10:12 AM
Posts: 2,765
Topics: 57
Kudos: 254
Blog Posts: 67
Registered: ‎12-05-2011

Re: Python: Charge-Credit-Card using Nonce from Accept.JS


All Replies
Solution
Accepted by topic author ar090
‎03-26-2017 10:12 AM
Posts: 2,765
Topics: 57
Kudos: 254
Blog Posts: 67
Registered: ‎12-05-2011

Re: Python: Charge-Credit-Card using Nonce from Accept.JS

Member
Posts: 3
Registered: ‎03-24-2017

Re: Python: Charge-Credit-Card using Nonce from Accept.JS

Thanks for the quick reply @RichardH!

Sorry for missing that, I'll give it a shot and let you know how it goes.

 

Much appreciated,

Andrew

Member
Posts: 3
Registered: ‎03-24-2017

Re: Python: Charge-Credit-Card using Nonce from Accept.JS

Hey @RichardH,

 

Thank you again for the help! Was able to put together a working script utilizing the example you linked. I did find one error however with the sample incase you are interested. May help the next guy:

Line 44 here is producing an attribute error:
print ('AUTH Code : %s' % response.authCode)

I believe it should be response.transactionResponse.authCode which works for me:
print ('AUTH Code : %s' % response.transactionResponse.authCode)

Best,

Andrew

All Star
Posts: 699
Registered: ‎11-03-2016

Re: Python: Charge-Credit-Card using Nonce from Accept.JS

Hi @ar090,

 

I cleaned up the Python sample a little bit and made the correction you suggested. Just FYI.