Jump to content

Paiement Paypal effectué, Aucun client en Back Office


Recommended Posts

Bonsoir,

Je suis dans la creation d'une boutique en ligne en ce moment. Mon site est hebergé par OVH et j'ai reussi à configurer PrestaShop Checkout.

J'ai essayé de faire un test pour verifier le bon fonctionnement de ce dernier, le paiement est effectué, cependant, aucun client en back office...

Voici comment j'intègre Paypal a mon prestashop :

(themes/classic/templates/checkout/_partials/cart-detailed-actions.tpl)

{block name='cart_detailed_actions'}
  <script
    src="https://www.paypal.com/sdk/js?client-id=CODE_ICI"> // Required. Replace SB_CLIENT_ID with your sandbox client ID.
  </script>
  <div class="checkout cart-detailed-actions card-block">
    {if $cart.minimalPurchaseRequired}
      <div class="alert alert-warning" role="alert">
        {$cart.minimalPurchaseRequired}
      </div>
      <div class="text-sm-center">
        <button type="button" class="btn btn-primary disabled" disabled>{l s='Proceed to checkout' d='Shop.Theme.Actions'}</button>
      </div>
    {elseif empty($cart.products) }
      <div class="text-sm-center">
        <button type="button" class="btn btn-primary disabled" disabled>{l s='Proceed to checkout' d='Shop.Theme.Actions'}</button>
      </div>
    {else}
      <div class="text-sm-center">
        <a href="{$urls.pages.order}" class="btn btn-primary">{l s='Proceed to checkout' d='Shop.Theme.Actions'}</a>
        {hook h='displayExpressCheckout'}
      </div><br/>
      <div id="paypal-button-container"></div>
        <script>
        var totalno = "{$cart.totals.total.value}"
        var total = totalno.substr(0, totalno.length - 2).replace(',', '.')
          paypal.Buttons({
            createOrder: function(data, actions) {
              // This function sets up the details of the transaction, including the amount and line item details.
              return actions.order.create({
                purchase_units: [{
                  amount: {
                    value: total
                  }
                }]
              });
            },
            onApprove: function(data, actions) {
              // This function captures the funds from the transaction.
              return actions.order.capture().then(function(details) {
                // This function shows a transaction success message to your buyer.
                alert('Transaction completed by ' + details.payer.name.given_name);
              });
            }
          }).render('#paypal-button-container');
          //This function displays Smart Payment Buttons on your web page.
        </script>
    {/if}
  </div>
{/block}

Aussi mon back office m'affiche un error 500, j'ai donc passé :

(config/defines.inc.php)

define('_PS_MODE_DEV_', false);

à

define('_PS_MODE_DEV_', true);

Et tout re-fonctionne comme prévu (à part le client inexistant...)

Est ce grave niveau sécurité de laisser ca comme ça ?

Auriez-vous une solution à me proposer pour afficher les clients ayant passé une commande sur le BO ?

Merci d'avance pour vos réponses

Edited by Sam3010
Précisions (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...