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

Modify Omise PrestaShop to work with PrestaShop 1.7 #47

Merged
merged 95 commits into from Nov 29, 2017

Commits on Oct 13, 2017

  1. Allow module can be installed on PrestaShop 1.7

    If the module does not allow to be installed on PrestaShop 1.7, when
    install it on PrestaShop 1.7, the module installation is failed.
    nimid committed Oct 13, 2017
    Configuration menu
    Copy the full SHA
    59a00cd View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2017

  1. Configuration menu
    Copy the full SHA
    dd99e93 View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2017

  1. Correct the image size of icon file (module logo)

    The logo is the same. Only image size has been changed.
    
    The image size has been changed to 32x32. Both PrestaShop 1.6 and 1.7
    require the same image size.
    
    References:
    - PrestaShop 1.6, http://doc.prestashop.com/display/PS16/Creating+a+first+module#Creatingafirstmodule-Theiconfile
    - PrestaShop 1.7, http://developers.prestashop.com/module/05-CreatingAPrestaShop17Module/02-CreatingAFirstModule.html#the-icon-file
    nimid committed Oct 19, 2017
    Configuration menu
    Copy the full SHA
    bd88a06 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2017

  1. Configuration menu
    Copy the full SHA
    59dc670 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e56c146 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2017

  1. Display card payment form by reuse, displayPayment

    Display card payment form by reuse the function displayPayment().
    nimid committed Oct 22, 2017
    Configuration menu
    Copy the full SHA
    40b18dd View commit details
    Browse the repository at this point in the history
  2. Remove 2 assigned variables that displayed form

    Remove 2 assigned variables that used to display at card payment form.
    The removed variables are `action` and `title`.
    
    PrestaShop 1.7 has changed the mechanism to submit payment form.
    It will generated a submit button for all payment options.
    
    So, each payment option will be changed to override the action of the
    PrestaShop 1.7. instead of has it own action.
    
    The `title` at the top of the payment form has changed to be displayed
    at the payment option instead. So, display the title at the top of
    payment form is unnecessary and duplicated.
    nimid committed Oct 22, 2017
    Configuration menu
    Copy the full SHA
    5c8efbe View commit details
    Browse the repository at this point in the history
  3. Remove submit payment button at card payment form

    For PrestaShop 1.7, submit payment button is unnecessary. To submit
    payment, it will be changed to override the action of PrestaShop 1.7
    instead.
    nimid committed Oct 22, 2017
    Configuration menu
    Copy the full SHA
    e0b9e18 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    75a7512 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    22cc4b8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8d4faa6 View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2017

  1. Configuration menu
    Copy the full SHA
    7df1d25 View commit details
    Browse the repository at this point in the history
  2. Use the correct function to display payment form

    The correct function of PrestaShop 1.7 new API that used to display card
    payment form is `setForm()`.
    
    It is not function, `setAdditionalInformation()`.
    
    References:
    - http://developers.prestashop.com/module/50-PaymentModules/index.html#paymentoption
    - https://github.com/PrestaShop/paymentexample/blob/master/paymentexample.php#L143
    nimid committed Oct 23, 2017
    Configuration menu
    Copy the full SHA
    e65e8bf View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2017

  1. Define a constant to identify card payment option

    Define a constant to be the identifier for card payment option. This
    constant will be used at the front office, payment step, payment
    options.
    nimid committed Oct 24, 2017
    Configuration menu
    Copy the full SHA
    a5f3d32 View commit details
    Browse the repository at this point in the history
  2. Modify JavaScript to create Omise card token

    Modify JavaScript in card payment page to create Omise card token.
    
    The mechanism to submit payment for support PrestaShop 1.7 has been
    changed from the module has it own submit payment button to using the
    submit payment button that PrestaShop generated.
    nimid committed Oct 24, 2017
    Configuration menu
    Copy the full SHA
    0285c64 View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2017

  1. Configuration menu
    Copy the full SHA
    a83e627 View commit details
    Browse the repository at this point in the history
  2. Re-add missing condition, Is Omise.js accessible?

    Re-add a missing JavaScript condition. This condition is lost during
    the modification of previous commit.
    
    This condition is check whether the external library, Omise.js,
    is accessible. If Omise.js is not accessible, the error message will be
    displayed. The reason that Omise.js is not accessible, may be from the
    slow connection or timeout.
    
    The Omise.js is an important library that used to create Omise card
    token at the client side.
    
    Without this condition, the customer (payer) can not clearly know the
    problem when submit payment with Omise card payment. The error will be
    not displayed visually. It will be displayed at the console of web browser.
    That is not easy for customer to know the problem.
    nimid committed Oct 25, 2017
    Configuration menu
    Copy the full SHA
    0b9b6f1 View commit details
    Browse the repository at this point in the history
  3. Remove an unnecessary <p> tag

    Remove an unnecessary <p> tag in the card payment page, payment.tpl.
    
    This <p> tag contains <div>, which it is improper and it causes an error
    when the debug mode has been activated. In normal mode, the error does not
    appear.
    
    The error has been displayed at the checkout step, full page.
    
    The debug mode can be activated by go to PrestaShop back office,
    from the left menu, CONFIGURE > Advanced Parameters > Performance >
    DEBUG MODE.
    
    Reference:
    - W3C <p> tag recommendation, https://www.w3.org/TR/html401/struct/text.html#h-9.3.1
    nimid committed Oct 25, 2017
    Configuration menu
    Copy the full SHA
    8d01904 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    993d8d5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d00c4ab View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2017

  1. Submit card token from client to create charge

    Pass the action URL from server side to client side.
    
    At the client side, if the Omise card token has been successfully
    created, it will be submitted from client side to server side for create
    Omise charge at server side.
    nimid committed Oct 26, 2017
    Configuration menu
    Copy the full SHA
    b78024f View commit details
    Browse the repository at this point in the history
  2. Change a parameter key from objOrder to order

    PrestaShop 1.7 new payment API has changed the parameters passed to `hookDisplayOrderConfirmation()`.
    
    The impact is key that used to retrieved current order has been changed
    from `objOrder` to `order`.
    
    Without this commit, the system will crash, view can not be rendered.
    
    Reference:
    - http://build.prestashop.com/news/module-development-changes-in-17/#before
    nimid committed Oct 26, 2017
    Configuration menu
    Copy the full SHA
    3706c5c View commit details
    Browse the repository at this point in the history
  3. Change parameter for a function setTemplate()

    PrestaShop 1.7 has changed the parameter syntax that passed to function
    `setTemplate()`.
    nimid committed Oct 26, 2017
    Configuration menu
    Copy the full SHA
    716827d View commit details
    Browse the repository at this point in the history
  4. Modify order confirmation template for PS 1.7

    Modify order confirmation template. Make it consistent with PrestaShop
    1.7.
    nimid committed Oct 26, 2017
    Configuration menu
    Copy the full SHA
    dc69238 View commit details
    Browse the repository at this point in the history
  5. Modify order payment error template for PS 1.7

    Make it consistent with PrestaShop 1.7.
    nimid committed Oct 26, 2017
    Configuration menu
    Copy the full SHA
    ccb521d View commit details
    Browse the repository at this point in the history
  6. Override the display of page_content_container

    Override the display of `page_content_container` in order payment error
    template, payment-error.tpl.
    
    This override prevents the unnecessary display of blank content that
    come from page.tpl which this template, payment-error.tpl, has extended.
    nimid committed Oct 26, 2017
    Configuration menu
    Copy the full SHA
    d340b36 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    174a656 View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2017

  1. Configuration menu
    Copy the full SHA
    1a9f642 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2017

  1. Prevent error notice at setting page on debug mode

    In the setting page, it has a variable, `confirmation`. This variable is
    used for display the confirmation message when the merchant saved the
    setting.
    
    If merchant enabled the debug mode and open the setting page, the system
    displays the error message popup, Undefined index: confirmation.
    
    This problem is occurred because at the time that merchant open the setting
    page and does not save the setting. The variable, `confirmation`,
    has not been assigned any value from server side to display any message.
    
    This problem is not occurred in normal mode.
    nimid committed Oct 28, 2017
    Configuration menu
    Copy the full SHA
    ec295ba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    80e38ab View commit details
    Browse the repository at this point in the history
  3. Modify hookPaymentOptions() to display IB option

    Modify a function, Omise.hookPaymentOptions(). to display internet
    banking payment option.
    nimid committed Oct 28, 2017
    Configuration menu
    Copy the full SHA
    357c360 View commit details
    Browse the repository at this point in the history
  4. Remove an unnecessary <p> tag at IB form

    Remove an unnecessary <p> tag in the internet banking payment form.
    
    This <p> tag contains <div>, which it is improper and it causes an error
    when the debug mode has been activated. In normal mode, the error does not
    appear.
    
    Reference:
    - W3C <p> tag recommendation, https://www.w3.org/TR/html401/struct/text.html#h-9.3.1
    nimid committed Oct 28, 2017
    Configuration menu
    Copy the full SHA
    8e842a3 View commit details
    Browse the repository at this point in the history
  5. Format HTML code in IB form, correct indentation

    Format HTML code in the internet banking payment form, correct the
    indentation.
    nimid committed Oct 28, 2017
    Configuration menu
    Copy the full SHA
    1ebed5d View commit details
    Browse the repository at this point in the history
  6. Remove submit payment button in IB payment form

    Remove a submit payment button in internet banking payment form.
    
    The mechanism to submit payment in PrestaShop 1.7 has been changed to
    PrestaShop 1.7 will automatically generated a submit payment button. The
    payment module need to use this generated button to submit payment.
    nimid committed Oct 28, 2017
    Configuration menu
    Copy the full SHA
    07d92d3 View commit details
    Browse the repository at this point in the history
  7. Remove a header in internet banking payment form

    PrestaShop 1.7 has the payment option displayed the name of each payment
    module. So, the header at the top of internet banking payment form is
    duplicated and unnecessary.
    nimid committed Oct 28, 2017
    Configuration menu
    Copy the full SHA
    a357c9c View commit details
    Browse the repository at this point in the history
  8. Remove client-side script at IB form

    Remove client-side script, JavaScript, at internet banking payment form.
    
    The script will be re-written to make it work with PrestaShop 1.7
    in the next commit.
    nimid committed Oct 28, 2017
    Configuration menu
    Copy the full SHA
    0382f32 View commit details
    Browse the repository at this point in the history
  9. Correct the image path that display bank logo

    Correct the image path that display bank logo in internet banking
    payment form.
    nimid committed Oct 28, 2017
    Configuration menu
    Copy the full SHA
    b58125a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    cbfa36d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    16a1fca View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2017

  1. Correct invalid HTML tag in inapplicable template

    Correct invalid HTML tag in inapplicable payment template.
    nimid committed Oct 30, 2017
    Configuration menu
    Copy the full SHA
    4013bf3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    66dd81e View commit details
    Browse the repository at this point in the history
  3. Remove Omise.hookPayment()

    This function was using with PrestaShop 1.6 but it is not using with
    PrestaShop 1.7.
    nimid committed Oct 30, 2017
    Configuration menu
    Copy the full SHA
    b722c74 View commit details
    Browse the repository at this point in the history
  4. Remove duplicated condition, check currency

    Remove duplicated condition, current currency checking. This logic
    has been refactored and used in functions, generateCardPaymentOption()
    and generateInternetBankingPaymentOption().
    nimid committed Oct 30, 2017
    Configuration menu
    Copy the full SHA
    4b5b8f9 View commit details
    Browse the repository at this point in the history
  5. Remove inapplicable IB payment template

    Remove a function, displayInapplicableInternetBankingPayment(), that
    displayed inapplicable internet banking payment template.
    
    This template is not used. According to the refactoring, the message in
    template has been shared and used by using function,
    displayInapplicablePayment();
    nimid committed Oct 30, 2017
    Configuration menu
    Copy the full SHA
    100c1c5 View commit details
    Browse the repository at this point in the history
  6. Refactor, change payment to card payment

    Currently, Omise payment module has more than one payment option (payment
    method), card payment and internet banking payment.
    
    Using word, payment, that is general for the payment module that has only
    one payment option is understandable but for the payment module that has
    more than one payment method, using specific word for each payment
    option is more understandable.
    nimid committed Oct 30, 2017
    Configuration menu
    Copy the full SHA
    7fc7d3b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a887fdc View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2017

  1. Develop client-side script to submit IB payment

    Develop client-side script, JavaScript, to submit internet banking
    payment to server side.
    
    The script was developed to work with PrestaShop 1.7.
    nimid committed Oct 31, 2017
    Configuration menu
    Copy the full SHA
    d27a513 View commit details
    Browse the repository at this point in the history
  2. Show popup message, if no any bank selected

    Display popup warning message before submit internet banking payment, if
    no any bank on internet banking payment form has been selected.
    nimid committed Oct 31, 2017
    Configuration menu
    Copy the full SHA
    0006885 View commit details
    Browse the repository at this point in the history
  3. Unuse deprecated function, Order.getOrderByCartId

    Unuse a PrestaShop deprecated function Order.getOrderByCartId().
    
    Use function, Order.getIdByCartId(), instead.
    nimid committed Oct 31, 2017
    Configuration menu
    Copy the full SHA
    49a4afd View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2017

  1. Change HTML ID in IB form, separate by hyphen (-)

    Change the HTML ID of elements in internet banking payment form. The
    style has been changed from camel case to be separated with hyphen.
    nimid committed Nov 1, 2017
    Configuration menu
    Copy the full SHA
    4a8eabf View commit details
    Browse the repository at this point in the history
  2. Remove an unused CSS class, no-uniform

    Remove an unused CSS class, no-uniform, in internet banking payment
    form.
    
    For PrestaShop 1.6, it requires this CSS rule to make the display of
    internet banking form consistent.
    
    But for PrestaShop 1.7, this CSS class, no-uniform, is not required.
    nimid committed Nov 1, 2017
    Configuration menu
    Copy the full SHA
    a27382a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5e5ac28 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c7d7905 View commit details
    Browse the repository at this point in the history
  5. Move unit test files correspond to the actual file

    Move unit test files that tested controller classes to under the directory,
    front, correspond to the actual file.
    nimid committed Nov 1, 2017
    Configuration menu
    Copy the full SHA
    0690313 View commit details
    Browse the repository at this point in the history
  6. 3DS, unuse deprecated function, getOrderByCartId()

    For the 3-D Secure payment, unuse a PrestaShop deprecated function
    Order.getOrderByCartId().
    
    Use function, Order.getIdByCartId(), instead.
    nimid committed Nov 1, 2017
    Configuration menu
    Copy the full SHA
    9875a27 View commit details
    Browse the repository at this point in the history
  7. Charge class, unuse deprecated, getOrderByCartId()

    For a class, OmiseChargeClass, unuse a PrestaShop deprecated function
    Order.getOrderByCartId().
    
    Use function, Order.getIdByCartId(), instead.
    nimid committed Nov 1, 2017
    Configuration menu
    Copy the full SHA
    0389866 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2017

  1. Configuration menu
    Copy the full SHA
    968c658 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2017

  1. Configuration menu
    Copy the full SHA
    4a524b3 View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2017

  1. Partially add unit test for a controller class

    Partially add unit test cases for a controller class,
    OmiseReturnModuleFrontController.
    
    The unit test for this class can not be additionally added because this
    class has a hard dependency (new keyword) with a class, Order, and access
    to many public properties of Order class (e.g. $this->order->reference).
    
    This condition makes the mocking public property for hard dependency
    difficult.
    
    Another solution is adding a setter for the $this->order but this
    solution needs to modify the actual code that it is not requires in this
    time.
    nimid committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    f443c21 View commit details
    Browse the repository at this point in the history
  2. Unit test, add a mocked method for base controller

    Modify unit tests. Add a mocked method, l, to all unit test that related
    with OmiseBasePaymentModuleFrontController class.
    nimid committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    a3a6e1e View commit details
    Browse the repository at this point in the history
  3. Unit test, add missing Mockery container clean up

    Add a missing Mockery container clean up for a unit test class,
    OmiseInternetBankingPaymentModuleFrontControllerTest.
    
    Without this clean up, it will has an error when run all unit test. The
    error is "The mock named '\Order' has been already defined".
    nimid committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    0ca4dd2 View commit details
    Browse the repository at this point in the history
  4. Unit test, extend MockeryTestCase & unuse m::close

    Modify all unit tests that using Mockery.
    
    1. Change the extend class from
    PHPUnit_Framework_TestCase to Mockery\Adapter\Phpunit\MockeryTestCase.
    
    2. Remove all m::close(), after changed to extends from MockeryTestCase,
    the close method is automatically called.
    
    Reference:
    - http://docs.mockery.io/en/latest/reference/phpunit_integration.html
    nimid committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    52b1b73 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2017

  1. Refactor, change a param name of PaymentOrder.save

    Modify a name of parameter of a function, PaymentOrder.save().
    Change a name of parameter from $order_state to $id_order_state.
    
    Make the name consistent with PrestaShop. An example from PrestaShop
    function is PaymentModule.validateOrder().
    
    A parameter that PaymentOrder.save() required is ID of order status.
    Using $order_state (before change) can be confused that it is the
    instance of OrderState class.
    nimid committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    f2ebc84 View commit details
    Browse the repository at this point in the history
  2. Refactor, PaymentOrder.save() required order state

    Modify a parameter of a function, PaymentOrder.save(). The
    $id_order_state is required.
    nimid committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    c92a638 View commit details
    Browse the repository at this point in the history
  3. Saving an order can be specified payment method

    Change parameters of function, PaymentOrder.save()
    
    Add a parameter, $payment_method, to the second input parameter.
    nimid committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    a92c0b5 View commit details
    Browse the repository at this point in the history
  4. Remove a function, PaymentOrder.saveAsProcessing()

    Makes the module has only one function, gate or place to save an order.
    
    A function that used to save an order is PaymentOrder.save().
    nimid committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    de58ae7 View commit details
    Browse the repository at this point in the history
  5. Change IB payment, save order with payment method

    Change internet banking payment. Make it save an order with its payment
    method name.
    nimid committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    9c45de3 View commit details
    Browse the repository at this point in the history
  6. Change card payment save order with payment method

    Change card payment. Make it save an order with its payment method name.
    nimid committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    e340572 View commit details
    Browse the repository at this point in the history
  7. Change 3DS payment, save order with payment method

    Change 3-D Secure payment. Make it save an order with its payment method
    name.
    nimid committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    aa74c2d View commit details
    Browse the repository at this point in the history
  8. Check module of saved order when return from Omise

    Check the module name of saved order when return from Omise API.
    
    According to the payment method of saved order has been dynamically
    saved follows the payment method that customer selected. Such as card
    payment or internet banking payment.
    
    Therefor, payment method of saved order (order->payment) is variable.
    It can not be used to check whether the order is the order that made
    payment with Omise.
    
    So, using module name of saved order (order->module) to check with
    Omise.MODULE_NAME is properly.
    nimid committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    ce9ebd3 View commit details
    Browse the repository at this point in the history
  9. Modify unit tests follow the actual source code

    Reduced the duplicated mocking source code by move it to the
    autoload.php.
    nimid committed Nov 7, 2017
    Configuration menu
    Copy the full SHA
    9befecc View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2017

  1. Configuration menu
    Copy the full SHA
    f215d2d View commit details
    Browse the repository at this point in the history

Commits on Nov 11, 2017

  1. Configuration menu
    Copy the full SHA
    10faecc View commit details
    Browse the repository at this point in the history
  2. Attach order ID to metadata when create IB charge

    Attach order ID to metadata when create Omise internet banking charge.
    nimid committed Nov 11, 2017
    Configuration menu
    Copy the full SHA
    e42e47a View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2017

  1. Add order ID to charge metadata for card payment

    Append PrestaShop order ID to Omise charge metadata when creating a card
    payment (normal card payment and 3DS payment).
    nimid committed Nov 13, 2017
    Configuration menu
    Copy the full SHA
    de76143 View commit details
    Browse the repository at this point in the history
  2. Change flow when creating payment by card

    This commit affects normal card payment only. 3DS payment is not
    affected.
    
    The objective of this commit is to append PrestaShop order ID to the
    metadata of Omise charge.
    
    The flow has been changed to save an order as processing at the first
    step and uses that generated order ID to append to the metadata of Omise charge.
    nimid committed Nov 13, 2017
    Configuration menu
    Copy the full SHA
    dc4a32e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    24e35ff View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e5e0bc1 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d93257d View commit details
    Browse the repository at this point in the history

Commits on Nov 16, 2017

  1. Configuration menu
    Copy the full SHA
    05b53b5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e2513eb View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2017

  1. Add an empty front module controller for webhooks

    Add a front office controller that will be used to handle the webhooks
    request from Omise server.
    
    For this commit, the controller has no any logic. It does only display
    the empty page. The logic will be implemented in the next commits.
    nimid committed Nov 17, 2017
    Configuration menu
    Copy the full SHA
    e8e9c00 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ce98674 View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2017

  1. Develop a new class, OmiseLogger, for write log

    This class wrapped the PrestaShop logger class, Logger. The Logger class
    requires some parameters which they are not required or compatibled with
    module such as $object_id or $object_type. The data type of $object_id is
    int but the data type of Omise object id is string or $object_type is
    the internal PrestaShop object, etc.
    
    So, the wrapper class, OmiseLogger, has reduced the parameters that it is
    not used by provides the necessary parameters, $message and $severity.
    And $severity is optional the default value of $severify is info log
    level.
    
    The same log message can be added to database because OmiseLogger has
    set a parameter, $allow_duplicate, to be true. It has the intent that
    the same log message but differnt time can be added to database.
    nimid committed Nov 19, 2017
    Configuration menu
    Copy the full SHA
    24f5e76 View commit details
    Browse the repository at this point in the history
  2. Add constants of Omise charge, failed & successful

    Theses constants will be used for webhooks in the step of checking the
    status of charge.
    nimid committed Nov 19, 2017
    Configuration menu
    Copy the full SHA
    47918fa View commit details
    Browse the repository at this point in the history
  3. Add a function to get PS order ID from transaction

    Add a function OmiseTransactionModel.getIdOrder(), to retrieve a
    PrestaShop order ID from omise transaction table.
    
    This function is search by using Omise charge ID.
    nimid committed Nov 19, 2017
    Configuration menu
    Copy the full SHA
    d75524a View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2017

  1. Configuration menu
    Copy the full SHA
    83bf51e View commit details
    Browse the repository at this point in the history
  2. Add a unit test for OmiseEventHandler

    The unit test in this commit has only one test case because in actual
    class, OmiseEventHandler, in has a static class attribute dependency,
    OmiseEventChargeComplete::KEY, and a hard dependency (new Keyword),
    new OmiseEventChargeComplete(), with the same class. This situation is
    hard to create mock for unit testing.
    
    So, a unit test case in this commit that test class, OmiseEventHandler,
    is the test case that across the dependency that hard to mock.
    nimid committed Nov 20, 2017
    Configuration menu
    Copy the full SHA
    e15d012 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    314cc4d View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2017

  1. Remain status, processing, if charge is not paid

    Remains the PrestaShop order status to be Processing in progress, if
    Omise charge is not paid.
    
    This commit has an objective to solve the possible problem of offsite
    payment such as internet banking payment that the notification from bank
    server to Omise server is delayed and Omise can not knows or updates the
    charge status.
    
    For the internet banking payment, when the payer completed their payment
    on bank website and bank redirects payer back to PrestaShop site.
    
    In this step, it is possible that the notification from bank server to
    Omise server can be deplayed or slower than the redirection of payer.
    This situation causes the charge status is pending and charge is not
    paid because Omise does not know the status of payment.
    
    So, it is safer that if the charge is not paid the PrestaShop order
    status still Processing in progress.
    
    Note:
    The implementation of webhooks to prevent this problem by correctly
    synchronize the charge information between PrestaShop order and Omise
    charge has been completed in the previous commits.
    nimid committed Nov 21, 2017
    Configuration menu
    Copy the full SHA
    a2fbefe View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2017

  1. Configuration menu
    Copy the full SHA
    07b02c8 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2017

  1. Correctly handle the Omise charge status of paid

    When the payer has been redirected back to PrestaShop, the module, Omise
    PrestaShop, will checks the information of Omise charge by request the
    information via Omise API.
    
    Before change:
    If Omise charge is NOT paid, the empty error message on the order
    confirmation page will be displayed. This result is not correct and properly
    because in this step, the PrestaShop order is valid and Omise charge is
    not failed. The status of Omise charge is not paid. It does not mean
    that the payment is error.
    
    After change:
    The success order confirmation page is display normally. Regardless of
    Omise charge status is paid or unpaid.
    
    The main objective of before change and after change still the same. If the
    Omise charge is paid, the PrestaShop order status will be updated
    to be success (Payment accepted).
    nimid committed Nov 28, 2017
    Configuration menu
    Copy the full SHA
    f23dc15 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #48 from omise/correctly-handle-omise-charge-when-…

    …redirect-back-to-prestashop
    nimid committed Nov 28, 2017
    Configuration menu
    Copy the full SHA
    e2d7b0e View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2017

  1. Remove a condition checking PS order status

    Remove a condition that checking current PrestaShop order status,
    when redirect payer back to PrestaShop site.
    
    This commit has an objective to solve a problem of internet banking
    payment. The problem occurs in the situation that;
    
    the redirection of payer back to PrestaShop site is slower than the
    payment result notification from bank to Omise and Omise charge of this
    payment is failed.
    
    This situation causes the invalid result message on PrestaShop order
    confirmation page.
    
    Note:
    Due to the offsite payment that has the redirection flow such as
    internet banking payment, including the implementation of Omise
    webhooks, it is possible that;
    
    - Omise charge is failed.
    - The notification from bank to Omise was passed or forwarded to the
    PrestaShop site via Omise webhooks FASTER THAN the redirection of payer
    to PrestaShop.
    - Omise PrestaShop handles this webhooks event by change the PrestaShop
    order status to be Canceled.
    
    So, this condition or situation causes the invalid result message on
    PrestaShop order confirmation page.
    nimid committed Nov 29, 2017
    Configuration menu
    Copy the full SHA
    7a1af48 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #49 from omise/remove-checking-of-order-status-whe…

    …n-redirect-back-to-prestashop
    nimid committed Nov 29, 2017
    Configuration menu
    Copy the full SHA
    215ee12 View commit details
    Browse the repository at this point in the history