forked from julsdelatierra/conekta-python
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* - Fix checkout errors - Fix checkout tests - Delete unused methods * fix failing test * fix branch name github actions
- Loading branch information
Showing
14 changed files
with
162 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Python App Test | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Run tests | ||
run: nosetests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ conekta/.DS_Store | |
build | ||
conekta.egg-info | ||
dist | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
import unittest | ||
import random | ||
import conekta | ||
from datetime import datetime, timedelta | ||
|
||
|
||
class BaseEndpointTestCase(unittest.TestCase): | ||
|
@@ -119,7 +120,7 @@ class BaseEndpointTestCase(unittest.TestCase): | |
{'token_id': 'tok_test_visa_4242', | ||
'type': 'card'}, | ||
{'token_id': 'tok_test_mastercard_5100', | ||
'type': 'card'} | ||
'type': 'card'} | ||
], | ||
"shipping_contacts": [{ | ||
"phone": "+525511223344", | ||
|
@@ -281,7 +282,7 @@ class BaseEndpointTestCase(unittest.TestCase): | |
update_payment_source_object = { | ||
"name": "Emiliano Cabrera", | ||
"exp_month": "12", | ||
"exp_year": "20", | ||
"exp_year": "29", | ||
"address": { | ||
"street1": "Nuevo leon", | ||
"city": "Monterrey", | ||
|
@@ -308,7 +309,7 @@ class BaseEndpointTestCase(unittest.TestCase): | |
"name": "Payment Link Name", | ||
"type": "PaymentLink", | ||
"recurrent": False, | ||
"expired_at": 1590882634, | ||
"expired_at": int((datetime.today() + timedelta(days=1)).timestamp()), | ||
"allowed_payment_methods": ["cash", "card", "bank_transfer"], | ||
"needs_shipping_contact": True, | ||
"monthly_installments_enabled": False, | ||
|
@@ -329,10 +330,11 @@ class BaseEndpointTestCase(unittest.TestCase): | |
} | ||
|
||
checkout_object_multiple = { | ||
"payments_limit_count": 2, | ||
"name": "Payment Link Name", | ||
"type": "PaymentLink", | ||
"recurrent": True, | ||
"expired_at": 1590882634, | ||
"expired_at": int((datetime.today() + timedelta(days=1)).timestamp()), | ||
"allowed_payment_methods": ["cash", "card", "bank_transfer"], | ||
"needs_shipping_contact": True, | ||
"monthly_installments_enabled": False, | ||
|
@@ -353,10 +355,11 @@ class BaseEndpointTestCase(unittest.TestCase): | |
} | ||
|
||
checkout_object_msi = { | ||
"payments_limit_count" : 2, | ||
"name": "Payment Link Name", | ||
"type": "PaymentLink", | ||
"recurrent": True, | ||
"expired_at": 1590882634, | ||
"expired_at": int((datetime.today() + timedelta(days=1)).timestamp()), | ||
"allowed_payment_methods": ["cash", "card", "bank_transfer"], | ||
"needs_shipping_contact": True, | ||
"monthly_installments_enabled": True, | ||
|
@@ -411,24 +414,24 @@ class BaseEndpointTestCase(unittest.TestCase): | |
"monthly_installments_enabled": True, | ||
"monthly_installments_options": [3, 6, 9, 12], | ||
"order_template": { | ||
"line_items": [{ | ||
"name": "Red Wine", | ||
"unit_price": 1000, | ||
"quantity": 10 | ||
}], | ||
"line_items": [{ | ||
"name": "Red Wine", | ||
"unit_price": 1000, | ||
"quantity": 10 | ||
}], | ||
"currency": "MXN", | ||
"customer_info": { | ||
"name": "Juan Perez", | ||
"email": "[email protected]", | ||
"phone": "5566982090" | ||
"name": "Juan Perez", | ||
"email": "[email protected]", | ||
"phone": "5566982090" | ||
} | ||
} | ||
} | ||
|
||
checkout_order_object = { | ||
"currency": "MXN", | ||
"customer_info": { | ||
"customer_id": "cus_2o3FvMEBiKitVK1vQ" | ||
"customer_id": "cus_2tgwCPgJZR56HvkKK" | ||
}, | ||
"line_items": [{ | ||
"name": "Box of Cohiba S1s", | ||
|
@@ -443,7 +446,7 @@ class BaseEndpointTestCase(unittest.TestCase): | |
"multifactor_authentication": False, | ||
"monthly_installments_enabled": False, | ||
"monthly_installments_options": [3, 6, 9, 12, 18], | ||
"expires_at": 1609891200 | ||
"expired_at": int((datetime.today() + timedelta(days=1)).timestamp()) | ||
}, | ||
"shipping_contact": { | ||
"phone": "+5215555555555", | ||
|
@@ -458,7 +461,7 @@ class BaseEndpointTestCase(unittest.TestCase): | |
checkout_msi_order__object = { | ||
"currency": "MXN", | ||
"customer_info": { | ||
"customer_id": "cus_2o3FvMEBiKitVK1vQ" | ||
"customer_id": "cus_2tgwCPgJZR56HvkKK" | ||
}, | ||
"line_items": [{ | ||
"name": "Box of Cohiba S1s", | ||
|
@@ -490,7 +493,7 @@ class BaseEndpointTestCase(unittest.TestCase): | |
checkout_order__redirect_object = { | ||
"currency": "MXN", | ||
"customer_info": { | ||
"customer_id": "cus_2o3FvMEBiKitVK1vQ" | ||
"customer_id": "cus_2tgwCPgJZR56HvkKK" | ||
}, | ||
"line_items": [{ | ||
"name": "Box of Cohiba S1s", | ||
|
@@ -502,13 +505,13 @@ class BaseEndpointTestCase(unittest.TestCase): | |
}], | ||
"checkout": { | ||
"type": "HostedPayment", | ||
"success_url": "testredirect.com", | ||
"failure_url": "testredirect.com", | ||
"success_url": "https://testredirect.com", | ||
"failure_url": "https://testredirect.com", | ||
"allowed_payment_methods": ["cash", "card", "bank_transfer"], | ||
"multifactor_authentication": False, | ||
"monthly_installments_enabled": False, | ||
"monthly_installments_options": [3, 6, 9, 12, 18], | ||
"expires_at": 1609891200 | ||
"expired_at": int((datetime.today() + timedelta(days=1)).timestamp()) | ||
}, | ||
"shipping_contact": { | ||
"phone": "+5215555555555", | ||
|
Oops, something went wrong.