0

I have following code which is in PHP & i am not sure how to convert it as i am not familiar with PHP.

I am lost with it seems not sure what is exactly happening here. this is just part of the php code i have to work with & convert to c# for asp.net

Any help in this regard is apprecaited

if ($this->can_init()) {
    $preload='<iframe style="width:1px;height:1px;visibility:hidden;display:none;" src="https://secure.telrcdn.com/preload.html"></iframe>';
    $this->enabled          = $this->get_config_option('enabled');
    $this->title            = $this->get_config_option('title');
    $this->description      = $this->get_config_option('description').$preload;
    $this->store_id         = $this->get_config_option('store_id');
    $this->store_secret     = $this->get_config_option('store_secret');
    $this->testmode         = $this->get_config_option('testmode');
    $this->debug            = $this->get_config_option('debug');
    $this->order_status     = $this->get_config_option('order_status');
    $this->cart_desc        = $this->get_config_option('cart_desc');
    $this->form_submission_method   = true;
    $this->api_endpoint = 'https://secure.telr.com/gateway/order.json';
    // Actions
    add_action('woocommerce_update_options_payment_gateways_'.$this->id, array($this, 'process_admin_options'));
    add_action( 'woocommerce_thankyou', array($this, 'update_order_status'));
} else {
    $this->enabled = false;
}

complete code for for page is here https://jsfiddle.net/7m4wdfLt/

1 Answer 1

1

I have tried to rewrite you above mentioned code to ASP C#. This equivalent to your PHP.

<%
Dim gv_this, gv_preload

If gv_this->can_init() then
gv_preload = "<iframe style=""width:1px;height:1px;visibility:hidden;display:none;"" src=""https://secure.telrcdn.com/preload.html""></iframe>'
$this->enabled           = $this->get_config_option('enabled')
$this->title             = $this->get_config_option('title')
$this->description       = $this->get_config_option("description').gv_preload
gv_this->store_id          = gv_this->get_config_option('store_id')
gv_this->store_secret      = gv_this->get_config_option("store_secret')
$this->testmode          = $this->get_config_option('testmode')
$this->debug             = $this->get_config_option('debug')
$this->order_status      = $this->get_config_option("order_status')
gv_this->cart_desc         = gv_this->get_config_option('cart_desc')
gv_this->form_submission_method    = true
gv_this->api_endpoint  = "https://secure.telr.com/gateway/order.json"
' Actions
add_action('woocommerce_update_options_payment_gateways_'.gv_this->id, array(gv_this, 'process_admin_options'));
 add_action('woocommerce_thankyou',Array ( gv_this, "update_order_status" )
;Else
gv_this->enabled  = false
End If

%>

Hope this helps you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.