function paymentwall_link($params) { init_paymentwall_config($params); $shippingParams = getShippingParams($params); $extraParams = array_merge($shippingParams, array('integration_module' => 'whmcs', 'is_test' => isset($params['isTest']) && $params['isTest'] != '' ? 1 : 0)); $widget = new Paymentwall_Widget($params['clientdetails']['email'], $params['widget'], array(new Paymentwall_Product((int) $params['invoiceid'], $params['amount'], $params['currency'], $params["description"], Paymentwall_Product::TYPE_FIXED)), $extraParams); $widgetUrl = $widget->getUrl(); $code = '<form method=POST action="' . $widgetUrl . '"><a href="' . $widgetUrl . '"><img src="' . $params['systemurl'] . '/images/paymentwall/button_buy_white_yellow.png" alt="Paymentwall logo" height="34" width="153" /></a></form>'; return $code; }
function paymentwall_link($params) { init_paymentwall_config($params); $product = null; $recurring = getRecurringBillingValues($params['invoiceid']); $code = ''; $hasTrial = false; $subscriptionProduct = false; if ($recurring) { $subscriptionProduct = get_subscription_product($params, $recurring, $hasTrial); } $onetimeProduct = get_one_time_product($params); if ($subscriptionProduct && (!$params['forceOneTime'] || $params['forceSubscription'])) { $subscriptionWidget = new Paymentwall_Widget($params['clientdetails']['userid'], $params['widget'], array($subscriptionProduct), array_merge(array('integration_module' => 'whmcs', 'test_mode' => $params['isTest'] == 'on' ? 1 : 0, 'hide_post_trial_good' => $hasTrial ? 1 : 0), get_user_profile_data($params))); $code .= get_widget_code($subscriptionWidget, $params, 'subscribe'); } if (!$params['forceSubscription'] && $recurring || !$recurring) { $onetimeWidget = new Paymentwall_Widget($params['clientdetails']['userid'], $params['widget'], array($onetimeProduct), array_merge(array('integration_module' => 'whmcs', 'test_mode' => $params['isTest'] == 'on' ? 1 : 0), get_user_profile_data($params))); $code .= get_widget_code($onetimeWidget, $params, 'check_out'); } $code .= '<br><span style="font-size: 11px; color: #AAAAAA">Secure payments by <a href="https://www.paymentwall.com">Paymentwall Inc</a>.<span>'; return $code; }