Payment Gateway Integration  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Payment Gateway Integration

Postby SBarnes » Sat May 02, 2020 1:42 pm

We have a customer who wants to extend the api to perform a credit check on customers before the external system will process a sale, that part of the requirement can easily be covered in a plugin that extends the api.

However if the customer is not up to date on hold or other conditions there is the requirement to collect a payment from another payment source, these may be for example PayPal, Stripe or possibly Eway, whilst I understand what is required here in terms of their api's namely that of calling their apis and providing the required data and call back URLs as I have done this before, I don't want to have to build a separate asp.net site with forms etc to provide the necessary interface to guide the user.

Is there somewhere in the current api where I can find an example of how razor pages are currently used for example to login the user etc that would be useful in working out how to incorporate this into a plugin, I intend to use the checkout facilities of the payment engine/engines so largely the forms would be to let the user know what is going on, and not for collecting secure data like credit card details which I don't want to go anywhere near.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Payment Gateway Integration  Topic is solved

Postby Mike.Sheen » Sat May 16, 2020 12:18 am

SBarnes wrote:Is there somewhere in the current api where I can find an example of how razor pages are currently used for example to login the user etc that would be useful in working out how to incorporate this into a plugin, I intend to use the checkout facilities of the payment engine/engines so largely the forms would be to let the user know what is going on, and not for collecting secure data like credit card details which I don't want to go anywhere near.


Currently we just rely on the in-built conventions of ServiceStack for razor - so in the Views folder of the Jiwa application (eg: C:\Program Files (x86)\Jiwa Financials\Jiwa 7\Views) you'll see two sample files - LoginGetRequest.cshtml and SalesOrderGETRequest.cshtml. Those names (minus the .cshtml) match the request class names - so those are used to render HTML pages when using a browser and visiting the mapped routes for the request (such as /SalesOrders/{InvoiceID} will use SalesOrderGETRequest.cshtml because in the REST API plugin we added the SalesOrderGETRequest class as the request class for /SalesOrders/{InvoiceID}).

So, if you have a custom route all you need do is add a .cshtml named the same as the request class that route requires into the Views folder and that will be used to render the razor view.

We've not done much exploring in this aspect of ServiceStack - I think mostly the HTML aspect should really be a front end web application consuming the REST API - but I see perhaps razor views served by the REST API being useful for internal / intranet purposes.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2440
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 755


Return to REST API

Who is online

Users browsing this forum: No registered users and 1 guest

cron