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);
 }
Exemple #2
0
$ip = $_SERVER['REMOTE_ADDR'];
$unique_session_id = session_id();
$item1 = 40.0;
$item2 = 20.0;
$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);