有没有办法利用bigcommerce api来捕获特定订单的资金,然后更新订单的状态?
我想将bigcommerce与我的主要ERP系统集成在一起,并希望自动获取资金。
API似乎不支持这一点,但是有没有人尝试过使用casper / jasper之类的东西来自动化商店仪表板?
发布于 2016-06-03 10:06:21
我以前在BigCommerce上做过Selenium自动化(惊讶,惊讶,mwah hah...jk:)。它已经一年多了,但这里有一个使用无头Firefox浏览器的示例(这需要一些预先安装):
#!/usr/bin/env python
# Load Dependencies:
from pyvirtualdisplay import Display
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
# Config Display and Select Web Driver:
display = Display(visible=0, size=(800, 600))
display.start()
#driver = webdriver.PhantomJS()
driver = webdriver.Firefox()
# Perform DashBoard Login: (replace USERNAME & PASSWORD appropriately) ...
driver.get('https://login.bigcommerce.com/login')
driver.find_element_by_id('user_email').send_keys("USERNAME")
driver.find_element_by_id('user_password').send_keys("PASSWORD")
driver.find_element_by_name('commit').click()
time.sleep(6)
# Now you are logged into the Control Panel.
# Navigate to the View Orders Page...
driver.get('https://STORE-HASH.mybigcommerce.com/admin/index.php?ToDo=viewOrders')
time.sleep(3)
# Now on the View Orders page, do your logic below. Click the buttons you need to click, etc.
#driver.find_element_by_xpath("//label[@for='SomeLabel']").click()
driver.quit()不过,我不推荐使用这种方法。我经常发现,由于欺诈性订单的增加,我经常调整许多不同平台的结帐流程,其中支付需要首先授权,直到确定它们可以安全捕获。
我们这样做的方式是通过一个外部托管的应用程序直接与支付处理器集成,该应用程序负责执行Capture或Void并适当地调整订单状态。您可以通过订单成功页面上的BC webhook或JS触发器向此应用程序发出新订单的警报。
发布于 2016-06-03 04:58:41
你可以使用像Selenium这样的东西实现自动化,但我在BigCommerce工作的两年中还没有人这样做过。我们正在寻找使API能够支持这类特性的方法。
https://stackoverflow.com/questions/37601480
复制相似问题