Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] payment_cielo tests #1064

Merged
merged 1 commit into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions payment_cielo/tests/fixtures/test_10_cielo_s2s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ interactions:
- request:
body: '{"MerchantOrderId": "37", "Customer": {"Name": "Norbert Buyer"}, "Payment":
{"Type": "CreditCard", "Amount": 11500.0, "Installments": 1, "SoftDescriptor":
"test_ref_2020", "CreditCard": {"CardToken": "905ffdbd-ddc1-49f5-b9b8-9e512ba9917e",
"test_ref_10_c", "CreditCard": {"CardToken": "905ffdbd-ddc1-49f5-b9b8-9e512ba9917e",
"Brand": "visa", "SaveCard": "true"}}}'
headers:
Accept:
Expand All @@ -82,7 +82,7 @@ interactions:
uri: https://apisandbox.cieloecommerce.cielo.com.br/1/sales
response:
body:
string: '{"MerchantOrderId":"37","Customer":{"Name":"Norbert Buyer"},"Payment":{"ServiceTaxAmount":0,"Installments":1,"Interest":0,"Capture":false,"Authenticate":false,"Recurrent":false,"CreditCard":{"SaveCard":true,"CardToken":"905ffdbd-ddc1-49f5-b9b8-9e512ba9917e","Brand":"Visa"},"Tid":"1124020251914","ProofOfSale":"170380","AuthorizationCode":"189477","SoftDescriptor":"test_ref_2020","Provider":"Simulado","IsQrCode":false,"Amount":11500,"ReceivedDate":"2020-11-24
string: '{"MerchantOrderId":"37","Customer":{"Name":"Norbert Buyer"},"Payment":{"ServiceTaxAmount":0,"Installments":1,"Interest":0,"Capture":false,"Authenticate":false,"Recurrent":false,"CreditCard":{"SaveCard":true,"CardToken":"905ffdbd-ddc1-49f5-b9b8-9e512ba9917e","Brand":"Visa"},"Tid":"1124020251914","ProofOfSale":"170380","AuthorizationCode":"189477","SoftDescriptor":"test_ref_10_c","Provider":"Simulado","IsQrCode":false,"Amount":11500,"ReceivedDate":"2020-11-24
14:02:51","Status":1,"IsSplitted":false,"ReturnMessage":"Operation Successful","ReturnCode":"4","PaymentId":"42e731d0-8cef-4716-921e-62991244b788","Type":"CreditCard","Currency":"BRL","Country":"BRA","Links":[{"Method":"GET","Rel":"self","Href":"https://apiquerysandbox.cieloecommerce.cielo.com.br/1/sales/42e731d0-8cef-4716-921e-62991244b788"},{"Method":"PUT","Rel":"capture","Href":"https://apisandbox.cieloecommerce.cielo.com.br/1/sales/42e731d0-8cef-4716-921e-62991244b788/capture"},{"Method":"PUT","Rel":"void","Href":"https://apisandbox.cieloecommerce.cielo.com.br/1/sales/42e731d0-8cef-4716-921e-62991244b788/void"}]}}'
headers:
Access-Control-Expose-Headers:
Expand Down
5 changes: 2 additions & 3 deletions payment_cielo/tests/test_cielo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

import odoo
from odoo import fields
from odoo.addons.payment.tests.common import PaymentAcquirerCommon
import time
import logging
Expand Down Expand Up @@ -56,7 +55,7 @@ def test_10_cielo_s2s(self):
time.sleep(2)
# Create transaction
tx = self.env['payment.transaction'].create({
'reference': 'test_ref_%s' % fields.date.today(),
'reference': 'test_ref_10_c',
'currency_id': self.currency_euro.id,
'acquirer_id': self.cielo.id,
'partner_id': self.buyer_id,
Expand Down Expand Up @@ -105,7 +104,7 @@ def test_20_cielo_s2s(self):

# Create transaction todo test
tx = self.env['payment.transaction'].create({
'reference': 'test_ref_%s' % fields.date.today(),
'reference': 'test_ref_10_c',
'currency_id': self.currency_euro.id,
'acquirer_id': self.cielo.id,
'partner_id': self.buyer_id,
Expand Down