Paypal Plus in HTML form : Not able to give customer the chance to pay without paypal account

ikemuc
Contributor
Contributor

Hi,

 

I'm trying to implement a very simple shopping cart solution with Paypal Plus payment, which should give the customer the choice to pay with or without Paypal account (using a business account with activated Paypal Plus).

The solution is based on SmartCart (https://github.com/techlab/SmartCart) in a HTML page.

The current solution works, payments can be done with a Paypal account in the sandbox and (hopefully) in production (launched the solution today).

 

Now I'm trying to give the customer the choice to pay without paypal account using credit card or SEPA. Yesterday I added the following code and it worked for some minutes (see https://www.paypalobjects.com/webstatic/de_DE/downloads/PayPal-PLUS-IntegrationGuide.pdf p.16)

 

 

 

 

 

<script src="https://www.paypalobjects.com/webstatic/ppplus/ppplus.min.js" type="text/javascript"></script>
<div id="ppplus"> </div>

<script type="application/javascript">
var ppp = PAYPAL.apps.PPP({
"approvalUrl": "'.$approval_url.'",
"placeholder": "ppplus",
"mode": "sandbox",
"country": "DE"
}); </script>

 

 

I edited some code having nothing todo with this and it stopped working... (And it wasn't versioned...) Since one day I try to get it working again...

 

Currently the code looks like this (simplified and anonymized):

 

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript" ></script>
<script src="assets/js/jquery.smartCart.min.js" type="text/javascript"></script>
<script src="https://www.paypalobjects.com/webstatic/ppplus/ppplus.min.js" type="text/javascript"></script>

<div id="ppplus"> </div>
<script type="application/javascript"> 
var ppp = PAYPAL.apps.PPP({
        "approvalUrl": "'.$approval_url.'",
        "placeholder": "ppplus",
        "mode": "sandbox",
        "country": "DE"
});
</script>

<script type="text/javascript">
$(document).ready(function(){
        // Initialize Smart Cart        
        $('#smartcart').smartCart({
                submitSettings: {
                    submitType: 'paypal' // form, paypal, ajax
                },
                toolbarSettings: {
                    checkoutButtonStyle: 'paypal' // default, paypal, image
                },
        });
});
</script>

<div class="row">
        <div class="sc-product-item thumbnail">
                <h4 data-name="product_name">product 1</h4>
                <hr class="line">
                    <input class="sc-cart-item-qty" name="product_quantity" min="1" value="1" type="number">
                    <input name="product_price" value="10.00" type="hidden" />
                    <input name="product_id" value="100" type="hidden" />
                    <button class="sc-add-to-cart btn btn-success btn-sm pull-right">In den Warenkorb</button>
                <div class="clearfix"></div>
        </div>
</div>

<div class="row">
        <div class="panel-body">
                <div class="row">
                        <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="POST">
                        <div id="smartcart"></div>
                        <input name="business" value="business" type="hidden">
                        <input name="currency_code" value="EUR" type="hidden">
                        <input type="hidden" name="lc" value="DE">
                        <input name="return" value="https://business/gekauft.html" type="hidden">            
                        <input name="cancel_return" value="https://business/cancelled.html" type="hidden">
                        <input name="cmd" value="_cart" type="hidden">    
                        <input name="upload" value="1" type="hidden">            
                        </form>
                </div>
        </div>
</div>

 

 

 

Now I always get the error message "Sorry, at the moment no payments can be processed for technical reasons" on the screen and ppplus.min.js says "Invalid 'approvalUrl'"

 

Can anybody give me a hint?

Are there working HTML/JavaScript code examples for using Paypal Plus with offering the choice of paying without account?

 

Any help will be appreciated! 

 

 

 

 

 

Login to Me Too
1 REPLY 1

ikemuc
Contributor
Contributor

Hm, nobody knows this?

 

My first assumption as a software developer was, that there must be a flag, which I can set, to allow the customer to pay with credit card or SEPA without having a Paypal account... It could be so easy...

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.