Jump to content
Stef's Coding Community


Popular Content

Showing content with the highest reputation since 06/13/2020 in all areas

  1. 1 point
    I had changed my login information for the IWD course, and cannot remember it. I'm trying to reset the password via the 'forgot password' link, and nothing is being sent. I've checked ever folder that could possibly receive an email, including spam. I've sent an email to support, but with whatever is going on with the email server, I wonder if you received it. My apologies for submit the issue here as a topic. EDIT- I contacted Mr. Mischook and resolved the issue.
  2. 1 point
    Hi, I like coding and I want to find here a lot of tips. Well, I also need a lot of motivation 😀
  3. 1 point
    I think this is a very individual indicator. For example, I'm in college, but I'm already interested in programming and I already know a lot. I try to do everything to acquire new skills. I even spend my time just studying in my specialty, not everything. So when I get an essay in college, I just go to https://papersowl.com/fast-essay-writing. They provide fast essay writing services and do it very well and professionally. I am always satisfied with the result of their work. It is very convenient for me because I spend all the saved time on improving my programming skills.
  4. 1 point
    If you drop the Killer...you need to return the frog!
  5. 1 point
    I hadn’t even realized you had responded. I’ve since abandoned that home made theme and use a premodern one. I still haven’t leaned PHP. But thanks.
  6. 1 point
    This was a useful video I found a few weeks ago and I got a lot from it: 17 Sublime Text Shortcuts and Tips The text version he mentions is here: http://GitHub repository: https://github.com/michaelcheng429/17-sublime-text-tip PS: Let's call it 18 tips: 18] Removing a plugin from Sublime text 3: This afternoon I had to do just that and was almost demented until I found the answer below. It's mind-boggling how many people can't answer a simple question like "how can I remove a package from Sublime Text" without getting into a slavering fluster and unleashing lectures they've been waiting years to use. Excited puppies and trouser legs don't get a look in. Oh sorry, here's the answer: Go to package control by pressing Ctrl + Shift + p (or use the preferences tab on Sublime text-this shortcut doesn't work for me, that might be a Linux thing): type "remove package" then type the package/plugin name and enter to uninstall it.
  7. 1 point
    Hello everybody! My name is Javier, I moved to the US in my 30's as many immigrants with no money, no english and no family, twenty years later I'm ready to start my new adventure, web development! I have no skills in coding (very basic). I know I will find a lot of knowledge in these forums. Since I was in high school I wanted to work with computers, but never have a chance until now, I love play the guitar and I have an obsession with dominate the Vim text editor (is a personal challenge). My goal is to became a full-stack developer I'm interested in learning HTML, CSS, JS, PHP, Python, and some frameworks in the future. Thank you, and let's start it ! (well, I'm waiting for my e-mail to start the classes, I just bought it) 😊
  8. 1 point
    Hi, When you have enough post there is that ability. Stef
  9. 1 point
    Videos: Composer Introduction & SDK Setup PayPal Settings & Minor Changes Steps to Submitting a Payment Integrating PayPal Part 1 Integrating PayPal Part 2 Integrating PayPal Part 3 Integrating PayPal Part 4 On the whole the videos can be followed, but there are few red herrings on the way. And unnecessary distractions. Composer Introduction & SDK Setup Forget Composer, this is an unnecessary distraction and just confuses things, maybe mention Composer at the end of the tutorial as an alternative method for installing the SDK. Get the SDK hosted on Github from here: https://github.com/paypal/PayPal-PHP-SDK/releases I used the 1.13.0 zip (latest version) from this page and it works fine. To follow the videos you would rename the uncompressed SDK folder to 'vendor' and place it in the /app directory. The 'samples' are slightly different. They are now hosted online here" https://paypal.github.io/PayPal-PHP-SDK/sample/ Only one sample is actually used in the tutorial, this one: https://paypal.github.io/PayPal-PHP-SDK/sample/doc/payments/CreatePaymentUsingPayPal.html as you can see it looks virtually the same. If you want to host the samples locally, you can still do that. Go to the main SDK repository on Github https://github.com/paypal/PayPal-PHP-SDK you can see the samples directory is there. I did however have trouble downloading directly from here. For some reason when you hit the clone/download button and download from here the zip is missing files and directories you'd expect to be there, including the samples directory. I have no clue why this is. I managed to work around this problem by forking the repository and using the GitHub desktop app to clone my fork to my local drive. It was then fairly simple to drag the 'samples' directory out and host that with my MAMP/LAMP. PayPal Settings & Minor Changes Do the changes to init.php etc Then the first step really is to goto https://developer.paypal.com/ log in and go to the dashboard (it all looks very different, but it's essentially doing the same job as before). Scroll down to REST API apps and create a new App. A client ID, secret and two test accounts (buyer and facilitator) are created automatically. Continue and make the changes to init.php, v_public_cart.php, success.php, v_public_success.php and m_payments.php etc. Steps to Submitting a Payment This video is a bit confusing now, as the interactive guide is not the same. The vid really needs to be just a simple explanation of the steps used with paypal. Integrating PayPal Part 1 Integrating PayPal Part 2 Integrating PayPal Part 3 Integrating PayPal Part 4 Once all the above is sorted you can follow these video's pretty much verbatim, only there are some subtle differences with the bootstrap.php file that you'll be copying from. It's easier to just look at my m_payments.php file: <?php /* Payments Class Handle all tasks related to payments */ require ('app/vendor/autoload.php'); use PayPal\Rest\ApiContext; use PayPal\Auth\OAuthTokenCredential; use PayPal\Api\Amount; use PayPal\Api\Details; use PayPal\Api\Item; use PayPal\Api\ItemList; use PayPal\Api\Payer; use PayPal\Api\Payment; use PayPal\Api\RedirectUrls; use PayPal\Api\Transaction; use PayPal\Api\PaymentExecution; class Payments { private $api_context; function __construct() { $this->api_context = $this->get_api_context(); // echo '<pre>'; // print_r($this->api_context); // echo '</pre>'; // exit; } /* Getters and Setters */ public function get_api_context() { if (PAYPAL_MODE == "sandbox") { $apiContext = new ApiContext( new OAuthTokenCredential ( PAYPAL_DEVID, PAYPAL_DEVSECRET ) ); } else { $apiContext = new ApiContext( new OAuthTokenCredential ( PAYPAL_LIVEID, PAYPAL_LIVESECRET ) ); } $apiContext->setConfig(array ( 'mode' => PAYPAL_MODE, 'http.ConnectionTimeOut' => 30, 'log.LogEnabled' => true, 'log.FileName' => 'app/PayPal.log', 'log.LogLevel' => 'FINE' )); return $apiContext; } /** * Creates PayPal payment: * * @access public * @param * @return error string **/ public function create_payment($items_array, $details_array) { $payer = new Payer(); $payer->setPaymentMethod("paypal"); // set items $i = 0; foreach ($items_array as $item) { $items[$i] = new Item(); $items[$i] ->setName($item['name']) ->setCurrency(PAYPAL_CURRENCY) ->setQuantity($item['quantity']) ->setSku("123123" . $i) ->setPrice($item['price']); $i++; } $itemList = new ItemList(); $itemList->setItems($items); // set details $details = new Details(); $details ->setShipping($details_array['shipping']) ->setTax($details_array['tax']) ->setSubtotal($details_array['subtotal']); // set amount $amount = new Amount(); $amount ->setCurrency(PAYPAL_CURRENCY) ->setTotal($details_array['total']) ->setDetails($details); // set transaction $transaction = new Transaction(); $transaction ->setAmount($amount) ->setItemList($itemList) ->setDescription("") ->setInvoiceNumber(uniqid()); // create urls $redirectUrls = new RedirectUrls(); $redirectUrls ->setReturnUrl(SITE_PATH . "success.php") ->setCancelUrl(SITE_PATH . "cart.php"); // create payment $payment = new Payment(); $payment ->setIntent("sale") ->setPayer($payer) ->setRedirectUrls($redirectUrls) ->setTransactions(array($transaction)); try { $payment->create($this->api_context); } catch (Exception $ex) { // echo '<pre>'; // print_r($ex->getData()); // echo '</pre>'; // exit; return $ex->getMessage(); } // get redirect url $approvalUrl = $payment->getApprovalLink(); $_SESSION['payment_id'] = $payment->getId(); if (isset($approvalUrl)) { header("Location: $approvalUrl"); exit; } } /** * Executes PayPal payment: * * @access public * @param string, string * @return result object **/ public function execute_payment($payer_id, $payment_id) { $payment = Payment::get($payment_id, $this->api_context); $execution = new PaymentExecution(); $execution->setPayerId($payer_id); $result = $payment->execute($execution, $this->api_context); return $result; } } As you can see it's almost the same, just some subtle difference at the bottom with the re-directs and the try/catch. I did have to fix that bug that was a result of a comma being in the amount (see earlier post for the fix). Anyway I think that was everything. Dave
  • Create New...