Integrate a mobile banking for member to buy units

Any issue about Cyclos 4 scripting and Webservices

Moderators: hugo, alexandre, rmvanarkel

Post Reply
danker
Posts: 2
Joined: Fri Jul 07, 2017 9:34 am

Integrate a mobile banking for member to buy units

Post by danker » Sat Jul 29, 2017 8:40 am

Hello,
I need to integrate a payment solution to allow members to add units with the new payment solution.
Here is the informations I have about the new payment integration. I need to know how I should proceed to integrate it to cyclos.


3.2. WSDL (Web Service Definition Language)

<wsdl:definitions xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://service.onlinepayment.tlc.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="OnlinePayment" targetNamespace="http://service.onlinepayment.tlc.com/">
<wsdl:types>
<xs:schema xmlns:tns="http://service.onlinepayment.tlc.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://service.onlinepayment.tlc.com/" version="1.0">
<xs:element name="SendPayment" type="tns:SendPayment"/>
<xs:element name="SendPaymentResponse" type="tns:SendPaymentResponse"/>
<xs:complexType name="SendPayment">
<xs:sequence>
<xs:element minOccurs="0" name="merchantName" type="xs:string"/>
<xs:element minOccurs="0" name="transactionCode" type="xs:string"/>
<xs:element minOccurs="0" name="destMobileNumber" type="xs:string"/>
<xs:element minOccurs="0" name="amount" type="xs:string"/>
<xs:element minOccurs="0" name="extraData" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="SendPaymentResponse">
<xs:sequence>
<xs:element minOccurs="0" name="Receipt" type="tns:receipt"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="receipt">
<xs:sequence>
<xs:element minOccurs="0" name="referenceID" type="xs:string"/>
<xs:element name="status" type="xs:int"/>
<xs:element minOccurs="0" name="statusMessage" type="xs:string"/>
<xs:element minOccurs="0" name="subscriberMsisdn" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="SendPaymentResponse">
<wsdl:part element="tns:SendPaymentResponse" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:message name="SendPayment">
<wsdl:part element="tns:SendPayment" name="parameters"></wsdl:part>
</wsdl:message>
<wsdl:portType name="OnlinePaymentSoap">
<wsdl:operation name="SendPayment">
<wsdl:input message="tns:SendPayment" name="SendPayment"></wsdl:input>
<wsdl:output message="tns:SendPaymentResponse" name="SendPaymentResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="OnlinePaymentSoapBinding" type="tns:OnlinePaymentSoap">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="SendPayment">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="SendPayment">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="SendPaymentResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="OnlinePayment">
<wsdl:port binding="tns:OnlinePaymentSoapBinding" name="OnlinePaymentSoapPort">
<soap:address location="http://localhost:8098/OnlinePayment/OnlinePayment"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>










3.3. SOAP Message Request

This request will sent to the service link provided above. The request is a SOAP based language.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.onlinepayment.tlc.com/">
<soapenv:Header/>
<soapenv:Body>
<ser:SendPayment>
<!--Optional:-->
<merchantName>?</merchantName>
<!--Optional:-->
<transactionCode>?</transactionCode>
<!--Optional:-->
<destMobileNumber>?</destMobileNumber>
<!--Optional:-->
<amount>?</amount>
<!--Optional:-->
<extraData>?</extraData>
</ser:SendPayment>
</soapenv:Body>
</soapenv:Envelope>

Parameters:
Parameters Description
merchantName Nickname of the merchant that is registered on Flooz system.
transactionCode A code that will identify the product selected on that specific transaction.
destMobileNumber Mobile number of the subscriber doing the payment, must be a registered Flooz user.
extraData Any extra details for the products or the transaction.

3.4. SOAP Message Response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:SendPaymentResponse xmlns:ns2="http://service.onlinepayment.tlc.com/">
<Receipt>
<referenceID>?</referenceID>
<status>?</status>
<statusMessage>?</statusMessage>
<subscriberMsisdn>?</subscriberMsisdn>
</Receipt>
</ns2:SendPaymentResponse>
</soap:Body>
</soap:Envelope>

Parameters:
Parameters Description
referenceID The transactionCode that is sent via request.
status Status of the request. 0 if the request is successfully received.
Status Description
0 Success
1 Merchant not recognized
2 Invalid amount
3 Subscriber not registered
4 Payment impossible
5 Empty filed/s
6 Product already registered

statusMessage Message for the status of the request.
subscriberMsisdn The mobile number of the subscriber.
3.5. Confirmation

After a successful transaction, the service will send an SMS message to the subscriber about the details of the payment. The subscriber will provide his Flooz PIN in order to complete the payment. The following request will be sent to the merchant’s service in order to confirm the payment made.
The request and response will be communicated through HTTP POST via XML-RPC. The service that the merchant will provide should be able to accept an HTTP POST request with XML-RPC as a language.

3.5.1. Confirmation Request

<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>sendPaymentDetails</methodName>
<params>
<param>
<value>
<struct>
<member>
<name>amount</name>
<value>
<i4>?</i4>
</value>
</member>
<member>
<name>paid</name>
<value>?</value>
</member>
<member>
<name>expired</name>
<value>?</value>
</member>
<member>
<name>paymentRefCode</name>
<value>?</value>
</member>
<member>
<name>referenceCode</name>
<value>?</value>
</member>
<member>
<name>msisdn</name>
<value>?</value>
</member>
</struct>
</value>
</param>
</params>
</methodCall>

Parameters:
Parameters Description
amount The amount of the transaction paid.
paid Value is either true/false. If true the msisdn have done a payment.
expired Value is either true/false. There is a condition if the product is expired or not. The confirmation will send an expired true parameter if the subscriber made another payment but still has pending payment. The mobile number can only hold one transaction at a time. It has a first-in-first-out logic. The last payment will be acknowledged and the pending before that will be sent as expired transaction.
paymentRefCode This is the reference code given by the Flooz system to that transaction.
referenceCode This is the product reference code sent by the merchant.
msisdn The subscriber’s mobile number whose done the payment.

3.5.2. Confirmation Response

This response will be coming from the merchant’s service link. It will be a notification that the confirmation request has been received.

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<params>
<param>
<value>
<struct>
<member>
<name>status</name>
<value>200</value>
</member>
<member>
<name>message</name>
<value>OK</value>
</member>
</struct>
</value>
</param>
</params>
</methodResponse>

Parameters:
Parameters Description
status The status of the transaction. It will be a 200 if successfully received. Any other if there is an error.
message The message corresponding to the status.

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

Re: Integrate a mobile banking for member to buy units

Post by martin.rueegg » Thu Sep 07, 2017 6:15 am

Hi danker

You will have to create a (series of) custom operations where you collect the payment information (the parameters for your 3.3. SOAP Message Request) from the user and then evaluating the 3.4. SOAP Message Response and upon your success create a transfer from your corresponding system account (that reflects all your payment transactions) to the user's account.

Maybe have a look at the PayPal Integration

Would be great if you could post your solution here.

Martin.

PS: you also might want to re-format your initial question with XML as Code and having some structure in the rest of the text. It makes it much easier to understand.
Cyclos v4.8.2 w/ Social license
Technical Manager, Bristol Pound CIC, Bristol, UK, http://bristolpound.org

Post Reply