PATH:
home
/
lab2454c
/
bullionmills.com
/
wp-content
/
plugins
/
transferwise-currency-changer
<?php /* Plugin Name: Tranferwise Currency Changer Plugin URI: //transferwise.com Description: Tranferwise Currency Changer Version: 1.0.0 Author URI: //transferwise.com */ //Tranferwise Credentials function tranferwit_currency_changer() { $msg = []; $html = ''; //$html .= '<div class="container">'; $html .= '<div class="cureny__holder">'; $html .= '<label>You Send</label>'; $html .= '<div class="cureny__holder__inner">'; $html .= '<input class="amount__type" type="text" name="src_amount">'; $html .= '<div class="dropdown__wrap">'; /*$html .= '<div class="select">'; //$html .= '<span>INR</span>'; $html .= '<i class="arrow__down"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 490.688 490.688" style="enable-background:new 0 0 490.688 490.688; fill:#fff;" xml:space="preserve"> <path style="fill:#FFC107;" d="M472.328,120.529L245.213,347.665L18.098,120.529c-4.237-4.093-10.99-3.975-15.083,0.262 c-3.992,4.134-3.992,10.687,0,14.82l234.667,234.667c4.165,4.164,10.917,4.164,15.083,0l234.667-234.667 c4.237-4.093,4.354-10.845,0.262-15.083c-4.093-4.237-10.845-4.354-15.083-0.262c-0.089,0.086-0.176,0.173-0.262,0.262 L472.328,120.529z" /> <path d="M245.213,373.415c-2.831,0.005-5.548-1.115-7.552-3.115L2.994,135.633c-4.093-4.237-3.975-10.99,0.262-15.083 c4.134-3.992,10.687-3.992,14.82,0l227.136,227.115l227.115-227.136c4.093-4.237,10.845-4.354,15.083-0.262 c4.237,4.093,4.354,10.845,0.262,15.083c-0.086,0.089-0.173,0.176-0.262,0.262L252.744,370.279 C250.748,372.281,248.039,373.408,245.213,373.415z" /> </svg></i>'; $html .= '</div>';*/ //$html .= '<input type="hidden" class="cur_currency" name="src_currency" id="src_currency" value="INR">'; $html .= '<select class="dropdown__currency__select src_currency">'; $html .= '<option value="INR">INR</option>'; $html .= '<option value="GBP">GBP</option>'; $html .= '<option value="EUR">EUR</option>'; $html .= '<option value="USD">USD</option>'; $html .= '</select>'; $html .= '</div>'; $html .= '</div>'; $html .= '</div>'; $html .= '<div class="cureny__holder">'; $html .= '<label>Receving Amount</label>'; $html .= '<div class="cureny__holder__inner">'; $html .= '<input class="amount__type" type="text" name="trgt_amount">'; $html .= '<div class="dropdown__wrap">'; /*$html .= '<div class="select">'; $html .= '<span>USD</span>'; $html .= '<i class="arrow__down"><svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 490.688 490.688" style="enable-background:new 0 0 490.688 490.688; fill:#fff;" xml:space="preserve"> <path style="fill:#FFC107;" d="M472.328,120.529L245.213,347.665L18.098,120.529c-4.237-4.093-10.99-3.975-15.083,0.262 c-3.992,4.134-3.992,10.687,0,14.82l234.667,234.667c4.165,4.164,10.917,4.164,15.083,0l234.667-234.667 c4.237-4.093,4.354-10.845,0.262-15.083c-4.093-4.237-10.845-4.354-15.083-0.262c-0.089,0.086-0.176,0.173-0.262,0.262 L472.328,120.529z" /> <path d="M245.213,373.415c-2.831,0.005-5.548-1.115-7.552-3.115L2.994,135.633c-4.093-4.237-3.975-10.99,0.262-15.083 c4.134-3.992,10.687-3.992,14.82,0l227.136,227.115l227.115-227.136c4.093-4.237,10.845-4.354,15.083-0.262 c4.237,4.093,4.354,10.845,0.262,15.083c-0.086,0.089-0.173,0.176-0.262,0.262L252.744,370.279 C250.748,372.281,248.039,373.408,245.213,373.415z" /> </svg></i>'; $html .= '</div>';*/ //$html .= '<input type="hidden" class="cur_currency" name="trgt_currency" id="trgt_currency" value="USD">'; $html .= '<select class="dropdown__currency__select trgt_currency">'; $html .= '<option value="USD">USD</option>'; $html .= '<option value="INR">INR</option>'; $html .= '<option value="GBP">GBP</option>'; $html .= '<option value="EUR">EUR</option>'; $html .= '</select>'; $html .= '</div>'; $html .= '</div>'; $html .= '</div>'; $html .= '<a class="btn__tranferwit_sub" href="'.get_permalink(1181).'">Get Started</a>'; //$html .= '</div>'; return $html; } add_shortcode('tranferwit-currency-changer', 'tranferwit_currency_changer'); function tranferwit_script_variables() { $output = []; if(is_front_page()){ $api_token = 'b3371033-bbfd-4738-a60f-23dcb4ae78c6'; $api_url = 'https://api.sandbox.transferwise.tech/v1'; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $api_url."/rates", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Authorization: Bearer '.$api_token ), )); $response = curl_exec($curl); curl_close($curl); $response = json_decode($response); foreach($response as $key=>$res){ $output[$res->source.'_'.$res->target] = $res->rate; } } ?> <script type="text/javascript"> var currencyExcgRate = <?php echo json_encode($output);?> </script> <?php } add_action('wp_head', 'tranferwit_script_variables'); add_action('wp_enqueue_scripts', 'tranferwit_scripts'); function tranferwit_scripts() { wp_enqueue_style('tranferwit__style', plugins_url('core.css',__FILE__ )); wp_enqueue_script('tranferwit__script',plugins_url('core.js',__FILE__ ), array('jquery')); }
[-] transferwise-currency-changer.php
[edit]
[-] core.js
[edit]
[+]
..
[-] core.css
[edit]
[-] down-arrow.svg
[edit]