Example #1
0
 private function GeneratePayUForm($trainingLevel, $trainingType, User $user)
 {
     //$liveUpdate = new PayuLu('PAYUDEMO','P5@F8*3!m0+?^9s3&u8(');
     $liveUpdate = new PayuLu('OPU_TEST', 'SECRET_KEY');
     //Show all errors
     $liveUpdate->setDebug(PayuLu::DEBUG_ALL);
     //pname,pcode,pinfo,price,priceType,quantity,tax
     $pname = $trainingLevel . " Yelkencilik Egitimi";
     $pcode = "1112000112";
     $pinfo = "Yelkencilik Egitimi";
     $price = $this->_price;
     $priceType = "NET";
     $quantity = "1";
     $tax = "18";
     $product = new PayuProduct($pname, $pcode, $pinfo, $price, $priceType, $quantity, $tax);
     $liveUpdate->setOrderRef($this->user->GetPublicId());
     $liveUpdate->addProduct($product);
     //Billing adresi hash stringe dahil olmaz. Dolay?s?yla hash de?erinin
     //hesab?na bir etkisi yoktur.
     //Fakat billing bilgisinin gönderilmesi zorunludur.
     //Bundan dolay? billing için first name, last name ve email gönderilmelidir
     $billing = new PayuAddress();
     $billing->setFirstName($user->FirstName());
     $billing->setLastName($user->LastName());
     $billing->setEmail($user->EmailAddress());
     //$billing->setCity("Ka??thane"); //Ilce/Semt
     //$billing->setState("Istanbul"); //Sehir
     $billing->setCountryCode("TR");
     $liveUpdate->setBillingAddress($billing);
     $liveUpdate->setPaymentCurrency("TRY");
     $liveUpdate->setInstalments("3,4");
     $liveUpdate->setOrderShipping("");
     $liveUpdate->setBackRef("");
     $liveUpdate->setButtonName('Şimdi Öde');
     $t = $liveUpdate->renderPaymentForm();
     return $t;
 }