EC Cube
Before getting started with the following steps, please make sure you have a working EC-Cube v4 codebase ready and make sure you meet all the requirements provided by the official documentation.
Installation
Firstly, make sure you execute the following scripts at the project root folder, and assuming there is a ec-cube in the said directory.
Download our plugin to the plugin folder
git clone https://github.com/smartpay-co/ec-cube app/Plugin/Smartpay
Install and enable the Smartpay plugin
./bin/console eccube:plugin:install --code=Smartpay
./bin/console eccube:plugin:enable --code=Smartpay
Configuration
We need you to run the EC-Cube server before you can continue with the following set-ups. Please follow EC-Cube's official guide to get it running on your end.
Tips for getting the server running
Starting from PHP v5.4+
, it comes with a built-in web server. While it's not meant to be a full-featured web server, it serves the purpose for developement well.
You could simply do the following to get it running effortlessly:
php -S localhost:8000
We will use the above said server as an example for the following steps.
Admin configs
Open http://localhost:8000/admin (or the URL of your own admin page).
Tips
If this is a brand new EC-Cube you're working on, the default credential pair is admin/password.
API Keys
Enter Smartpay Management on the left navigation bar and fill in the proper keys. You can find your credentials at the settings > credentials page on your dashboard.


Callback URLs
There are two URLs that you can configure: successURL
and cancelURL
for your successful and canceled use cases.
By default, the example URLs will be set automatically. However, you can, and usually should set your own. You can do so in Smartpay Management
too, see below:


If you set your own callback URLs, make sure you handle the order and the cart properly in the code for those routes (usually within the controllers).
Enable Smartpay
Although Smartpay should already be enabled in our earlier steps, we recommend you double-check the following configs on EC-Cube Admin just to make sure. If any of the following is not yet enabled, please make sure it is.
- In
Payment Method
Confirm and enableSmartpay決済
payment if it hasn't been enabled yet


- In
Delivery Method




Tip: Tick the
Smartpay決済
checkbox in all delivery methods to avoid potential issues.
Congratulations!
Your users can now checkout with Smartpay. All they have to do is to select *Smartpay決済* as the payment method.


Redirected to Smartpay Checkout
You will be redirected to Smartpay Checkout.
Testing
We aim to provide the smoothest developer experience, hence we make it straightforward for you to test your integration.
When testing please use your test keys to create a checkout session and launch Smartpay checkout. In test mode the payment is not processed by card networks or payment providers. It enables you to feel safe working on the integration without having to worry about actually being charged.
Test mode checkout will show a テスト中 banner on the top right corner so you can easily verify you are using test mode.
Test consumer account
To complete a test mode checkout you need a test user account. Please follow the instructions below to sign up as a test user to Smartpay.
EMAIL ADDRESS
Once you are redirected to Smartpay checkout, all you need to do is to use any email with a +test
suffix, e.g. [email protected]
to sign up, and it will immediately be regarded as a test account.
PHONE NUMBER
When prompted for a phone number please provide a valid Japanese mobile number.
Smartpay verifies the shoppers' phone number by sending a one time password via SMS to the phone number specified during sign up. For test accounts however this one time password is not sent via SMS, it is already pre-filled for you on the form.
CARD NUMBER
Your test Smartpay account will come with pre-configured card numbers so you can test all the different outcomes:
- Success:
4242 4242 4242 4242
- Hard decline:
4100 0000 0000 0019
- Soft decline:
4000 0000 0000 0119
For test consumers you will not be able to add your own card or use Apple Pay or Google Pay.
Updated 4 months ago