SHARE
TWEET

Pledge

tosink Nov 13th, 2019 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. partner_code = line_dict['x_studio_field_LVl0I']
  2. partner = env['res.partner'].search([('code','=',partner_code)], limit=1)
  3. if partner:  
  4.   line_dict_update['partner_id'] = partner['id']
  5.  
  6. #pricelist_id
  7. pricelist_id = env['product.pricelist'].search([('name','=','CAD')],limit=1).id
  8. line_dict_update['pricelist_id'] = pricelist_id
  9.  
  10. #authorized.net
  11. token = False
  12. acquirer = env['payment.acquirer'].search([('provider','=','authorize')], limit=1)
  13.  
  14. #x_cc_number - Credit Card No
  15. #x_expiry_date - Expiry Date
  16. kwargs = {
  17.           'data_set': '',
  18.           'cc_number': line_dict['x_cc_number'],
  19.           'cc_brand': 'visa',
  20.           'cc_holder_name': partner['name'],
  21.           'cc_expiry': line_dict['x_expiry_date'],
  22.           'cc_cvc': '395',
  23.           'acquirer_id': acquirer['id'],
  24.           'partner_id': partner['id'],
  25. }
  26. log(str(kwargs))
  27. token = acquirer.s2s_process(kwargs)
  28. line_dict_update['payment_token_id'] = token['id']
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top