Skip to content

Commit

Permalink
Merge pull request #8 from genuineq/master
Browse files Browse the repository at this point in the history
!! Upgraded js SDK version to 10.js + fix configure order status after payment + Migrate tests to Cypress
  • Loading branch information
ionutcalara authored Mar 14, 2022
2 parents 1da87af + 988e6ef commit d4117b0
Show file tree
Hide file tree
Showing 46 changed files with 4,984 additions and 5,490 deletions.
44 changes: 44 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# to use orbs, must use version >= 2.1
version: 2.1
orbs:
# import Cypress orb by specifying an exact version x.y.z
# or the latest version 1.x.x using "@1" syntax
cypress: cypress-io/cypress@1
workflows:
build:
jobs:
# "cypress" is the name of the imported orb
# "run" is the name of the job defined in Cypress orb
- cypress/run:
name: Run_QUICK_tests
context:
- paylike
spec: cypress/integration/quick_test.js
filters:
branches:
only:
- master
- cypress/run:
name: Run_FULL_tests
requires:
- Run_QUICK_tests
context:
- paylike
spec: cypress/integration/full_test.js
filters:
branches:
only:
- master
# the following must run after all test passed
# to show latest supported version in repository readme.md file
- cypress/run:
name: Run_LOG_VERSION_remotely
requires:
- Run_FULL_tests
context:
- paylike
spec: cypress/integration/log_version.js
filters:
branches:
only:
- master
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ logs
.env.production
vendor
paylikepayment/build.sh
paylikepayment/builds
paylikepayment/builds
node_modules
cypress.env.json
4 changes: 3 additions & 1 deletion .tbstore/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ php_version:
- 5.6
- 7.0
- 7.1
- 7.2
- 7.2
- 7.3
- 7.4
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ You can also find information about the plugin here: https://paylike.io/plugins/

[![Last succesfull test](https://log.derikon.ro/api/v1/log/read?tag=thirtybees&view=svg&label=ThirtyBees&key=ecommerce&background=f7d43f)](https://log.derikon.ro/api/v1/log/read?tag=thirtybees&view=html)

* The plugin has been tested with most versions of Thirtybees versions at every iteration. We recommend using the latest version of Thirtybees, but if that is not possible for some reason, test the plugin with your Thirtybees version and it would probably function properly.
* *The plugin has been tested with most versions of Thirtybees versions at every iteration. We recommend using the latest version of Thirtybees, but if that is not possible for some reason, test the plugin with your Thirtybees version and it would probably function properly.*

## Installation

Expand All @@ -20,25 +20,38 @@ Once you have installed Thirtybees, follow these simple steps:
1. Signup at [paylike.io](https://paylike.io) (it’s free)
1. Create a live account
1. Create an app key for your Thirtybees website
1. Log in as administrator and upload the release zip under modules/add a new module (plus icon in the top right corner).
1. You will be redirected to a list that contains the Paylike plugin. Click the green button that says install, and then in the confirmation popup, click proceed with the installation.
1. You will be redirected to the settings screen where you need to add the Public and App key that you can find in your Paylike account.
1. Log in as administrator and upload the release zip under "Modules and services" -> Add a new module (plus icon in the top right corner).
1. It will be installed and you will be redirected to a list that contains the Paylike plugin. Click the Config button to go to the settings screen where you need to add the Public and App key that you can find in your Paylike account (https://paylike.io/).

## Updating settings

Under the extension settings, you can:
* Update the payment method text in the payment gateways list
* Update the payment method description in the payment gateways list
* Update the credit card logos that you want to show (you can change which one you accept under the paylike account).
* Update the title that shows up in the payment popup
* Update the title that shows up in the payment popup
* Update the popup description, choose whether you want to show the popup (the cart contents will show up instead)
* Add test/live keys
* Set payment mode (test/live)
* Change the capture type (Instant/Manual via Paylike Tool)


## Refunding, voiding and capturing

* To refund an order you can use the paylike tool box you can find on the order edit screen by selecting refund in the select and inputing the amount.
* To void an order you can use the paylike tool box by selecting Void.
* To capture an order in delayed mode, you can either use the status set in settings (move the order to that status), or you can use the tool.
* Change the capture type (Instant/Delayed via Paylike Tool)


## Refunding, voiding and capturing

These actions are available in order view mode, PROCESS PAYLIKE PAYMENT box/section.

* To refund an order you can use the PROCESS PAYLIKE PAYMENT box you can find on the order edit screen by selecting refund in the select and entering the amount.
* To void an order you can use the PROCESS PAYLIKE PAYMENT box by selecting Void.
* To capture an order in delayed mode, you can either use the status set in settings (move the order to that status), or you can use the PROCESS PAYLIKE PAYMENT box.

## Available features

1. Capture
* Thirtybees admin panel: full capture
* Paylike admin panel: full/partial capture
2. Refund
* Thirtybees admin panel: full/partial refund
* Paylike admin panel: full/partial refund
3. Void
* Thirtybees admin panel: full void
* Paylike admin panel: full/partial void
69 changes: 44 additions & 25 deletions Testing.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,51 @@
#Testing
#Testing with Cypress

As you can see the plugin is bundled with selenium testing on this repository. You can use the tests, if you have some experience with testing it could be helpful.
*DO NOT USE IN PRODUCTION, THE TESTS MODIFY SETTINGS AND CREATE ORDERS*
As you can see the plugin is bundled with Cypress testing on this repository. You can use the tests, if you have some experience with testing.

***DO NOT USE IN PRODUCTION, THE TESTS MODIFY SETTINGS AND CREATE ORDERS***

## Requirements

* A thirtybees installation is required, in which you need to have the sample theme installed.
* You also need to have a test client account with previous purchases and an admin account for which you set the credentials in the .env file
* Lastly you need to have the currency selector available on the frontend
* A framework/shop installation is required, in which you need to have the sample theme installed and products displayed on the homepage.
* You need to have Paylike module installed and configured (**test keys** required)
* You need to have some other currencies configured in store, then set them in `cypress.env.json` file (these will be used to make payments with every currency specified)
* You also need to have a test client account with previous purchases and an admin account for which you set the credentials in the `cypress.env.json` file
* *For testing purpose, product stock management and sending order emails need to be disabled.*

## Getting started

1. Follow 1 and 2 from the [Steward readme page](https://github.com/lmc-eu/steward#getting-started)
2. Create an env file in the root folder and add the following:
`
ENVIRONMENT_URL="https://thirtybees.url"
ENVIRONMENT_USER="username"
ENVIRONMENT_PASS="yourpassword"
ENVIRONMENT_CLIENT_USER="client_email"
ENVIRONMENT_CLIENT_PASS="client_pass"
ADMIN_PREFIX="admin251j3cm2b"
`

3. Start the testing server. See
[Steward readme page](https://github.com/lmc-eu/steward#4-run-your-tests)
4. Run ./vendor/bin/steward run staging chrome --group="thirtybees_test" -vv for the short test
5. Run ./vendor/bin/steward run staging chrome -vv to go trough all the available tests.

## Problems

Since this is a frontend test, its not always consistent, due to delays or some glitches regarding overlapping elements. If you can't get over an issue please open an issue and I'll take a look.
1. Run following commands into plugin folder (as in this repo)

```bash
npm install cypress --save-dev
```

2. Copy and rename `cypress.env.json.example` file in the root folder and fill the data as explained bellow:
```json
{
"ENV_HTTP_AUTH_ENABLED": false, // 'true' if you have HTTP auth when accessing website
"ENV_HTTP_USER": "", // if you have HTTP auth when accessing website
"ENV_HTTP_PASS": "",
"ENV_ADMIN_URL": "", // like http(s)://baseUrl/administrator
"ENV_CLIENT_USER": "", // frontend user
"ENV_CLIENT_PASS": "",
"ENV_ADMIN_USER": "", // admin user
"ENV_ADMIN_PASS": "",
"REMOTE_LOG_URL": "", // if you want to send log information about framework/shop & paylike module versions
"ENV_CURRENCY_TO_CHANGE_WITH": "USD",
"ENV_CURRENCIES_TO_TEST": ["USD", "EUR"], // currencies used to make payments with in Full test
"ENV_CARD_NUMBER": 4100000000000000,
"ENV_CARD_EXPIRY": 1226,
"ENV_CARD_CVV": 654
}
```
3. Start the Cypress testing server.
```bash
npx cypress open
```
4. In the interface, we can choose which test to run
## Getting Problems?
Since this is a frontend test, its not always consistent, due to delays or some glitches regarding overlapping elements. If you can't get over an issue please open an issue and we'll take a look.
32 changes: 0 additions & 32 deletions composer.json

This file was deleted.

Loading

0 comments on commit d4117b0

Please sign in to comment.