Jump to content

activa

Members
  • Posts

    737
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by activa

  1. Hello

     

    we are working in the paypal express checkout gateway , wehave almost done all the code, but when we test it we have some probleme in the callback .

     

    we pass the payment to paypal site and it show a successfull payment , and the gateway return the user to the blesta site to return url .

     

    in the log no entries for successfull or failed reponse , also no transaction are stored in the clients side .

     

     

    the validate function is the fallowing , is there any mistake in it ?

    	public function validate(array $get, array $post) {
    
    		print_r($get);
    		$client_id = $this->ifSet($get['client_id']);
    		$token = $this->ifSet($get['token']);
    		// $payer_id = $this->ifSet($get['PayerID']);
    		
    		// if (!$client_id) {
    			// $client_id = $this->clientIdFromEmail($this->ifSet($post['payer_email']));
    		// }
    		
    		$post_to = $this->getApiUrl();
    		
    		$params = array(
    			'TOKEN' => $token,
    		);
    		
    		$response = $this->execute_request("GetExpressCheckoutDetails", $params);
    		
    		// Exit when we don't get a sucess request
    		if (isset($response['ACK']) && $response['ACK'] != 'Success') {
    			$this->Input->setErrors($this->getCommonError("invalid"));			
    			// Log error response
    			$this->log($this->ifSet($post_to), serialize($response), "input", false);
    			return;
    		}
    
    		// Log Success response
    		$this->log($this->ifSet($post_to), serialize($response), "input", true);
    			
    		// Do the payment
    		$request_params = array(
    			'TOKEN' => $response['TOKEN'],
    			'PAYERID' => $response['PAYERID'],
    			'PAYMENTREQUEST_0_AMT' => $response['PAYMENTREQUEST_0_AMT'],
    			'PAYMENTREQUEST_0_PAYMENTACTION' => $this->payment_action,
    			'PAYMENTREQUEST_0_CURRENCYCODE' => $this->currency,
    		);
    
    		// Make the call to PayPal to finalize payment
    		$do_response =  $this->execute_request("DoExpressCheckoutPayment", $request_params);
    
    	
    		// Exit when we don't get a sucess request
    		if (isset($do_response['ACK']) && $do_response['ACK'] != 'Success') {
    			$this->Input->setErrors($this->getCommonError("invalid"));			
    			// Log error response
    			$this->log($this->ifSet($post_to), serialize($do_response), "input", false);
    			return;
    		}
    			
    		$this->log($this->ifSet($post_to), serialize($do_response), "output", true);
    		
    		// Capture the IPN status, or reject it if invalid
    		switch (strtolower($this->ifSet($do_response['PAYMENTINFO_0_PAYMENTSTATUS']))) {
    			case "completed":
    			case "processed":
    			case "completed-funds-held":
    				$status = "approved";
    				break;
    			case "pending":
    			case "in-progress":
    				$status = "pending";
    				break;
    			case "refunded":
    				$status = "refunded";
    				break;
    			case "voided":
    				$status = "voided";
    				break;
    			case 'denied':
    			case 'failed':			
    			case 'expired':			
    				$status = 'declined';
    				break;				
    			default:
    				// Log request received, even though not processed
    				$this->log($this->ifSet($post_to), serialize($do_response['PAYMENTINFO_0_PAYMENTSTATUS']), "output", true);
    				return;
    		}
    		
    		return array(
    			'client_id' => $client_id,
    			'amount' => $this->ifSet($do_response['PAYMENTREQUEST_0_AMT']),
    			'currency' => $this->ifSet($do_response['PAYMENTREQUEST_0_CURRENCYCODE']),
    			'status' => $status,
    			'reference_id' => null,
    			'transaction_id' => $this->ifSet($do_response['PAYMENTINFO_0_TRANSACTIONID']),
    			// 'parent_transaction_id' => $this->ifSet($post['parent_txn_id']),
    			// 'invoices' => $this->unserializeInvoices($this->ifSet($post['custom']))
    		);
    	}
    	
    
  2. If Javascript is not your thing, there are standard jQuery plugins to simplify that and let you describe form dependencies in the form HTML.

    E.g. https://github.com/renvrant/conditionize.js

     

     

    the same logic that was used by boss ( Naja7host) used for old work , the probleme is the price and not the javascript logic code .

     

    as the price is difined in the package term , so is not possible to override the price depending in  flieds selected or not in the package .

     

    but Naja can give more details in this .

  3. So last night, while I was in the shower (of course...) I was thinking about the module for some reason and had a thought,

     

    "That username and root field in Add Server screen... dude, you know that's the wrong place for it. Put Datacenter, Location, Rack as the options for the Add Server screen in its place!"

     

    And thus, an eureka moment was born. So, I will be adding those options into DSM shortly and pushing it to Github. Shouldn't be overly difficult to add, it's simply a text replacement and slight modification of the language file to account for the change.

     

    The Rack, row field will be added to the service side... at least, when I figure out how to do that for the admin-side because those're basically admin-only functions. But the Datacenter and Location field will be added to the Add Server screen. I'll update the screenshots after I do that to ensure people don't get confused.

     

    Edit:

     

    Dammit, I completely and utterly broke it. I'll have to rebuild it again from the last working copy I have. Thank goodness for version control.

     

    Hello Keiro .

     

    i will also help just need some time , now what you can do is something to design how the module should be ..

     

    field that shouldbe in Package

    fields that should be in admin side

    fields that should be in client side

     

    which field are mandatory and wich one is obligatory .

     

    type of fields (text , selectbox , checkbox, radio ...ect )

     

    and let the other work for me ;)

  4. or add a field in the service table that can store a billing contact , if not set use the default contact . this is very usable case in Europe market , a lot of companies that offer a management or service related to Dedicated server or infrastructure  bill the client for their work , and the they not ads any beneficent for the hardware cost , they add beneficent in their related services .

  5. nice work , i don't want to minimize your efforts but this is my real opinion about this module ;

     

    this module with that functions is less usable , and is less strong than the universal module .

     

    BUT to convert this module to a unique and powerful module is to add to it the CONDITIONAL LOGIC for components .

    HOW ? add fields to package that let users select thier wanted :

     - OS (select option)

     - HDD 1

     - HDD 2

     - HDD 3

     - HDD 4

     - RAM (2,4,6,8,12,16,24,32, ...ect)

     - Ethernet Port ( 100Mp/1Gp)

     - RAID (0,1,5,10 ...) depend of selected HDD .

     - Control Panel (Cpanel , Plesk , DA, , Webmin , Inerwork...)

     - IPs (4,8,16,32,64,128,256 ...)

     

    We can help you in this, just we need to colobarate in this work all together , my BOSS (is a user here , AKA Naja7host) has a portfolio for this to do it , i have see a mockup logic for this in his office already .

     

    Finally , this is a first step to the real Dedicated Server Module .

×
×
  • Create New...