-
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
Display Installment terms #196
Conversation
…nly correct terms
…ons, adjusting rates
c1cea3c
to
7e3dedd
Compare
view/frontend/web/js/view/payment/method-renderer/omise-offsite-installment-method.js
Show resolved
Hide resolved
case 'bay': return 300; | ||
case 'first_choice': return 300; | ||
case 'ktc': return 300; | ||
default: return NaN; |
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 why defaulting to NaN
? Won't this break stuff if a new instalment provider appears? Or are they hardcoded?
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.
no new installment provider until we hardcode one.
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.
And if they are hardcoded, this default
is redundant?
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.
default is good practice.. that is how they taught me during studies..
it is that you have covered everything.
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.
but might delete that.. if omise has different rules.. @guzzilar
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.
getInstallmentMinimum(id) {
return {kbank:500, bbl:500}[id] || 300;
}
Would be another way to go
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.
mater of taste.. IMHO code is more readable if I show all installment terms of all brands.
they also might be changed and must come from capabilities API.
case 'bay': return 0.008; | ||
case 'first_choice': return 0.013; | ||
case 'ktc': return 0.008; | ||
default: return NaN; |
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.
Same as above
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.
it is fixed, this default is to check when testing if everything works as expected, and data is displayed, otherwise would be NaN.
But actually that default
will never affect anything as we hardcode stuff in .html
so if new provider will show up it will return NaN, but it will not be displayed anywhere in UI
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 the default
can be removed
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.
Missed this?
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.
you are looking at outdated code @jonrandy
view/frontend/web/js/view/payment/method-renderer/omise-offsite-installment-method.js
Outdated
Show resolved
Hide resolved
In the screenshot, the monthly amounts appear to be rounded to the nearest baht? This isn't right, surely? |
view/frontend/web/js/view/payment/method-renderer/omise-offsite-installment-method.js
Show resolved
Hide resolved
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
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.
Quite a few magic numbers around that really belong in config files
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.
See notes
Doesn't alter the fact it's nothing to do with the capabilities of the
merchant account
…On Tue, 28 May 2019, 18:20 jacstn, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
view/frontend/web/js/view/payment/method-renderer/omise-offsite-installment-method.js
<#196 (comment)>:
> @@ -137,7 +262,7 @@ define(
* @return {boolean}
*/
orderValueTooLow: function () {
- return window.checkoutConfig.totalsData.base_grand_total < 3000;
depends how you look at it. vat in thailand is for particular merchant his
capability, he has different VAT then in Japan.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#196?email_source=notifications&email_token=AALQWMV4BQURTKJIU2ETBYTPXUIP3A5CNFSM4HNAF5PKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOBZ25EEA#discussion_r288052038>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALQWMT6SVXDL3SL6RAYZK3PXUIP3ANCNFSM4HNAF5PA>
.
|
It should ideally be on the Omise servers for sure, but not in capabilities
API (I'm talking about VAT). It certainly doesn't belong there. Until it's
decided where it will come from, the best place for now is somewhere inside
the plugin, with some function that retrieves it. Then when/if it moves
into the API we just need change one function. Hardcoding it right in the
JS seems very bad practice.
I understand that a lot of stuff is done client side in Magento 2, but
surely there's a simple way that a bunch of bars you may want access to can
be passed to the page when it loads client side?
As for the minimum amounts etc. we've already been told these won't be in
the capability API. They aren't in the new capability API and Robin
specifically told me that they won't be
…On Tue, 28 May 2019, 21:06 jacstn, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
view/frontend/web/js/view/payment/method-renderer/omise-offsite-installment-method.js
<#196 (comment)>:
> @@ -137,7 +262,7 @@ define(
* @return {boolean}
*/
orderValueTooLow: function () {
- return window.checkoutConfig.totalsData.base_grand_total < 3000;
the same as above.. since even we were developing this functionality
minimum has been changed from 5k to 3k.. there is chance it will be changed
again.
It needs to be in capabilities.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#196?email_source=notifications&email_token=AALQWMU7VBLBMTOO5E5F7PDPXU35PA5CNFSM4HNAF5PKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOBZ3TKAA#discussion_r288123065>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AALQWMQNTAODDYV6EZ25WBLPXU35PANCNFSM4HNAF5PA>
.
|
*vars not bars
…On Tue, 28 May 2019, 21:20 Jon Randy, ***@***.***> wrote:
It should ideally be on the Omise servers for sure, but not in
capabilities API (I'm talking about VAT). It certainly doesn't belong
there. Until it's decided where it will come from, the best place for now
is somewhere inside the plugin, with some function that retrieves it. Then
when/if it moves into the API we just need change one function. Hardcoding
it right in the JS seems very bad practice.
I understand that a lot of stuff is done client side in Magento 2, but
surely there's a simple way that a bunch of bars you may want access to can
be passed to the page when it loads client side?
As for the minimum amounts etc. we've already been told these won't be in
the capability API. They aren't in the new capability API and Robin
specifically told me that they won't be
On Tue, 28 May 2019, 21:06 jacstn, ***@***.***> wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In
> view/frontend/web/js/view/payment/method-renderer/omise-offsite-installment-method.js
> <#196 (comment)>:
>
> > @@ -137,7 +262,7 @@ define(
> * @return {boolean}
> */
> orderValueTooLow: function () {
> - return window.checkoutConfig.totalsData.base_grand_total < 3000;
>
> the same as above.. since even we were developing this functionality
> minimum has been changed from 5k to 3k.. there is chance it will be changed
> again.
> It needs to be in capabilities.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#196?email_source=notifications&email_token=AALQWMU7VBLBMTOO5E5F7PDPXU35PA5CNFSM4HNAF5PKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOBZ3TKAA#discussion_r288123065>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AALQWMQNTAODDYV6EZ25WBLPXU35PANCNFSM4HNAF5PA>
> .
>
|
so you say that hardcoding in php is better practice than hardcoding in js. why? |
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.
There is one currency formatting issue remaining
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.
I think it's good to go now
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.
💯 go go go
Better format of installment minimum amount message (Merge after #196)
1. Objective
This PR added functionality to display installment terms.
2. Description of change
Hardcoded interest rates and monthly minimum payments have been added on a per-provider basis. The installment options presented to the customer at the checkout page have been modified to include monthly payment amounts and information/disclaimers about the interest rates. Payment options resulting in monthly payments below the defined minimums are automatically removed from those available for selection
3. Quality assurance
🔧 Environments:
✏️ Details:
To test this PR make payment with installment, observe if there are amounts properly displayed.
Check if minimum amounts are respected.
ie. If you choose order value for 3k THB than 12 months option should not be displayed, due to the minimum installment amount is not met in any provider.
More info about minimum installment amounts here
Check both options for absorbing rates by Merchant and Customer.
Check if TH translated texts regarding this functionality are displayed.
4. Impact of the change
N/A
5. Priority of change
High
6. Additional Notes
N/A