array( "Type" => "System", "Value"=>"BitPay" ), 'apiKey' => array( 'FriendlyName' => 'Legacy API Key from your bitpay.com merchant account.', 'Type' => 'text' ), 'network' => array( 'FriendlyName' => 'Select if this key is from bitpay.com or test.bitpay.com.', 'Type' => 'dropdown', 'Options' => 'live,test', ), 'redirectURL' => array( 'FriendlyName' => 'Redirect URL after BitPay invoice', 'Type' => 'text', 'Value' => isset($_POST['redirectURL']) ? $_POST['redirectURL'] : $_POST['systemURL'] ), 'transactionSpeed' => array( 'FriendlyName' => 'Transaction Speed', 'Type' => 'dropdown', 'Options' => 'low,medium,high' ), ); return $configarray; } /** * Returns html form. * * @param array $params * @return string */ function bitpay_link($params) { if (false === isset($params) || true === empty($params)) { die('[ERROR] In modules/gateways/bitpay.php::bitpay_link() function: Missing or invalid $params data.'); } // Invoice Variables $invoiceid = $params['invoiceid']; // Client Variables $firstname = $params['clientdetails']['firstname']; $lastname = $params['clientdetails']['lastname']; $email = $params['clientdetails']['email']; $address1 = $params['clientdetails']['address1']; $address2 = $params['clientdetails']['address2']; $city = $params['clientdetails']['city']; $state = $params['clientdetails']['state']; $postcode = $params['clientdetails']['postcode']; $country = $params['clientdetails']['country']; $phone = $params['clientdetails']['phonenumber']; // System Variables $systemurl = $params['systemurl']; $post = array( 'invoiceId' => $invoiceid, 'systemURL' => $systemurl, 'buyerName' => $firstname . ' ' . $lastname, 'buyerAddress1' => $address1, 'buyerAddress2' => $address2, 'buyerCity' => $city, 'buyerState' => $state, 'buyerZip' => $postcode, 'buyerEmail' => $email, 'buyerPhone' => $phone, ); $form = '
'; foreach ($post as $key => $value) { $form .= ''; } $form .= ''; $form .= '
'; return $form; }