使用SqPaymentForm的square .net API未返回随机数

kx1ctssn  于 2023-03-20  发布在  .NET
关注(0)|答案(2)|浏览(165)

我们的网站仍在使用Square-DotNet-SDK/11.0.0 v2
这个网站是一个社区游泳池,我们没有使用该网站自去年秋天。
今天当我测试这个赛季的时候,我们没有得到随机数。有什么变化吗?
我不熟悉这段代码,我想帮忙。

var sqPaymentForm = new SqPaymentForm({
        // Replace this value with your application's ID (available from the merchant dashboard).
        // If you're just testing things out, replace this with your _Sandbox_ application ID,
        // which is also available there.
        applicationId: 'the id', 
        inputClass: 'sq-input',
        cardNumber: {
            elementId: 'sq-card-number',
            placeholder: "0000 0000 0000 0000"
        },
        cvv: {
            elementId: 'sq-cvv',
            placeholder: 'CVV'
        },
        expirationDate: {
            elementId: 'sq-expiration-date',
            placeholder: 'MM/YY'
        },
        postalCode: {
            elementId: 'sq-postal-code',
            placeholder: 'Postal Code'
        },
        inputStyles: [
            // Because this object provides no value for mediaMaxWidth or mediaMinWidth,
            // these styles apply for screens of all sizes, unless overridden by another
            // input style below.
            {
                fontSize: '14px',
                padding: '3px'
            },
            // These styles are applied to inputs ONLY when the screen width is 400px
            // or smaller. Note that because it doesn't specify a value for padding,
            // the padding value in the previous object is preserved.
            {
                mediaMaxWidth: '400px',
                fontSize: '18px',
            }
        ],
        callbacks: {
            cardNonceResponseReceived: function (errors, nonce, cardData) {
                var errorDiv = document.getElementById('TextBoxError');
                if (errors) {
                    errorDiv.value = "";
                    errors.forEach(function (error) {
                        errorDiv.value = error.message + " " + errorDiv.value;
                    });
                    var EnableCharge = document.getElementById('ButtonChargeCard').disabled = true; //'ButtonChargeCard'

                } else {
                    // Assign the value of the nonce to a hidden form element
                    var nonceField = document.getElementById('cardNonce');
                    nonceField.value = nonce;
                    var nonceTextBoxField = document.getElementById('TextBoxNonce');
                    nonceTextBoxField.value = nonce;
                    var EnableCharge = document.getElementById('ButtonChargeCard').disabled = false; //'ButtonChargeCard'
                }
            },
            unsupportedBrowserDetected: function () {
                // Alert the buyer that their browser is not supported
            }
        }
    });

我使用了SqPaymentForm,它总是提供随机数,但我没有得到一个。

bfhwhh0e

bfhwhh0e1#

我能够让我们的aspxvb.net4. 7. 2网站使用Square Web SDK。它需要从头开始创建一个新网站,并分2步付款。

vyswwuz2

vyswwuz22#

这是因为SqPaymentForm现在已经退役。我已经发送了迁移指南,以帮助您迁移到Web支付SDK。🙂

相关问题