-
Notifications
You must be signed in to change notification settings - Fork 11
Code overhaul and simplification #4
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
base: master
Are you sure you want to change the base?
Conversation
| currency: "PHP", | ||
| value: "69.00" | ||
| value: "69.00", | ||
| details: amountDetails |
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.
@andyautida14, mis-aligned tab/space?
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.
@jgfrancisco I aligned it on my lastest commit.
| code: "pm_belt", | ||
| description: "Medium-sv" | ||
| description: "Medium-sv", | ||
| quantity: "1", |
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.
alignments
|
no further comments for me. @haroldcalayan Can you review the merge request? |
|
|
||
| Information about the buyer, items inside the cart, and total amount are needed to create a new checkout. Refer to the tables below for more information. | ||
|
|
||
| ##### Checkout object |
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.
nice!
| module.exports.HttpConfig = require('./lib/paymaya/core/HttpConfig'); | ||
| module.exports.HttpConnection = require('./lib/paymaya/core/HttpConnection'); | ||
| module.exports.PaymayaApiError = require('./lib/paymaya/core/PaymayaApiError'); | ||
| module.exports.Address = require('./lib/paymaya/model/checkout/Address'); |
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.
@haroldcalayan do you have any particular design reason for including this?
|
Hi @jgfrancisco! We have designed this SDK to be same with our PHP SDK: https://github.com/PayMaya/PayMaya-PHP-SDK so developers can easily adapt whenever they want to port with other language. Removing of models can make a big difference. Are there any other reasons of removing them? Since, we can put constructors on models with required fields only so users are not forced to add unnecessary values. |
|
Hi @haroldcalayan, Noted on this. The main issue we encountered was that when we use the models, there are optional fields that are filled up with default values (empty strings) that fails the checkout validation. For our sample demo, we didn't want to delete fields from the models used. But if we use and pass custom object, it would look that we are bypassing the use of the models. So we were proposing the use of custom objects for the creation of the checkout object. Anyway, yes, it would be good if the model constructors provide required fields and have the ability to add optional fields if available cc: @andyautida14 |
@jgfrancisco please review. Thanks