Implemented smart buttons are not working

Shor-ty
Contributor
Contributor

Dear community,
my name is Tobi and it's the first time I am asking here on the forum a question. Hence, I hope it is not too simple for you even though I believe it is a simple mistake I do, or something is missing.  I implemented the PayPal buttons on my website and tested them using the sandbox account. It was working fine and a few weeks ago I had a problem as the AJAX response (if the payment was successful) was not working properly. Hence, I started to change the Javascript and now things are not working anymore (even the old implementation).

 

The problem I encounter right now is, that the payment is successfully done (live or the sandbox) but the money does not go to the business account. E.g., if I am in sandbox mode, I see my transfer from the personal account but it will not be received by the business account. In live mode it is similar. I can purchase the money but it will not be transferred to my other account. Thus, I get a PayPal notification that states, the money will be refunded soon.

The code I am using is simply the one presented in the documentation section (https://developer.paypal.com/docs/checkout/integrate/)

For clearness, I am adding my javascript code to it.

 

paypal.Buttons                                                                  
({
    createOrder: function(data, actions)                                        
    {                                                                           
        return actions.order.create                                             
        ({                                                                      
            purchase_units:                                                     
            [{                                                                  
                amount:                                                         
                {                                                               
                    currency_code: "EUR",                                       
                    value: price                                                
                }                                                               
            }]                                                                  
        });                                                                     
    },                                                                          
    onApprove: function(data, actions)                                          
    {                                                                           
        setTimeout(function()                                                   
        {                                                                       
            return actions.order.capture().then(function(details)               
            {                                                                   
                // Test notification works                                      
                alert('Transaction completed by ' + details.payer.name.given_name);
                                                                                
                // Do something with the database (SQL stuff)                   
                console.log('AJAX Call...');                                    
                                                                                
            });                                                                 
        }, 1000);                                                               
    }                                                                           
}).render('#paypal-button-container'); 

 

I am also wondering for which purpose we need the security key?

Any hint is warmly welcomed.
Thank you in advance, Tobi

Login to Me Too
1 REPLY 1

Shor-ty
Contributor
Contributor

Just one hint. I enforced some errors during payment inPaymentError.png live mode right now. I attached a screenshot.

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.