The problem was that if you have multiple stripe payment providers in
different companies, it may cause issues in getting the stripe payment
provider. That was because of using sudo in
calling `_get_stripe_payment_provider`.
The solution is to filter the result based on the company.
opw-3473577
closesodoo/odoo#134930
X-original-commit: 5ebd8d76a406b6199ea2a3c337a0b7205e861d1e
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Interac is the most popular Canadian debit card system [1]. To support
Interac payments in Stripe two changes were made [2]:
- "interac_present" was added as a payment_method_type when creating
the payment intent, and
- Interac payments are never captured
interact_present should only be added if the Stripe account being used
is Canadian [3] and transactions take place in CAD [4]. If either of
these is not true Stripe will return an error when creating the
payment intent. Stripe Terminal doesn't support non-native currencies
[5], so checking the currency should be enough, but to be extra
defensive we also check the country on the company before adding the
payment_method_type. [6]
To stop capturing we check the type on the payment_method and bypass
captureAfterPayment. We also add a check on canBeAdjusted because
these payments cannot be adjusted later on.
A known limitation is that it won't be possible to refund customers
via Interac. This requires an API call (not possible via Stripe
Dashboard) and isn't feasible in a stable release. Refunding needs to
happen with cash.
Testing this is not possible with a physical reader since Stripe
refuses to send Interac test cards to non-Canadian addresses. Instead
a simulated reader was used [7]. When developing this simulated reader
discovery was explicitly enabled in the code:
await this.terminal.discoverReaders({simulated: true})
Afterwards Stripe Terminal can be configured so that the next
transaction it simulates is an Interac one. To do so the following was
executed in a browser console:
posmodel.payment_methods[{ID}].payment_terminal.terminal.setSimulatorConfiguration({testPaymentMethod: 'interac'})
This only affects the next transaction, subsequent transactions will
use the default card_present again.
[1] https://www.interac.ca/en/content/business/interac-by-the-numbers/
[2] https://stripe.com/docs/terminal/payments/regional?integration-country=CA#create-a-paymentintent
[3] {'error': {'code': 'card_present_type_not_supported',
'message': 'The interac_present source type is not supported in US.',
'request_log_url': 'https://dashboard.stripe.com/test/logs/xxx',
'type': 'invalid_request_error'}}
[4] {'error': {'code': 'card_present_currency_not_supported',
'message': 'The interac_present source type with currency usd is '
'not supported in CA.',
'request_log_url': 'https://dashboard.stripe.com/test/logs/xxx',
'type': 'invalid_request_error'}}
[5] https://support.stripe.com/questions/stripe-terminal-country-and-currency-availability
[6] Ideally the supported payment type should be determined by the
payment_icon_ids m2m on payment.provider. But since pos_stripe
currently doesn't use that field this approach was chosen.
[7] https://stripe.com/docs/terminal/payments/connect-reader
opw-3376103
closesodoo/odoo#133694
X-original-commit: d6296af29653eb46df0dff9b6a87ee6e93486a0d
Signed-off-by: Joren Van Onder (jov) <jov@odoo.com>
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Current behavior:
When you setup a stripe payment terminal, there was a rounding issue.
If you sold a product for 1.10€ with a tax of 7%, the total amount
was 1.18€, but the amount sent to the stripe terminal was 1.17€.
Steps to reproduce:
- Setup the stripe payment terminal
- Create a product with a price of 1.10€ and a tax of 7%
- Create a POS order with this product, the total is 1.18€
- Pay the order with the stripe payment terminal, the amount sent to
the terminal is 1.17€
opw-3298277
closesodoo/odoo#124372
X-original-commit: 356a6b089c020a9a83c8c7b65b588a50491c13a8
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
Before this commit: if a non-admin user captured a payment with
PoS Stripe, an error occurred in UI. The problem is that only the
"Administration / Settings" group can have access to the payment
provider.
The solution is to use super user mode.
opw-3120441
closesodoo/odoo#112006
X-original-commit: de096c08f5766f3fb2b2438730295195cdd9af16
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Before this commit:
If you make a PoS payment using a Stripe terminal, you will have
the following JS Traceback:
```js
TypeError: Cannot read properties of undefined (reading 'data')
at Proxy.captureAfterPayment
```
This happens on the line:
`capturePayment.charges.data[0].payment_method_details.card_present.brand;`
It occurs as Stripe API most recent version does not provide the
`charges` value anymore.
> The charges property on PaymentIntent has been removed
source:
https://stripe.com/docs/upgrades#2022-11-15
After this commit:
We skip the data if not mentioned on the JS side.
In addition of that, we use the `_stripe_make_request`
method of the Stripe payment provider as it
force in its header to use a certain Stripe API version
compatible with the features that we are looking for.
opw-3097460
closesodoo/odoo#108851
X-original-commit: 6a6057caf63d7e6a60dac190b2ea1ebb954d8f6a
Signed-off-by: Loan (LSE) <lse@odoo.com>
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Currently if an error occurs on the server side it is not
reported to the POS interface and therefore to the user.
With this commit all responses to requests to the Stripe
server are managed in the POS so that the cashier is correctly
informed of any errors that may occur
closesodoo/odoo#104870
X-original-commit: a9c794ed31cfe1527f0e480729212859338bca60
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
This is analogous to pos_restaurant_adyen and adds support for the two
American tipping flows:
- customer tips immediately themselves after paying using the TipScreen
- waiter adds tips end-of-day using paper receipts using the TicketScreen
To allow for tipping an optional amount= parameter was added to
stripe_capture_payment and the transaction_id on the paymentline was
saved a bit sooner so it can be used in the backend in set_no_tip and
_update_payment_line_for_tip.
Stripe docs:
https://stripe.com/docs/terminal/features/collecting-tips/on-receipt
task-2979312
closesodoo/odoo#99973
Signed-off-by: Masereel Pierre <pim@odoo.com>
Changing the name of model payment.acquirer to payment.provider
and everything that it touches. It is technically incorrect to
use the term "acquirer" for systems that only provide a service
of payment.
After this commit the model payment.acquirer and all related to
it will be renamed to payment.provider.
Task - 2842088
closesodoo/odoo#90899
Related: odoo/upgrade#3542
Related: odoo/documentation#1981
Related: odoo/enterprise#27131
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
We need to complete the onboarding of Stripe connect or
record the secret key
Actually there are not a direct link to payment from POS
So we add a link from the Stripe payment method to Stripe view form
closesodoo/odoo#92869
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Add a stripe payment provider to the POS
To be able to use this payment provider, you must have configured Stripe in Odoo
closesodoo/odoo#92421
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>