订单未出现在管理面板 shopify 中,但已在 Paypal 中注册

Order doesnt appear in admin panel shopify, but is registered in Paypal

我在我的单个产品页面上添加了第二个自定义 Paypal 按钮,以便为我的用户关闭动态支付按钮。

我成功做到了,按钮有效,Paypal 付款已收到。

但是,我有一个问题,即客户下的订单没有在管理面板仪表板 (Shopify) 中注册,所以我的物流

也能看到。我的代码在

产品-template.liquid

是这样的

按钮代码

 <div class="product-single__add js-product-buttons{% unless product.available %} product-single__add--sold{% endunless %}">

                                            <button type="submit" name="add" class="c-btn c-btn--full c-btn--plus c-btn--{% if section.settings.enable_payment_button %}light{% else %}primary{% endif %} product-single__add-btn js-product-add">
                                                <span class="js-product-add-text">{{ 'products.product.add_to_cart' | t }}</span>
                                            </button>
                                            {% if section.settings.enable_payment_button %}
                                                {{ form | payment_button }}
                                             
                                            {% endif %}
                                        </div>
                                    {% endform %}
                                     <!-- Set up a container element for the button -->
                                      <!--<div id="paypal-button-container"></div> -->
                                        </div>
                                    {% endform %}
                                     <!-- Set up a container element for the button -->
                                   <div id="paypal-button-container"></div> 

我的javascript是这样的

<script>
    // Render the PayPal button into #paypal-button-container
    paypal.Buttons({

        // Set up the transaction
        createOrder: function(data, actions) {
            return actions.order.create({
                purchase_units: [{
                    amount: {
                      value: {{product.price | dividedby: 100.0  }}
                    }
                }]
            });
        },

        // Finalize the transaction
        onApprove: function(data, actions) {
            return actions.order.capture().then(function(details) {
                // Show a success message to the buyer
                alert('Transaction completed by ' + details.payer.name.given_name + '!');
            });
        }


    }).render('#paypal-button-container');
</script>

因为我是 Shopify 的新手,所以我应该在现有的 javascript.

中实施一个事件或功能

Shopify 中的 PayPal 支付是预建的。因此,任何建立在默认可用支付之上的自定义 PayPal 支付都将独立运作。因此,将错过订单履行。

您还可以在 Shopify 后台手动创建订单,以记录您在 Shopify 外部下的订单或向您的客户发送发票。

请参考这篇Link

谢谢。