[FIX] payment_applepay: store checkout id in tx
This commit is contained in:
parent
39e1fb339d
commit
8effb6c372
|
|
@ -29,9 +29,9 @@ class DonationRecurring(models.Model):
|
|||
required=True, tracking=True
|
||||
)
|
||||
frequency = fields.Selection(
|
||||
[('daily', 'Day(s)'),
|
||||
('weekly', 'Week(s)'),
|
||||
('monthly', 'Month(s)'),
|
||||
[('daily', _('Daily')),
|
||||
('weekly', _('Weekly')),
|
||||
('monthly', _('Monthly')),
|
||||
],
|
||||
string='Recurrence Frequency',
|
||||
default='monthly',
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ class AcquirerApplepay(models.Model):
|
|||
url = "https://eu-test.oppwa.com/v1/checkouts" if self.state == 'test' else "https://oppwa.com/v1/checkouts"
|
||||
authorization_bearer = "Bearer " + self.applepay_authorization_bearer
|
||||
partner = self.env['res.partner'].sudo().browse(values['partner_id']).sudo()
|
||||
tx_id = self.env['payment.transaction'].sudo().search([('id', '=', values.get('tx_id', 0))])
|
||||
order_no = values.get('reference', '').split('-', 1)
|
||||
partner_name = partner.name or ''
|
||||
partner_mobile = partner.mobile or ''
|
||||
|
|
@ -69,6 +70,8 @@ class AcquirerApplepay(models.Model):
|
|||
)
|
||||
response = json.loads(response.text)
|
||||
_logger.info("Info From Authorization = %s ", response)
|
||||
if tx_id:
|
||||
tx_id.applepay_checkout_id = response.get('id')
|
||||
return response.get('id')
|
||||
except Exception as e:
|
||||
raise UserError(_(e))
|
||||
|
|
|
|||
Loading…
Reference in New Issue