mirror of
https://github.com/bringout/oca-ocb-pos.git
synced 2026-04-26 07:42:00 +02:00
19.0 vanilla
This commit is contained in:
parent
6e54c1af6c
commit
3ca647e428
1087 changed files with 132065 additions and 108499 deletions
|
|
@ -1,43 +0,0 @@
|
|||
odoo.define('pos_restaurant_adyen.payment', function (require) {
|
||||
"use strict";
|
||||
|
||||
var PaymentAdyen = require('pos_adyen.payment');
|
||||
|
||||
PaymentAdyen.include({
|
||||
_adyen_pay_data: function () {
|
||||
var data = this._super();
|
||||
|
||||
if (data.SaleToPOIRequest.PaymentRequest.SaleData.SaleToAcquirerData) {
|
||||
data.SaleToPOIRequest.PaymentRequest.SaleData.SaleToAcquirerData += "&authorisationType=PreAuth";
|
||||
} else {
|
||||
data.SaleToPOIRequest.PaymentRequest.SaleData.SaleToAcquirerData = "authorisationType=PreAuth";
|
||||
}
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
send_payment_adjust: function (cid) {
|
||||
var order = this.pos.get_order();
|
||||
var line = order.get_paymentline(cid);
|
||||
var data = {
|
||||
originalReference: line.transaction_id,
|
||||
modificationAmount: {
|
||||
value: parseInt(line.amount * Math.pow(10, this.pos.currency.decimal_places)),
|
||||
currency: this.pos.currency.name,
|
||||
},
|
||||
merchantAccount: this.payment_method.adyen_merchant_account,
|
||||
additionalData: {
|
||||
industryUsage: 'DelayedCharge',
|
||||
},
|
||||
};
|
||||
|
||||
return this._call_adyen(data, 'adjust');
|
||||
},
|
||||
|
||||
canBeAdjusted: function (cid) {
|
||||
var order = this.pos.get_order();
|
||||
var line = order.get_paymentline(cid);
|
||||
return ['mc', 'visa', 'amex', 'discover'].includes(line.card_type);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
import { PaymentAdyen } from "@pos_adyen/app/utils/payment/payment_adyen";
|
||||
import { patch } from "@web/core/utils/patch";
|
||||
|
||||
patch(PaymentAdyen.prototype, {
|
||||
_adyenPayData() {
|
||||
var data = super._adyenPayData(...arguments);
|
||||
|
||||
if (data.SaleToPOIRequest.PaymentRequest.SaleData.SaleToAcquirerData) {
|
||||
data.SaleToPOIRequest.PaymentRequest.SaleData.SaleToAcquirerData +=
|
||||
"&authorisationType=PreAuth";
|
||||
} else {
|
||||
data.SaleToPOIRequest.PaymentRequest.SaleData.SaleToAcquirerData =
|
||||
"authorisationType=PreAuth";
|
||||
}
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
sendPaymentAdjust(uuid) {
|
||||
var order = this.pos.getOrder();
|
||||
var line = order.getPaymentlineByUuid(uuid);
|
||||
var data = {
|
||||
originalReference: line.transaction_id,
|
||||
modificationAmount: {
|
||||
value: parseInt(line.amount * Math.pow(10, this.pos.currency.decimal_places)),
|
||||
currency: this.pos.currency.name,
|
||||
},
|
||||
merchantAccount: this.payment_method_id.adyen_merchant_account,
|
||||
additionalData: {
|
||||
industryUsage: "DelayedCharge",
|
||||
},
|
||||
};
|
||||
|
||||
return this._callAdyen(data, "adjust");
|
||||
},
|
||||
|
||||
canBeAdjusted(uuid) {
|
||||
var order = this.pos.getOrder();
|
||||
var line = order.getPaymentlineByUuid(uuid);
|
||||
return ["mc", "visa", "amex", "discover"].includes(line.card_type);
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
import { patch } from "@web/core/utils/patch";
|
||||
import { PosPaymentMethod } from "@point_of_sale/../tests/unit/data/pos_payment_method.data";
|
||||
|
||||
patch(PosPaymentMethod.prototype, {
|
||||
_load_pos_data_fields() {
|
||||
return [...super._load_pos_data_fields(), "adyen_merchant_account"];
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue