Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/29/2018 in all areas

  1. bug fixed: here is my new checkout.php <?php include('app/init.php'); if(isset($_POST)) { // create Payment Object include('app/models/m_payments.php'); $Payments = new Payments(); // get item data $items = $Cart->get(); // get details $details['subtotal'] = $Cart->get_total_cost(); $details['shipping'] = 0; foreach ($items as $item) { $details['shipping'] += $Cart->get_shipping_cost($item['price']); } $details['shipping'] = number_format($details['shipping'], 2, '.', ''); $details['tax'] = number_format($details['subtotal'] * SHOP_TAX, 2, '.', ''); $details['total'] = number_format( $details['subtotal'] + $details['shipping'] + $details['tax'], 2, '.', ''); // send to PayPal $error = $Payments->create_payment($items, $details); if ($error != NULL) { $Template->set_alert($error, 'error'); $Template->redirect('cart.php'); } } else { $Template->redirect('cart.php'); } note the changes to number_format() where appropriate.
    1 point
  2. OK I think i've just discovered the new place under API Explorer which takes you to here https://www.paypal.com/apex/product-profile/expressCheckout/getAccessToken (the second image). I haven't confirmed it by going through the steps, but it looks promising.
    1 point
  3. No worries Stef, I'm on this vid right now "Steps to Submitting a Payment" and it is hard to find the equivalent area on developer.paypal.com in order to generate the JSON like the vid is doing. Yeah it really needs an update. I was hoping to wrap this course up. Anyway it's been good so far getting my head into this whole MVC with PHP. Up to now I've only used PHP procedurally. I'll keep poking around and see if I can get this paypal sorted.
    1 point
×
×
  • Create New...