File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 102102
103103 < iframe src ="<%= @fund . open_collective_project_embed_url ( redirect_url : request . original_url ) %> " style ="width: 100%; min-height: 100vh; " sandbox ="allow-scripts allow-top-navigation "> </ iframe >
104104
105+ < script >
106+ window . addEventListener ( 'message' , event => {
107+ if ( event . origin . endsWith ( '<%= ENV [ 'OPENCOLLECTIVE_DOMAIN' ] %> ' ) ) {
108+ console . log ( event ) ;
109+ if ( event . data && event . data . event === 'success' ) {
110+ const url = new URL ( window . location . href ) ;
111+ url . searchParams . set ( 'OrderId' , event . data . payload . order . id ) ;
112+ window . location . href = url . toString ( ) ;
113+ }
114+ }
115+ } ) ;
116+ </ script >
117+
105118 </ div >
106119 < div class ="col-12 col-lg-4 page-content ">
107120 < h3 class ="mt-lg-0 "> How donating works</ h3 >
You can’t perform that action at this time.
0 commit comments