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.
Firstly, make sure you execute the following scripts at the project root folder, and assuming there is a ec-cube in the said directory.
git clone https://github.com/smartpay-co/ec-cube app/Plugin/Smartpay
./bin/console eccube:plugin:install --code=Smartpay ./bin/console eccube:plugin:enable --code=Smartpay
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.
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.
Open http://localhost:8000/admin (or the URL of your own admin page).
If this is a brand new EC-Cube you're working on, the default credential pair is admin/password.
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.
There are two URLs that you can configure:
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).
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.
Confirm and enable
Smartpay決済payment if it hasn't been enabled yet
Tip: Tick the
Smartpay決済checkbox in all delivery methods to avoid potential issues.
You will be redirected to Smartpay Checkout.
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.
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.
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.
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.
Your test Smartpay account will come with pre-configured card numbers so you can test all the different outcomes:
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