-
Notifications
You must be signed in to change notification settings - Fork 19
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
Instalment Payment Option Implementation #148
Conversation
…into 2-installment
…ticular method. Removed unused debug First Choice capabilities - add list of terms
…unused declaration
…rs - visible only if order is NOT THB
e5e863c
to
7374513
Compare
…ed html labels added comment to function fixed labels
4b6150a
to
bec17ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small things remaining to fix. I'm also not comfortable with the amount of hardcoded stuff given that all the information to remove this is already present in the Capabilities API response, but for this first release I guess we can let most of that slide to the next release
view/frontend/web/js/view/payment/method-renderer/omise-offsite-installment-method.js
Outdated
Show resolved
Hide resolved
view/frontend/web/js/view/payment/method-renderer/omise-offsite-installment-method.js
Show resolved
Hide resolved
view/frontend/web/template/payment/offsite-installment-form.html
Outdated
Show resolved
Hide resolved
bd14ab3
to
c17d96c
Compare
…lities::retrieveInstallmentBackends added to composer requirement, about newer omise-php library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks for your hard work @jacstn !
I left 3 more comments but those are minors. So.. your call 💪
🎉
use Omise\Payment\Model\Capabilities; | ||
use Omise\Payment\Model\Config\Installment as OmiseInstallmentConfig; | ||
|
||
class CapabilitiesConfigProvider implements ConfigProviderInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So since this class is providing configs specifically for Installment, should we rename this one to just InstallmentConfigProvider
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure...
Capabilities, we provide here capabilities for all payment methods in the future?
foreach ($listOfActivePaymentMethods as $method) { | ||
if ($method->getCode() === OmiseInstallmentConfig::CODE) { | ||
return [ | ||
'installment_backends' => $this->capabilities->retrieveInstallmentBackends() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just want to note it out that we are sending out 3 unnecessary properties. From Capabilities API response,
{
"installment_bay": {
"type": "installment",
"currencies": [
"thb"
],
"allowed_installment_terms": [
3,
4,
6,
9,
10
],
"amount": {
"min": 2000,
"max": 100000000
}
}
}
In this pull request, it uses only allowed_installment_terms
and _id
(special attribute generated by Omise-PHP).
We don't use type
, currencies
, and amount
at the moment.
Would be nice if we limit an access to only what we will use in the frontend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will use them in the future... when we will have correct values in amount.
than I will also use currencies, now, it is also hardcoded.
Instalment Payment Integration.
1. Objective
Introduce Installment Payment Option in Magento 2 plugin.
2. Description of change
Added support for Installment Payments.
Key notes:
JavaScript
payment rendering file as 5000 THB, if minimum order is not met than plugin behave in the same way as it is in situation when user choose different payment currency than THBOmise Backend
will support sending cancellation event.pending
payment and cart is cleared byMagento
, in that case user need to re-do shopping.offsite-internetbanking.css
had definitions of styles used in checkout internet banking payment method. Renamed file to generalstyle.css
and extended styles for supporting displaying installment payment method.CCConfigProvider.php
file/class to more genericOmiseConfigProvider.php
as included alsoomise capabilities
object.Display message when 5000 THB value of order is not met.
3. Quality assurance
🔧 Environments:
✏️ Details:
To properly test it make successful payment with Installment Option and Credit Card Payment Method.
4. Impact of the change
N/A
5. Priority of change
High
6. Additional Notes
This PR requires omise/omise-php#99 to be merged first.
This PR requires new version of
omise-php
library to be released with aboveCapabilities
PR