Ejemplo n.º 1
0
$fi->setCreditCard($card);
// ### Payer
// A resource representing a Payer that funds a payment
// For direct credit card payments, set payment method
// to 'credit_card' and add an array of funding instruments.
$payer = new Payer();
$payer->setPaymentMethod("credit_card")->setFundingInstruments(array($fi));
// ### Itemized information
// (Optional) Lets you specify item wise
// information
$rewardCode = filter_input(INPUT_POST, 'rewardCode');
$invite = filter_input(INPUT_POST, 'invite');
$gift = null;
if (!empty($rewardCode)) {
    $gift = $rewardMgr->getGiftByRewardCode($rewardCode);
    $rewardMgr->addToHistory($userid, $rewardCode);
}
if (!empty($invite)) {
    $creditMgr->updateCreditStatusToTrue($invite, $userid);
}
/*********************************************************************************************************/
$totalPrice = 0.0;
$itemList = new ItemList();
$listLength = filter_input(INPUT_POST, 'listLength');
$list = array();
$orderList = array();
for ($x = 1; $x <= intval($listLength); $x++) {
    $item = new Item();
    $product_id = filter_input(INPUT_POST, 'product_id' . strval($x));
    $product = filter_input(INPUT_POST, 'product' . strval($x));
    $quantity = intval(filter_input(INPUT_POST, 'quantity' . strval($x)));