public function getHandler(TransactionPayment $handler, $api) { set_time_limit(0); $username = $handler->getConfigValue('username'); $password = $handler->getConfigValue('password'); $signature = $handler->getConfigValue('signature'); $wpp = new WebsitePaymentsPro(); $wpp->prepare($username, $password, $signature); return $wpp->selectOperation($api); }
$item3 = 30.0; $tax1 = 7.0; $tax2 = 14.0; $tax3 = 21.0; $item_total = $item1 + $item2 + $item3; $tax = $tax1 + $tax2 + $tax3; $shipping = 25.0; $handling = 75.0; $order_total = $item_total + $shipping + $handling + $tax; // Setting up the Authentication information // Such as Username, Password, Signature and Subject $API = new WebsitePaymentsPro(); $API_USERNAME = '******'; $API_PASSWORD = '******'; $API_SIGNATURE = 'AiPC9BjkCyDFQXbSkoZcgqH3hpacA4EAG6uE6TDmFNlGFx6LWKnsoGLG'; $API->prepare($API_USERNAME, $API_PASSWORD, $API_SIGNATURE); /* // DoDirectPayment //========================================================================================================== $Paypal = $API->selectOperation('DoDirectPayment'); $Address = PayPalTypes::AddressType($fname . ''. $lname, $address1, $address2, $city, $state, $zip, $cc_country, $phone); $PersonName = PayPalTypes::PersonNameType($salutation, $fname, '', $lname); $PayerInfo = PayPalTypes::PayerInfoType($email, 'israelekpo', 'verified', $PersonName, $cc_country, '', $Address); $CreditCardDetails = PayPalTypes::CreditCardDetailsType($cc_type, $cc_number, $exp_month, $exp_year, $PayerInfo, $cv2); $PaymentDetails = PayPalTypes::PaymentDetailsType($order_total, $item_total, $shipping, $handling, $tax, $order_desc, $custom, $invoice, '', 'http://phppaypalpro.sourceforge.net/ipn_notify.php', $Address);