[Fixed in v4.8.2] /pay endpoint not working

Any issue about installation and configuration of the Cyclos 4 version

Moderators: hugo, alexandre, rmvanarkel

Post Reply
martin.rueegg
Posts: 80
Joined: Thu Aug 11, 2016 12:38 pm
Location: Bristol, UK
Contact:

[Fixed in v4.8.2] /pay endpoint not working

Post by martin.rueegg »

Hi all

v4.8 of Cyclos supports web shop tickets:
https://wiki4.cyclos.org/index.php/Easy ... _ticketing

We have tried to set this up. Unfortunately, the example/documentation on the above wiki is still outstanding. The problem is, that I can create the tickets using the web service, however, when accessing the /pay URL, there is just a blank page and the access_log of apache shows 404 errors for all of the following files:

Code: Select all

/pay/inline.a6bb6db930a24116e434.bundle.js
/pay/vendor.b030715dbe75bc65ac86.bundle.js
/pay/scripts.826d4ad805f96734e1fe.bundle.js
/pay/main.cd2f7bd3a2739812c447.bundle.js
/pay/polyfills.0823f5905c9559d20ffb.bundle.js
However, all those files exist on the server:

Code: Select all

 tomcat/webapps/cyclos/pay/3rdpartylicenses.txt
 tomcat/webapps/cyclos/pay/index.html
 tomcat/webapps/cyclos/pay/inline.a6bb6db930a24116e434.bundle.js
 tomcat/webapps/cyclos/pay/main.cd2f7bd3a2739812c447.bundle.js
 tomcat/webapps/cyclos/pay/polyfills.0823f5905c9559d20ffb.bundle.js
 tomcat/webapps/cyclos/pay/scripts.826d4ad805f96734e1fe.bundle.js
 tomcat/webapps/cyclos/pay/styles.23cc7a85aad7135d4a0d.bundle.css
 tomcat/webapps/cyclos/pay/vendor.b030715dbe75bc65ac86.bundle.js
Is there anything in the configuration (of the web server, or cyclos), that needs to be changed?

I have obviously adapted the rights on the products to allow tickets.

Thanks,
Martin.

-----

Steps to reproduce:
  1. install the Cyclos PHP library, v4.8
  2. create a ticket number using the webservice
  3. access the pay url to pay the ticket
The library can be installed using our packagist/composer repo:

Code: Select all

composer require bristolpound/cyclos-php-library
The test file to create a user is

Code: Select all

<?php

require 'vendor/autoload.php';

Cyclos\Configuration::setRootUrl("https://dev-bristol.community-currency.org/cyclos/bristolpound");
Cyclos\Configuration::setAuthentication("user", "password"); //these credentials won't work!

$ticketService = new Cyclos\TicketService();

$query = new stdclass();
$query->amount = 5.30;
$query->description = "Real Economy Order #3021";
$query->cancelUrl = "http://www.dictionary.com/browse/cancel?thisisthecacnelurl";
$query->successUrl = "http://www.dictionary.com/browse/success?thisisthesuccessurl";
$query->type = "member.individual2member";

$ticket = $ticketService->create($query);

print_r($ticket);
Which would return:

Code: Select all

stdClass Object
(
    [class] => org.cyclos.model.banking.transactions.TicketVO
    [expirationDate] => 2017-08-09T17:28:01.313+01:00
    [ticketNumber] => xJLDFesYS7xcBAnAzAudWMBwFvJlJNf3
    [cancelUrl] => http://www.dictionary.com/browse/cancel?thisisthecacnelurl
    [successUrl] => http://www.dictionary.com/browse/success?thisisthesuccessurl
    [status] => OPEN
    [customValues] => Array
        (
        )

    [channel] => stdClass Object
        (
            [class] => org.cyclos.model.access.channels.ChannelVO
            [global] => 1
            [internalName] => webServices
            [id] => 2068777009450863609
            [name] => Web services
        )

    [fromOwner] => stdClass Object
        (
            [class] => org.cyclos.model.users.users.UserDetailedVO
            [display] => Real Economy CoOperative Ltd
            [shortDisplay] => realeconomy
            [id] => 2068777009451305465
        )

    [nature] => TICKET
    [currencyAmount] => stdClass Object
        (
            [class] => org.cyclos.model.utils.CurrencyAmountDTO
            [amount] => 5.30
            [currency] => stdClass Object
                (
                    [class] => org.cyclos.model.banking.currencies.CurrencyVO
                    [precision] => 2
                    [global] =>
                    [transactionNumberPattern] => \B\P########
                    [symbol] => £B
                    [transactionNumberPrefix] => BP
                    [internalName] => bristolpound
                    [id] => 2068777009450862841
                    [name] => Bristol Pound
                )

        )

    [transactionNumber] => BP00199563
    [date] => 2017-08-08T17:28:01.313+01:00
    [type] => stdClass Object
        (
            [class] => org.cyclos.model.banking.transfertypes.TransferTypeVO
            [to] => stdClass Object
                (
                    [class] => org.cyclos.model.banking.accounttypes.AccountTypeVO
                    [nature] => USER
                    [global] =>
                    [internalName] => member
                    [id] => 2068777009450864377
                    [name] => Member Account
                )

            [nature] => PAYMENT
            [requiresAuthorization] =>
            [from] => stdClass Object
                (
                    [class] => org.cyclos.model.banking.accounttypes.AccountTypeVO
                    [nature] => USER
                    [global] =>
                    [internalName] => member
                    [id] => 2068777009450864377
                    [name] => Member Account
                )

            [ignoreAccountLimits] =>
            [allowFromCustomName] =>
            [allowToCustomName] =>
            [enabled] => 1
            [internalName] => member.individual2member
            [id] => 2068777009450865145
            [name] => Online Payment from Individual Account
        )

    [description] => Real Economy Order #3021
    [id] => 2068777009404957689
)
With the ticket number generated: xJLDFesYS7xcBAnAzAudWMBwFvJlJNf3. Accordingly, the URL to pay the ticket would be:
https://dev-bristol.community-currency. ... BwFvJlJNf3

I've also tried
Last edited by martin.rueegg on Wed Sep 06, 2017 7:37 am, edited 1 time in total.
Cyclos v4.8.2 w/ Social license
Technical Manager, Bristol Pound CIC, Bristol, UK, http://bristolpound.org

admin
Site Admin
Posts: 1423
Joined: Mon Jan 24, 2005 10:31 am

Re: [v4.8] Config for paying a webshop ticket

Post by admin »

There is indeed a bug in 4.8.1.
We will launch 4.8.2 very soon.
I will send you a intermediate version with the fix.
Sorry for the inconvenience.

martin.rueegg
Posts: 80
Joined: Thu Aug 11, 2016 12:38 pm
Location: Bristol, UK
Contact:

Re: [Fixed in v4.8.2] /pay endpoint not working

Post by martin.rueegg »

Yep, fixed.

Thanks,
Martin.
Cyclos v4.8.2 w/ Social license
Technical Manager, Bristol Pound CIC, Bristol, UK, http://bristolpound.org

Post Reply