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

Preautorizaciones + Cancelaciones + minor bugfixes #96

Merged
merged 375 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
375 commits
Select commit Hold shift + click to select a range
f704ed6
Create CHANGELOG
Jun 12, 2017
c7f3476
Merge pull request #55 from conekta/bugfix/webhook-validation
Jun 12, 2017
ee45664
Fix oxxopay error
JoValo Jun 16, 2017
a17bae6
Merge pull request #56 from conekta/feature/josserfixes
luiscarlos-gonzalez Jun 20, 2017
ba56d6b
Version bump
JoValo Jun 21, 2017
5dbb7df
Merge pull request #58 from conekta/feature/jossfixes
Jun 21, 2017
e746928
Merge pull request #59 from conekta/dev
Jun 30, 2017
d596bd8
Dev (#66)
JoValo Aug 3, 2017
0f1efd1
Feature/headers prestashop (#68) (#69)
JoValo Aug 16, 2017
30265f0
Update PHP Library
JoValo Aug 16, 2017
af101f0
Merge pull request #70 from conekta/feature/update-php-library
Aug 16, 2017
445b52f
Merge pull request #71 from conekta/dev
JoValo Aug 16, 2017
2466dc4
Prestashop 1.7 update
Aug 17, 2017
1c57bb4
Update README.md
Aug 17, 2017
4b888e7
Versión Update
KarlaRobinson Aug 22, 2017
4582998
Certificates update with public CA
JoValo Aug 23, 2017
30e376f
Version bump
JoValo Aug 23, 2017
80f8f71
standardize changelog
Sep 6, 2017
95b186d
Merge pull request #74 from conekta/feature/std_changelog
KarlaRobinson Sep 6, 2017
f0fe3e4
Docs: Delete unused changelog
JoValo Sep 8, 2017
e1bdf83
Merge pull request #73 from conekta/feature/ca-bundle
Sep 8, 2017
185fda8
Docs: Version bump
JoValo Sep 9, 2017
c26bf42
Merge pull request #75 from conekta/feature/version-bump
JoValo Sep 9, 2017
046a043
Fix in orders with discounts without code
Apr 12, 2018
a577b1d
Merge pull request #78 from Rolige/patch-1
Apr 13, 2018
acd80fe
Feature: PHP lib update
Apr 25, 2018
4d4ffcd
Merge pull request #81 from conekta/feature/lib-update
Apr 25, 2018
5ef587d
Feature: Fix webhook
Apr 25, 2018
f8d5cd7
Merge pull request #82 from conekta/feature/webhook-fix
Apr 25, 2018
005625e
first commit
LucianoPSerfe Nov 19, 2020
ebb8f4e
adding magento credentials in readme
Nov 26, 2020
0ee71ef
adding folders
Nov 26, 2020
27c31c5
adding --user root
Nov 26, 2020
4f4aa2e
updated
Nov 26, 2020
2337af2
changing linio for conekta
Nov 26, 2020
685d737
changing more linio for conekta
Nov 26, 2020
8a69301
changing title
Nov 26, 2020
274a799
more changes in readme
Nov 26, 2020
335cb21
added permissions commands
Nov 27, 2020
219fd40
0079705 - Added inputs fields and validations
Dec 11, 2020
8daf97a
0079705 - small change
Dec 11, 2020
534c214
Merge branch 'development' of git.serfe.com:project/conekta-prestasho…
Dec 15, 2020
7155e46
0079705 - file to handle styles in conekta prestasho settings
Dec 15, 2020
3303a18
Merge branch '0079705-t-i1-prestashop-cap-payment-time-for-oxxo-payme…
Dec 15, 2020
e71c28d
Revert "0079705 - file to handle styles in conekta prestasho settings"
Dec 15, 2020
c61fa3a
0079705 - Edit on notification.php
Dec 15, 2020
d1a4aad
0079705 - conekta prestashop files added
Dec 15, 2020
d36c2a7
Merge branch '0079705-t-i1-prestashop-cap-payment-time-for-oxxo-payme…
Dec 15, 2020
cd189be
0079705 - Task done
Dec 15, 2020
33a3612
Merge branch '0079705-t-i1-prestashop-cap-payment-time-for-oxxo-payme…
Dec 15, 2020
365062f
0079705 - Task done
Dec 15, 2020
5df8905
Merge branch '0079705-t-i1-prestashop-cap-payment-time-for-oxxo-payme…
Dec 15, 2020
c9c5daf
update wit development
Dec 28, 2020
f627313
delete prestashop folder from conekta plugin
Dec 29, 2020
6d0d02c
0080936 - send order id as metadata to conekta panel
Dec 31, 2020
cf5a2f5
Merge branch '0080936-t-i2-prestashop-send-order-id-as-metadata-inste…
Dec 31, 2020
9d8ad4b
0080616 - Get event refunded or canceled from conekta api and change …
Jan 11, 2021
55986fb
0080936 - send cart id
Jan 12, 2021
803f6be
0080616 - Change order status from conekta event
Jan 12, 2021
2e960f0
Merge branch '0080936-t-i2-prestashop-send-order-id-as-metadata-inste…
Jan 12, 2021
886de41
Merge branch 'development' of git.serfe.com:project/conekta-prestasho…
Jan 12, 2021
f2ca5c5
0080936 - get order by cart id
Jan 13, 2021
e196951
Merge branch '0080936-t-i2-prestashop-send-order-id-as-metadata-inste…
Jan 13, 2021
6739516
0080616 - Pulling from dev
Jan 13, 2021
bf4a898
0080616 - Standard refund done
Jan 15, 2021
07c6175
0080616 - Standard refund done
Jan 19, 2021
287b855
merge changes
LucianoPSerfe Jan 22, 2021
ce29747
merge and update branches
LucianoPSerfe Jan 22, 2021
b7a169e
Merge branch 'master' into 'development'
LucianoPSerfe Feb 11, 2021
8512144
0082128: [T][I3][Prestashop] - Habilitar guardado de tarjetas
lucianon-serfe Mar 1, 2021
7704998
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 1, 2021
590651a
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 1, 2021
4a7c879
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 1, 2021
2433a44
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 1, 2021
87fb2ff
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 1, 2021
47146bf
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 1, 2021
1236451
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 1, 2021
dea2d52
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 1, 2021
8f243aa
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 1, 2021
358c3b9
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
a4c7e51
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
032d4bd
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
2f5b9f5
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
2f312d8
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
2358e8d
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
a66d253
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
0c430f2
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
fc8252c
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
c8cfdeb
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
2d9cc03
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
a81c5d0
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
708c9ce
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
1e60f8a
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
886a100
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
b7371b8
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
1f3eb9e
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
923ff88
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
67b366d
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
d059193
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
9dc7525
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
b26d924
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
ecb6237
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
ac2c082
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
ca59f19
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
3a67855
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
65a1318
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
6a7fa61
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
dd090ec
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
bad3a6b
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 2, 2021
2a0e02c
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
ba5fda3
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
50d491c
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
25fbdab
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
21a3442
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
57de0e6
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
40b7273
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
d52773e
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
917b958
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
9e9275d
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
3ea5cc6
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
7849a16
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
c5e1e0d
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 3, 2021
0bcbd32
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 4, 2021
eb2d116
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 4, 2021
fe6e970
0082128 - Conekta checkout integration
lucianon-serfe Mar 5, 2021
dce5d02
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 5, 2021
868d924
codacy stage PR
lucianon-serfe Mar 8, 2021
238e196
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 8, 2021
cd37718
82773 additional metadata information sending was implemented
federicoh-serfe Mar 8, 2021
268a2bb
0082449: [T][Prestashop] Codacy check
lucianon-serfe Mar 8, 2021
1be9c1a
Merge pull request #2 from lucianon-serfe/serfe-stage
lucianon-serfe Mar 8, 2021
ecbede7
82773 metadata cap was implemented
federicoh-serfe Mar 9, 2021
b16eb98
82773 attribute cap changed from 5 to 12
federicoh-serfe Mar 11, 2021
bb9e733
attribute limit read from a constant value
federicoh-serfe Mar 11, 2021
b653dbb
Merge branch '82773-elegir-datos-para-enviar-en-metadatos' into 'deve…
leandro-serfe Mar 12, 2021
137c5ea
82128 - Integration of the conekta form with Prestashop
lucianon-serfe Mar 12, 2021
7e3f7b2
82128 - The payment workflow changed.
lucianon-serfe Mar 18, 2021
42ef9e1
82128 - The payment workflow changed.
lucianon-serfe Mar 19, 2021
3bb69af
82128 - Enable card save
lucianon-serfe Mar 26, 2021
426ce6d
82128 - Enable card save
lucianon-serfe Mar 26, 2021
3d4205a
82773 metadata sending adapted
federicoh-serfe Mar 29, 2021
263c4af
83539 - Admin checkbox issue resolved
lucianon-serfe Mar 30, 2021
e32a17c
Merge branch '0083539-prestashop-no-devuelve-el-valor-de-on-demand-en…
lucianon-serfe Mar 30, 2021
30bb664
83578 - detect purchases with amounts less than $ 20
lucianon-serfe Mar 31, 2021
4059f86
83578 - Minimum purchase amount warning message added.
lucianon-serfe Apr 1, 2021
9a7cce9
Merge branch '0083578-prestashop-falla-formulario-con-ordenes-menores…
lucianon-serfe Apr 5, 2021
7d34d90
83701 cancelling order update implemented
federicoh-serfe Apr 5, 2021
4fd0a1e
Merge branch 'development' of git.serfe.com:project/conekta-prestasho…
federicoh-serfe Apr 5, 2021
deefd11
83662 - added tax lines in order details
lucianon-serfe Apr 6, 2021
d3cafea
Merge branch '82773-elegir-datos-para-enviar-en-metadatos' into 'deve…
LucianoPSerfe Apr 6, 2021
615ff70
Merge branch 'development' of git.serfe.com:project/conekta-prestasho…
federicoh-serfe Apr 6, 2021
924e4dd
83701 cancelations implemented
federicoh-serfe Apr 7, 2021
efe81fc
83819 - the incorporation of the shipping lines in the order was impr…
lucianon-serfe Apr 8, 2021
3f838c1
83931 - new seccion keys
lucianon-serfe Apr 12, 2021
84baa45
83932 - add metadata of the plugin name and version
lucianon-serfe Apr 12, 2021
873b4a3
fixed issue of the incorrect added attribute
lucianon-serfe Apr 12, 2021
db7822d
Merge branch 'development' of git.serfe.com:project/conekta-prestasho…
lucianon-serfe Apr 12, 2021
537eb94
83308 - create checkbox to enable 3ds
lucianon-serfe Apr 14, 2021
eafd6e0
84000 - Added column in the database type mode
lucianon-serfe Apr 14, 2021
b2f582f
82819 - Added reference id of the prestashop order
lucianon-serfe Apr 16, 2021
39f67d0
82819 - Add reference OXXO
lucianon-serfe Apr 19, 2021
f855020
82819 - Add reference OXXO
lucianon-serfe Apr 19, 2021
f3365c9
82819 - Add reference OXXO
lucianon-serfe Apr 19, 2021
7e8ba76
82819 - Add reference OXXO
lucianon-serfe Apr 19, 2021
7e2d7fa
82819 - Add reference OXXO
lucianon-serfe Apr 19, 2021
d7670b8
Merge branch '83932-prestashop-identificar-plugin-prestashop-en-las-t…
gaston-serfe Apr 19, 2021
9c6ca3a
83308 - Added the 3ds checkbox in the prestashop admin
lucianon-serfe Apr 19, 2021
c2cb6b2
Merge branch 'development' of git.serfe.com:project/conekta-prestasho…
lucianon-serfe Apr 19, 2021
dad0f67
84000 - fix the bug create duplicated order
lucianon-serfe Apr 20, 2021
cf35663
84000 - fix the bug create duplicated order
lucianon-serfe Apr 20, 2021
4fb954f
84239 - Added checkbox the preauthorize and order preauthorization.
lucianon-serfe Apr 21, 2021
9545f9d
84284 - Added validate number phone
lucianon-serfe Apr 21, 2021
70c4f54
84284 - Added validate number phone
lucianon-serfe Apr 22, 2021
32f5481
83931 - new seccion keys
lucianon-serfe Apr 22, 2021
90243d6
Merge branch 'development' of git.serfe.com:project/conekta-prestasho…
lucianon-serfe Apr 22, 2021
c99be81
83931 - Added new section keys
lucianon-serfe Apr 22, 2021
8a29a35
83931 - Added new section keys
lucianon-serfe Apr 23, 2021
a6a48d9
merge with development
gaston-serfe Apr 23, 2021
3d888e6
Merge branch '0083662-no-incluye-los-tax-lines-en-el-resumen-de-pago'…
gaston-serfe Apr 23, 2021
b52b9a2
84386 - correction following the code standard
lucianon-serfe Apr 23, 2021
163428f
merge and update branches
lucianon-serfe Apr 23, 2021
4f4b95d
merge and update branches
lucianon-serfe Apr 23, 2021
bb69cd8
merge and update branches
lucianon-serfe Apr 23, 2021
6d1c668
Merge branch '83308-t-i3-s17-prestashop-implementar-soporte-de-3ds' i…
gaston-serfe Apr 23, 2021
34e6bec
84386 - correction following the code standard
lucianon-serfe Apr 23, 2021
5b9f1e6
merge and update branches
lucianon-serfe Apr 23, 2021
8a72570
merge with development
gaston-serfe Apr 23, 2021
6971cdd
84386 - correction following the code standard
lucianon-serfe Apr 26, 2021
bb6406e
84386 - correction following the code standard
lucianon-serfe Apr 26, 2021
df82068
80198- fixed issue with merge
gaston-serfe Apr 26, 2021
dd9447b
80198- recovered missing change on merge
gaston-serfe Apr 26, 2021
909e101
80198- added missing drop table required
gaston-serfe Apr 26, 2021
32a5e2d
Merge branch '84000-no-hay-diferencia-entre-ids-de-produccion-y-prueb…
gaston-serfe Apr 27, 2021
5f90acc
84386 - correction following the code standard
lucianon-serfe Apr 27, 2021
41c22d4
83701 hardcoded numbers were replaced with constants
federicoh-serfe Apr 27, 2021
4fd85d5
84386 - Merge, update and code standardin branch
lucianon-serfe Apr 27, 2021
64d0245
Merge branch '84386-t-i5-s19-prestashop-revisar-y-correcion-segun-el-…
gaston-serfe Apr 27, 2021
fc4ef4b
84284 - Merge and update branche
lucianon-serfe Apr 27, 2021
f6614c6
84239 - Merge and update branch
lucianon-serfe Apr 27, 2021
7676f66
84386 - Merge and update branch
lucianon-serfe Apr 28, 2021
a94927c
84386 - Merge and update branch
lucianon-serfe Apr 28, 2021
5350ab0
84284 - Merge and update branch
lucianon-serfe Apr 28, 2021
c25b890
Merge branch '84284-t-i5-s19-prestashop-numero-de-telefono-retorna-er…
lucianon-serfe Apr 28, 2021
39650e5
84239 - Merge and update branch
lucianon-serfe Apr 28, 2021
6e8e4eb
82819 - Merge and update branch
lucianon-serfe Apr 28, 2021
625a722
83931 - Merge and update branch
lucianon-serfe Apr 28, 2021
0dc7a88
83701 - Merge and update branch
lucianon-serfe Apr 28, 2021
b276efa
84386 - correction according to psr-2 standard
lucianon-serfe Apr 29, 2021
8318013
84545 - CS standard PSR-1 and PSR-2
lucianon-serfe Apr 30, 2021
02335d6
Merge branch 'master' of https://github.com/conekta/conekta_prestashop
lucianon-serfe May 3, 2021
87ca641
84628 - Merge and update branch
lucianon-serfe May 3, 2021
61861c6
Merge branch '84386-t-i5-s19-prestashop-revisar-y-correcion-segun-el-…
gaston-serfe May 3, 2021
4d24731
84628 - Merge and update branch
lucianon-serfe May 3, 2021
4c4e497
84628 - Merge and update branch
lucianon-serfe May 3, 2021
1d37294
84628 - Merge and update branch
lucianon-serfe May 3, 2021
7e6bfde
Merge branch '84628-t-i5-s19-prestashop-correcion-de-conflictos-de-re…
gaston-serfe May 4, 2021
fedde26
84727 - cancellation of pre-authorized orders
lucianon-serfe May 5, 2021
7cdd162
84727 - Merge and update branch
lucianon-serfe May 5, 2021
8975725
84622 - Obtaining orders through the reference code
lucianon-serfe May 5, 2021
60e48b4
84284 - Merge and update branch
lucianon-serfe May 11, 2021
3d5c4d7
Merge and update branch
lucianon-serfe May 11, 2021
b91b298
Merge and update branch
lucianon-serfe May 11, 2021
93ae27c
Merge and update branch
lucianon-serfe May 11, 2021
f5cd404
Merge and update branch
lucianon-serfe May 11, 2021
2e1a2e0
Merge and update branch
lucianon-serfe May 11, 2021
b89b57b
85085- updated instalation guide
gaston-serfe May 14, 2021
af0390f
85085- fixed issues reported
gaston-serfe May 14, 2021
6e3b29d
85085- implemented other fixes required
gaston-serfe May 14, 2021
dc96fea
compatibility corrrection with prestashop 1.7.5
federicoh-serfe May 20, 2021
e81ff70
85303 missing expiry parameter added
federicoh-serfe May 21, 2021
a122783
85303 coding standards changes
federicoh-serfe May 21, 2021
734cbd7
85454 - fix error empty phone number
lucianon-serfe May 28, 2021
25bbbea
Merge branch 'development' of git.serfe.com:project/conekta-prestasho…
federicoh-serfe May 28, 2021
a097b3a
resolving conflicts for merge
federicoh-serfe May 28, 2021
803805b
Merge branch '84284-t-i5-s19-prestashop-numero-de-telefono-retorna-er…
federicoh-serfe May 28, 2021
125cc27
85520 - Phone number update validate
lucianon-serfe May 31, 2021
931ac5a
Merge branch '85520-ncp-prestashop-reemplazo-de-numero-correcto-por-n…
federicoh-serfe May 31, 2021
0adc50c
83701- modified message on credential save
gaston-serfe Jun 2, 2021
dbb005f
84727 save button text changed
federicoh-serfe Jun 2, 2021
c2ff29e
Merge branch '84727-t-i5-s20-prestashop-cancelacion-de-ordenes-preaut…
federicoh-serfe Jun 2, 2021
081dd54
Merge branch '83701-cancelaciones-desde-prestashop-hacia-conekta' int…
federicoh-serfe Jun 2, 2021
bfb15f1
merge conflicts solved
federicoh-serfe Jun 2, 2021
5046e81
Revert "merge conflicts solved"
federicoh-serfe Jun 2, 2021
2c5957b
Merge branch 'master' of https://github.com/federicoh-serfe/conekta_p…
federicoh-serfe Jun 2, 2021
efdc7c0
merge conflicts solved
federicoh-serfe Jun 2, 2021
e1664d5
Merge branch 'serfe-stage' of https://github.com/federicoh-serfe/cone…
federicoh-serfe Jun 2, 2021
a62f57b
85582 - Fixed errors reported by Prestashop Validator
lucianon-serfe Jun 4, 2021
8397f07
85582 - Fixed errors reported by Prestashop Validator
lucianon-serfe Jun 7, 2021
bc079b2
spei payment error corrected
federicoh-serfe Jun 14, 2021
4abe1a0
Merge branch '85582-t-i5-s22-prestashop-corregir-errores-reportados-p…
federicoh-serfe Jun 14, 2021
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
Binary file removed .DS_Store
Binary file not shown.
744 changes: 589 additions & 155 deletions conektapaymentsprestashop.php

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ public function postProcess()
}
}
if (!$authorized) {
print_r($this->getTranslator()->trans('This payment method is not available.', array(), 'Modules.ConektaPaymentsPrestashop.Shop'));
print_r($this->getTranslator()->trans(
'This payment method is not available.',
array(),
'Modules.ConektaPaymentsPrestashop.Shop'
));
} else {
if (!Validate::isLoadedObject($customer)) {
Tools::redirect('index.php?controller=order&step=1');
Expand Down
4 changes: 2 additions & 2 deletions model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ public static function getShippingContact($customer = '', $address_delivery = ''
return $shipping_contact;
}

public static function getCustomerInfo($customer = '')
public static function getCustomerInfo($customer = '', $address_delivery = '')
{
$customer_info = array(
"name" => $customer->firstname . " " . $customer->lastname,
// "phone" => $address_delivery->phone,
"phone" => $address_delivery->phone,
"email" => $customer->email,
"metadata" => array("soft_validations" => true)
);
Expand Down
78 changes: 51 additions & 27 deletions model/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function getOrderConekta($order_id)
{
return Db::getInstance()->getValue(
'SELECT module FROM ' . _DB_PREFIX_ . 'orders '
.'WHERE id_order = ' . pSQL((int) $order_id)
. 'WHERE id_order = ' . pSQL((int) $order_id)
);
}

Expand All @@ -57,8 +57,8 @@ public static function getConektaTransaction($order_id)
{
return Db::getInstance()->getRow(
'SELECT * FROM ' . _DB_PREFIX_ . 'conekta_transaction '
.'WHERE id_order = ' . pSQL((int) $order_id) .
' AND type = \'payment\''
. 'WHERE id_order = ' . pSQL((int) $order_id)
. ' AND type = \'payment\''
);
}

Expand All @@ -76,10 +76,10 @@ public static function getConektaTransaction($order_id)
public static function insertOxxoPayment($order, $charge_response, $reference, $currentOrder, $cartId)
{
return Db::getInstance()->Execute(
'INSERT INTO ' . _DB_PREFIX_ . 'conekta_transaction (
type, id_cart, id_order, id_conekta_order, id_transaction, amount,
status, currency, mode, date_add, reference, barcode, captured)
VALUES (\'payment\', ' . pSQL((int) $cartId) . ', ' . pSQL((int) $currentOrder) . ', \''
'INSERT INTO ' . _DB_PREFIX_ . 'conekta_transaction ('
. 'type, id_cart, id_order, id_conekta_order, id_transaction, amount,'
. 'status, currency, mode, date_add, reference, barcode, captured)'
. 'VALUES (\'payment\', ' . pSQL((int) $cartId) . ', ' . pSQL((int) $currentOrder) . ', \''
. pSQL($order->id) . '\', \'' . pSQL($charge_response->id) . '\',\''
. (float) ($order->amount * 0.01) . '\', \''
. ($charge_response->status == 'paid' ? 'paid' : 'unpaid') . '\', \''
Expand Down Expand Up @@ -158,7 +158,11 @@ public static function createTableConektaOrder()
id_cart int(11) unsigned NOT NULL,
`mode` enum(\"live\",\"test\") NOT NULL,
id_conekta_order varchar(32) NOT NULL,
`status` enum(\"paid\",\"unpaid\") NOT NULL,
`status` enum(\"paid\",\"pre_authorized\",\"unpaid\",\"pending_payment\",\"expired\",\"voided\","
. "\"fraudulent\",\"preauthorized\",\"canceled\",\"pending_confirmation\",\"charged_back\","
. "\"partially_refunded\",\"refunded\",\"reversed\",\"approved\",\"declined\",\"in_review\","
. "\"insufficient_funds\",\"card_declined\",\"stolen_card\",\"suspected_fraud\","
. "\"unprocessable_card_type\") NOT NULL,
PRIMARY KEY (id),
KEY id_user (id_user),
KEY id_cart (id_cart),
Expand All @@ -184,10 +188,10 @@ public static function createTableConektaOrder()
public static function insertSpeiPayment($order, $charge_response, $reference, $currentOrder, $cartId)
{
return Db::getInstance()->Execute(
'INSERT INTO ' . _DB_PREFIX_ . 'conekta_transaction(
type, id_cart, id_order, id_conekta_order, id_transaction, amount,
status, currency, mode, date_add, reference, captured)
VALUES (\'payment\', ' . (int) $cartId . ', ' . (int) $currentOrder . ', \''
'INSERT INTO ' . _DB_PREFIX_ . 'conekta_transaction('
. 'type, id_cart, id_order, id_conekta_order, id_transaction, amount,'
. 'status, currency, mode, date_add, reference, captured)'
. 'VALUES (\'payment\', ' . (int) $cartId . ', ' . (int) $currentOrder . ', \''
. pSQL($order->id) . '\', \'' . pSQL($charge_response->id) . '\', \''
. (float)($charge_response->amount * 0.01) . '\', \''
. ($charge_response->status == 'paid' ? 'paid' : 'unpaid') . '\', \''
Expand All @@ -210,10 +214,10 @@ public static function insertSpeiPayment($order, $charge_response, $reference, $
public static function insertCardPayment($order, $charge_response, $currentOrder, $cartId)
{
return Db::getInstance()->Execute(
'INSERT INTO ' . _DB_PREFIX_ . 'conekta_transaction (
type, id_cart, id_order, id_conekta_order, id_transaction,
amount, status, currency, mode, date_add, captured)
VALUES (\'payment\', ' . (int) $cartId . ', ' . (int) $currentOrder . ', \''
'INSERT INTO ' . _DB_PREFIX_ . 'conekta_transaction ('
. 'type, id_cart, id_order, id_conekta_order, id_transaction,'
. 'amount, status, currency, mode, date_add, captured)'
. 'VALUES (\'payment\', ' . (int) $cartId . ', ' . (int) $currentOrder . ', \''
. pSQL($order->id) . '\', \'' . pSQL($charge_response->id) . '\',\''
. (float)($charge_response->amount * 0.01) . '\', \''
. ($charge_response->status == 'paid' ? 'paid' : 'unpaid') . '\', \''
Expand All @@ -233,7 +237,7 @@ public static function getOrderById($id_order)
{
return Db::getInstance()->getRow(
'SELECT * FROM ' . _DB_PREFIX_ . 'conekta_transaction '
.'WHERE id_order = ' . pSQL((int) $id_order) . ';'
. 'WHERE id_order = ' . pSQL((int) $id_order) . ';'
);
}

Expand All @@ -250,7 +254,9 @@ public static function getConektaMetadata($user_id, $mode, $meta_options)
{
$table = _DB_PREFIX_."conekta_metadata";

$sql = "SELECT meta_value FROM $table WHERE id_user = '{$user_id}' AND meta_option = '{$meta_options}' AND `mode` = '{$mode}'";
$sql = "SELECT meta_value FROM $table WHERE id_user = '{$user_id}' "
. "AND meta_option = '{$meta_options}' "
. "AND `mode` = '{$mode}'";

return Db::getInstance()->getRow($sql);
}
Expand All @@ -270,11 +276,13 @@ public static function updateConektaMetadata($user_id, $mode, $meta_options, $me
$table = _DB_PREFIX_."conekta_metadata";

if (empty(Database::getConektaMetadata($user_id, $mode, $meta_options))) {
$sql = "INSERT INTO $table(id_user, mode, meta_option, meta_value) VALUES ('{$user_id}','{$mode}','{$meta_options}','{$meta_value}')";
$sql = "INSERT INTO $table(id_user, mode, meta_option, meta_value) "
. "VALUES ('{$user_id}','{$mode}','{$meta_options}','{$meta_value}')";
} else {
$sql ="UPDATE $table SET id_user = '{$user_id}', meta_option = '{$meta_options}', meta_value = '{$meta_value}' WHERE id_user = '{$user_id}' AND meta_option = '{$meta_options}' AND `mode` = '{$mode}'";
$sql ="UPDATE $table SET id_user = '{$user_id}', meta_option = '{$meta_options}', "
. "meta_value = '{$meta_value}' WHERE id_user = '{$user_id}' AND meta_option = '{$meta_options}' "
. "AND `mode` = '{$mode}'";
}

return Db::getInstance()->Execute($sql);
}

Expand All @@ -291,8 +299,9 @@ public static function getConektaOrder($user_id, $mode, $cart_id)
{
$table = _DB_PREFIX_."conekta_order_checkout";

$sql = "SELECT id_conekta_order, `status` FROM $table WHERE id_user = '{$user_id}' AND `mode` = '{$mode}' AND `status` = 'unpaid' AND id_cart ='{$cart_id}'";

$sql = "SELECT id_conekta_order, `status` FROM $table WHERE id_user = '{$user_id}' "
. "AND `mode` = '{$mode}' AND `status` = 'unpaid' AND id_cart ='{$cart_id}'";

return Db::getInstance()->getRow($sql);
}

Expand All @@ -310,13 +319,28 @@ public static function getConektaOrder($user_id, $mode, $cart_id)
public static function updateConektaOrder($user_id, $cart_id, $mode, $id_conekta_order, $status)
{
$table = _DB_PREFIX_."conekta_order_checkout";

if (empty(Database::getConektaOrder($user_id, $mode, $cart_id))) {
$sql = "INSERT INTO $table(id_user, id_cart, mode, id_conekta_order, `status`) VALUES ('{$user_id}','{$cart_id}','{$mode}','{$id_conekta_order}', '{$status}')";
$sql = "INSERT INTO $table(id_user, id_cart, mode, id_conekta_order, `status`) "
. "VALUES ('{$user_id}','{$cart_id}','{$mode}','{$id_conekta_order}', '{$status}')";
} else {
$sql = "UPDATE $table SET `status` = '{$status}' WHERE id_user = '{$user_id}' AND id_cart = '{$cart_id}' AND id_conekta_order = '{$id_conekta_order}' AND `mode` = '{$mode}'";
$sql = "UPDATE $table SET `status` = '{$status}' WHERE id_user = '{$user_id}' "
. "AND id_cart = '{$cart_id}' AND id_conekta_order = '{$id_conekta_order}' AND `mode` = '{$mode}'";
}

return Db::getInstance()->Execute($sql);
}

/**
* Returns the id of the order related to the reference_id
*
* @param string $reference_id Alphabetical reference code assigned to the order.
*
* @return array|string
*/
public static function getOrderByReferenceId($reference_id)
{
$table = _DB_PREFIX_."orders";
$sql = "SELECT id_order FROM $table WHERE reference = '{$reference_id}'";
return Db::getInstance()->getRow($sql);
}
}
25 changes: 14 additions & 11 deletions notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

require_once dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../init.php';
require_once dirname(__FILE__) . '/model/Database.php';

if (!defined('_PS_VERSION_')) {
exit;
Expand All @@ -41,8 +42,9 @@
if ($event_json->type == 'order.paid' && isset($event_json->data)) {
$conekta_order = $event_json->data->object;

$reference_id = (integer) $conekta_order->metadata->reference_id;
$id_order = Order::getOrderByCartId($reference_id);
$reference_id = (string) $conekta_order->metadata->reference_id;
$result = Database::getOrderByReferenceId($reference_id);
$id_order = $result['id_order'];
$order = new Order($id_order);
$order_fields = $order->getFields();
$currency_payment = Currency::getPaymentCurrencies(
Expand All @@ -51,7 +53,7 @@
);
$total_order_amount = $order->getOrdersTotalPaid();
$str_total_order_amount = (string) $total_order_amount * 100;

if ($currency_payment[0]['iso_code'] === $conekta_order->currency) {
if ($str_total_order_amount == $conekta_order->amount) {
$orderHistory = new OrderHistory();
Expand All @@ -71,28 +73,29 @@
} elseif ($event_json->type == 'order.expired' && isset($event_json->data)) {
$conekta_order = $event_json->data->object;

$reference_id = (integer) $conekta_order->metadata->reference_id;
$id_order = Order::getOrderByCartId($reference_id);
$reference_id = (string) $conekta_order->metadata->reference_id;
$result = Database::getOrderByReferenceId($reference_id);
$id_order = $result['id_order'];
Db::getInstance()->Execute(
'UPDATE ' . _DB_PREFIX_
. 'orders SET current_state = '. ORDER_CANCELED .' WHERE id_order = '
. pSQL($id_order)
);
} elseif ($event_json->type == 'order.canceled' && isset($event_json->data)) {
$conekta_order = $event_json->data->object;
$reference_id = (integer) $conekta_order->metadata->reference_id;
$id_order = Order::getOrderByCartId($reference_id);
$reference_id = (string) $conekta_order->metadata->reference_id;
$result = Database::getOrderByReferenceId($reference_id);
$id_order = $result['id_order'];
Db::getInstance()->Execute(
'UPDATE ' . _DB_PREFIX_
. 'orders SET current_state = '. ORDER_CANCELED .' WHERE id_order = '
. pSQL($id_order)
);
} elseif ($event_json->type == 'order.refunded' && isset($event_json->data)) {
$conekta_order = $event_json->data->object;
$reference_id = (integer) $conekta_order->metadata->reference_id;
$id_order = Order::getOrderByCartId($reference_id);
$reference_id = (string) $conekta_order->metadata->reference_id;
$result = Database::getOrderByReferenceId($reference_id);
$id_order = $result['id_order'];
Db::getInstance()->Execute(
'UPDATE ' . _DB_PREFIX_
. 'orders SET current_state = '. ORDER_REFUNDED .' WHERE id_order = '
Expand Down
2 changes: 1 addition & 1 deletion views/templates/hook/admin-order.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<br>
<strong>{l s='Processed on:' mod='conektapaymentsprestashop'}</strong> {$processed_on|escape:'htmlall':'UTF-8'}
<br>
<strong>{l s='Mode:' mod='conektapaymentsprestashop'}</strong> <span style="font-weight: bold; color: {$color_mode|escape:'htmlall':'UTF-8'}};">{$txt_mode|unescape:"htmlall"}</span>
<strong>{l s='Mode:' mod='conektapaymentsprestashop'}</strong> <span style="font-weight: bold; color: {$color_mode|escape:'htmlall':'UTF-8'}};">{$txt_mode|escape:'htmlall':'UTF-8'}</span>
</p>
{else}
<span style="color: #CC0000;"><strong>{l s='Warning:' mod='conektapaymentsprestashop'}</strong></span> {l s='The customer paid using Conekta and an error occured (check details at the bottom of this page)' mod='conektapaymentsprestashop'}
Expand Down