Skip to content

Instantly share code, notes, and snippets.

@shareefhiasat
Last active May 12, 2017 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shareefhiasat/7d56e95e672854a7fc8ec41686190ae0 to your computer and use it in GitHub Desktop.
Save shareefhiasat/7d56e95e672854a7fc8ec41686190ae0 to your computer and use it in GitHub Desktop.
separation of buy ticket
keep in mind that buyticket process
handle
three main concepts aswell as parameter in url added it iwll behave different to backend
var invitationToken = '';
var accessToken = '';
var tokenRequest = '';
challenges are:
challenge for apply separation for sajilni clients
1)Return url
when you are done with buying we need to go back to page that we were on
for example event page when user click buy the buy page Must be on same page and when user finish or cancle or decclinet ... he will be back to event page
same for admin orders
2)Finish url
we store cookie(we have cookie js lib) on client browser (third party) so the client wants his visitors to return to his website after buying
3)auto buy
for example we usually give url with its end there is autoBuyClick =1 when user clicks it it will take hime for example(always) to event page or organizer page and it will open buying modal(previously)automatilly
when we separate we must handle that case.
* a sample of dowload image here
https://gist.github.com/shareefhiasat/bb44570f00ee426c689cbb592ab83d4c
another thing not mentioned below is,you can download event page from here
https://nimbus.everhelper.me/client/notes/share/912226/e5rzusxqcudmu16szt7m
frome this controller
https://www.sajilni.com/event/white.html?id=4617&type=event-page
now for below you may need to check the widget controller in separation process
<%--
Document : index
Created on : May 11, 2017, 4:07:35 PM
Author : user
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
WIDGGES CASES
1 buy ticket button
<!--<iframe src="http://localhost:8080/sajilni/widget/buy-tickets-button.html?event=1870&text=shareef hiasat&finish=https://www.google.com" frameborder="0" height="100" width="165" vspace="0" hspace="0" marginheight="5" marginwidth="5" scrolling="auto" allowtransparency="true"></iframe>-->
2 ticket list example
<!--<iframe src="http://localhost:8080/sajilni/widget/tickets-form.html?eventId=1870&finish=" frameborder="0" height="100" width="100%" vspace="0" hspace="0" marginheight="5" marginwidth="5" scrolling="auto" allowtransparency="true"></iframe>-->
3 text link
<!--<a href="http://localhost:8080/sajilni/event/page.html?id=1870&finish=https://www.google.com" target="_blank">Buy from here textllink</a>-->
4 event page
<!--<script type="text/javascript" src="http://localhost:8080/sajilni/theme/js/lib/jquery.js"></script><script type="text/javascript">var $sajilni = jQuery.noConflict();$sajilni(function() {var eventId = 1870;eventFinishLink = undefined;var $iframe = $sajilni("<iframe></iframe>");$iframe.attr("id","sajilni-event-"+eventId);$iframe.attr("src","http://localhost:8080/sajilni/event/page.html?id="+eventId+"&finish="+eventFinishLink);$sajilni("body").css({"overflow":"hidden","padding":0,"margin":0}).html($iframe);$sajilni(window).bind("resize",function(){$iframe.width($sajilni(window).innerWidth());$iframe.height($sajilni(window).innerHeight());}).resize();});</script>-->
5 automatic buy
<!--<iframe src="http://localhost:8080/sajilni/widget/tickets-form.html?eventId=1870&finish=https://www.google.com&autoBuyClick=1" frameborder="0" height="214" width="100%" vspace="0" hspace="0" marginheight="5" marginwidth="5" scrolling="auto" allowtransparency="true"></iframe>-->
6 auto buy specific ticket
<iframe src="http://localhost:8080/sajilni/widget/tickets-form.html?eventId=1870&finish=https://www.google.com&autoBuyClick=1&accessToken=213212132313" frameborder="0" height="214" width="100%" vspace="0" hspace="0" marginheight="5" marginwidth="5" scrolling="auto" allowtransparency="true"></iframe>
</body>
</html>
@shareefhiasat
Copy link
Author

i updated the event download part in this gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment