locked
PayPal with C# MVC newest Checkout REST API SDK RRS feed

  • Question

  • User-544325736 posted

    Hello every1,

    I have a C# MVC program that I am working on, I am working on using the PayPal API SDK. The Newest one version 2 checkout 1.0.3.

    I have pretty much everything setup properly im pretty sure but my only question is. I want to call my newly created ‘CreateOrder()’ from my PayPal Button that I added to the html.

    I’m pretty sure it something like this but with this the errors I get are:

    buttons?style.layout=vertical&style.color=gold&style.shape=rect&style.tagline=false&components.0=buttons& &platform=desktop&currency=USD&intent=capture&commit=true:1021 update_client_config_error {err: "TypeError: Cannot read property 'map' of undefined…4PZ_ZaM89nm:2:72118", timestamp: "1591930297172", referer: "www.sandbox.paypal.com", sessionID: "832c4e3_mdi6mjq", env: "sandbox", …}
    <script>
        //paypal.Buttons().render('#btnpaytst')
        paypal.Buttons({
            //createOrder: function (data, actions) { return actions.order.create({ }) }
            createOrder: function () {
                return fetch("../PayPal/CreateOrder", {
                    method: 'POST',
                    headers: {
                        'content-type': 'application/json'
                    }
                }).then(function (response) {
                    return response.json();
                }).then(function (data) {
                    return data;
                })
            }
        }).render('#btnpaytst')
    </script>
    

    Saturday, June 13, 2020 2:00 AM

All replies

  • User-474980206 posted

    Probably the data is wrong. Use the browsers debugger to capture, and see how it differs from the pay pal requirement

    Saturday, June 13, 2020 3:14 PM