function __construct() { $demo = ET_Payment::get_payment_test_mode(); //purchase url $this->_2CO_url = 'https://www.2checkout.com/checkout/purchase?sid='; $api = self::get_api(); $this->_api = $api; $this->_sid = trim($api['sid']); $this->_secret_word = trim($api['secret_key']); $this->_use_direct = false; $this->_mode = '2CO'; if ($demo) { $this->_2CO_url = 'https://sandbox.2checkout.com/checkout/purchase?sid='; $this->_demo = 'Y'; } }
function __construct($settings = array(), $mode) { $this->_x_test_request = ET_Payment::get_payment_test_mode(); $api = ET_Authorize::get_api(); if ($this->_x_test_request) { $this->_post_location = 'https://test.authorize.net/gateway/transact.dll'; } else { $this->_post_location = 'https://secure.authorize.net/gateway/transact.dll '; } $this->_login = $api['x_login']; $this->_md5_hash = $api['x_MD5_hash']; $this->_transaction_key = $api['x_transaction_key']; $this->_x_method = 'cc'; $this->_x_show_form = 'payment_form'; $default_settings = array('return' => 'http://localhost', 'cancel' => 'http://localhost'); $settings = wp_parse_args($settings, $default_settings); $this->_x_receipt_link_url = $settings['return']; }
function __construct() { $server_type = ''; if (ET_Payment::get_payment_test_mode()) { $server_type = 'sandbox'; } $api = $this->get_api(); $this->_merchant_id = $api['merchant_id']; $this->_merchant_key = $api['merchant_key']; //$this->currency = $currency; if (strtolower($server_type) == "sandbox") { $this->_server_url = "https://sandbox.google.com/checkout/"; } else { $this->_server_url = "https://checkout.google.com/"; } $this->_base_url = $this->_server_url . "api/checkout/v2/"; $this->_checkout_url = $this->_base_url . "checkout/Merchant/" . $this->_merchant_id; $this->_checkoutForm_url = $this->_base_url . "checkoutForm/Merchant/" . $this->_merchant_id; //$this->_settings = $setting; }
function __construct() { $this->payment = new AE_PaypalExpress(ET_Payment::get_payment_test_mode()); }
function ConfirmPayment($token, $payerID, $order) { /* Gather the information to make the final call to finalize the PayPal payment. The variable nvpstr holds the name value pairs */ $token = urlencode($token); $payment = new ET_PaypalExpress(ET_Payment::get_payment_test_mode()); $paymentType = urlencode('sale'); $currencyCodeType = urlencode($order['currencyCodeType']); $FinalPaymentAmt = $order['total']; $procducts = $order['products']; $product = get_post_meta($order['ID'], 'et_order_products', true); $payerID = urlencode($payerID); $serverName = urlencode($_SERVER['SERVER_NAME']); $nvpstr = '&TOKEN=' . $token . '&PAYERID=' . $payerID . '&PAYMENTREQUEST_0_PAYMENTACTION=' . $paymentType . '&PAYMENTREQUEST_0_AMT=' . $FinalPaymentAmt; $nvpstr .= '&PAYMENTREQUEST_0_CURRENCYCODE=' . $currencyCodeType . '&IPADDRESS=' . $serverName; $index = 0; foreach ($procducts as $key => $item) { $nvpstr .= "&L_PAYMENTREQUEST_0_NAME" . $index . "=" . urlencode($item["NAME"]); $nvpstr .= "&L_PAYMENTREQUEST_0_AMT" . $index . "=" . urlencode($order['total']); $nvpstr .= "&L_PAYMENTREQUEST_0_QTY" . $index . "=" . urlencode($item["QTY"]); $nvpstr .= "&L_PAYMENTREQUEST_0_ITEMCATEGORY" . $index . "=Digital"; $index++; } /* Make the call to PayPal to finalize payment If an error occured, show the resulting errors */ $resArray = $payment->hash_call("DoExpressCheckoutPayment", $nvpstr); /* Display the API response back to the browser. If the response from PayPal was a success, display the response parameters' If the response was an error, display the errors received using APIError.php. */ $ack = strtoupper($resArray["ACK"]); return $resArray; }
function ae_payu_script() { if (is_page_template('page-post-place.php') || is_page_template('page-submit-project.php')) { wp_enqueue_script('ae_payu', plugin_dir_url(__FILE__) . 'assets/payu.js', array('underscore', 'backbone', 'appengine'), '1.0', true); wp_enqueue_style('ae_payu', plugin_dir_url(__FILE__) . 'assets/payu.css', array(), '1.0'); $test_mode = ET_Payment::get_payment_test_mode(); $payu_url = 'https://live.payu.in/_payment'; if ($test_mode) { $payu_url = 'https://test.payu.in/_payment'; } wp_localize_script('ae_payu', 'ae_payu', array('currency' => ae_get_option('currency'), 'empty_field' => __('This Field Cannot be empty', ET_DOMAIN), 'email_error' => __('Email not correct please check again', ET_DOMAIN))); } }
function __construct() { $mode = ET_Payment::get_payment_test_mode(); $api = self::get_api(); extract($api); // init api setting $this->_api_username = trim($api_username); //$this->_api_password = trim($api_password); //$this->_api_signature = trim($api_signature); $this->_api_endpoint = 'https://api-3t.sandbox.paypal.com/nvp'; $this->_version = 87.0; $this->_proxy = false; $this->_test_mod = $mode; if ($this->_test_mod) { // in test mode : enpoint url is sandbox $this->_paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; } else { // in realtime $this->_paypal_url = 'https://www.paypal.com/cgi-bin/webscr'; } /*$default_settings = array ( 'return' => 'http://localhost', 'cancel' => 'http://localhost' ); $settings = wp_parse_args( $settings, $default_settings ); $this->_settings = $settings;*/ }