Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v:2.0:transaction_xml_datafeed [2015/09/23 21:10] – [Hosted Gateways] foxylukev:2.0:transaction_xml_datafeed [2024/09/09 10:24] (current) – [Hosted Gateways] adam
Line 1: Line 1:
 ====== Transaction XML Datafeeds: Instant Transaction Notification ====== ====== Transaction XML Datafeeds: Instant Transaction Notification ======
    
 +====== Transaction XML Datafeed ======
 +
 +<WRAP TIP>
 +__**NOTE: The Transaction XML Datafeed is deprecated**__
 +Though this legacy datafeed works and will continue to function in the future, it will not see any new functionality. We recommend any new integrations requiring a feed of transactions use FoxyCart's JSON Webhook: https://wiki.foxycart.com/v/2.0/webhooks#json_webhook
 +</WRAP>
 +
 +
 +
 ===== An Overview of FoxyCart's Transaction XML Datafeed ===== ===== An Overview of FoxyCart's Transaction XML Datafeed =====
  
Line 10: Line 19:
  
 ===== DETAILS, BEST PRACTICES and TESTING Recommendations ===== ===== DETAILS, BEST PRACTICES and TESTING Recommendations =====
 +
 +==== Setting your datafeed URL ====
 +
 +The datafeed can be enabled for your store from the "Advanced" settings page of the FoxyCart administration. Check the option labelled "Would you like to enable your store datafeed?", and enter your datafeed endpoint URL into the text input labelled "datafeed url" that appears below it.
 +
 +==== Getting the datafeed decryption key ====
 +
 +The datafeed payload is encrypted with a key from your store, which you can access from the "advanced" settings page in the FoxyCart administration, from the [[v:2.0:store_secret|"store secret" value]].
 ==== Details ==== ==== Details ====
   * When the datafeed is sent it **REQUIRES A RESPONSE OF ''foxy''** in order to indicate success. If anything other than ''foxy'' is returned by your datafeed processing script, FoxyCart will assume that your script errored, and you will be alerted.   * When the datafeed is sent it **REQUIRES A RESPONSE OF ''foxy''** in order to indicate success. If anything other than ''foxy'' is returned by your datafeed processing script, FoxyCart will assume that your script errored, and you will be alerted.
   * The Transaction XML Datafeed is sent immediately, in between the checkout and the receipt during your customers' transactions.   * The Transaction XML Datafeed is sent immediately, in between the checkout and the receipt during your customers' transactions.
  
 +=== Security and encryption ===
 +  * The datafeed is RC4-encrypted and URLencoded. As RC4 libraries are difficult to find, and URLencoding is odd, it's typically //far// easier to start with the example code in your language and/or system of choice at the [[integration:start#view_integrations|Integrations]] page.
 ==== Testing ==== ==== Testing ====
 When you're testing your custom XML integration, don't run transactions through FoxyCart. This is both time consuming (as you have to add-to-cart and checkout), but it also doesn't give you any indication of what's actually going wrong. When you're testing your custom XML integration, don't run transactions through FoxyCart. This is both time consuming (as you have to add-to-cart and checkout), but it also doesn't give you any indication of what's actually going wrong.
Line 56: Line 75:
 Here is the current list of hosted gateways which take advantage of the status field: Here is the current list of hosted gateways which take advantage of the status field:
  
-  * PayPal Express Checkout +  * 2Checkout 
-  * DIBS +  * Adyen
-  * Ogone +
-  * Dwolla+
   * Amazon   * Amazon
   * BitPay   * BitPay
   * Coinbase   * Coinbase
 +  * Comgate
   * Cybersource Secure Acceptance Web/Mobile   * Cybersource Secure Acceptance Web/Mobile
-  * Plug'n Pay Noble+  * DIBS 
 +  * Dwolla 
 +  * MercadoPago 
 +  * Mollie 
 +  * Ogone 
 +  * PayPal Commerce Platform 
 +  * PayPal Express Checkout 
 +  * PayPal Plus
   * PesaPal   * PesaPal
   * Skrill   * Skrill
-  * Plug'n Pay SmartScreen 
-  * 2Checkout 
  
 ===== Errors ===== ===== Errors =====
Line 77: Line 100:
  
 === What do I do now? === === What do I do now? ===
-  - Check the error: You can see the specific error that was triggered by your datafeed by viewing the errors page of your stores FoxyCart administration. Check out this page: http://wiki.foxycart.com/primer/errors for information on what the error logs mean for your datafeed. Based on the particular error you\'re receiving, you may need to make changes to your endpoint to correct the issue. If you don\'t manage your particular endpoint, you\'ll need to get in touch with the people that do with details of the error.+  - Check the error: You can see the specific error that was triggered by your datafeed by viewing the errors page of your stores FoxyCart administration. Check out this page: http://wiki.foxycart.com/primer/errors for information on what the error logs mean for your datafeed. Based on the particular error you're receiving, you may need to make changes to your endpoint to correct the issue. If you don't manage your particular endpoint, you'll need to get in touch with the people that do with details of the error.
   - Refeed the transaction: You can also try to refeed the transaction details to your endpoint, which you can do by navigating to the transactions report section of the FoxyCart administration, expanding the relevant transaction and clicking the option to "Re-feed it now"   - Refeed the transaction: You can also try to refeed the transaction details to your endpoint, which you can do by navigating to the transactions report section of the FoxyCart administration, expanding the relevant transaction and clicking the option to "Re-feed it now"
  
 ===== Example XML ===== ===== Example XML =====
 +**NOTE:** The user agent that is used for datafeed requests to your endpoint is:
 +''FoxyCart Webhook v2.0 (http://wiki.foxycart.com/v/2.0/webhooks)''
 +
 ==== Non-MultiShip Store ==== ==== Non-MultiShip Store ====
-<code xml>+<file xml>
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <foxydata> <foxydata>
Line 132: Line 158:
  <tax_total><![CDATA[0]]></tax_total>  <tax_total><![CDATA[0]]></tax_total>
  <shipping_total><![CDATA[7.52]]></shipping_total>  <shipping_total><![CDATA[7.52]]></shipping_total>
- <order_total><![CDATA[19.87]]></order_total>+ <order_total><![CDATA[14.87]]></order_total>
  <payment_gateway_type><![CDATA[authorize]]></payment_gateway_type>  <payment_gateway_type><![CDATA[authorize]]></payment_gateway_type>
  <receipt_url><![CDATA[http://themancan.foxycart.com/receipt?id=28a313c5217794e89a989ccd69eefa40]]></receipt_url>  <receipt_url><![CDATA[http://themancan.foxycart.com/receipt?id=28a313c5217794e89a989ccd69eefa40]]></receipt_url>
  <taxes/>  <taxes/>
- <discounts/>+ <discounts
 + <discount> 
 + <code><![CDATA[asdf]]></code> 
 + <valid_categories/> 
 + <name><![CDATA[$5 off all orders over $5!]]></name> 
 + <amount><![CDATA[-5]]></amount> 
 + <display><![CDATA[-5.00]]></display> 
 + <coupon_discount_type><![CDATA[price_amount]]></coupon_discount_type> 
 + <coupon_discount_details><![CDATA[5-5]]></coupon_discount_details> 
 + </discount> 
 + </discounts>
  <attributes/>  <attributes/>
  <status>approved</status>  <status>approved</status>
Line 205: Line 241:
  </transactions>  </transactions>
 </foxydata> </foxydata>
-</code>+</file>
  
 ==== MultiShip Store ==== ==== MultiShip Store ====
-<code xml>+<file xml>
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <foxydata> <foxydata>
Line 416: Line 452:
  </transactions>  </transactions>
 </foxydata> </foxydata>
-</code>+</file>
  
 ===== Example Parsing Code ===== ===== Example Parsing Code =====
Line 694: Line 730:
 var key = 'foo'; var key = 'foo';
 var decipher = crypto.createDecipheriv('rc4', key, ''); var decipher = crypto.createDecipheriv('rc4', key, '');
-var message = decipher.update(encrypted) + decipher.final();+var message = decipher.update(encrypted, 'binary', 'utf8') + decipher.final('utf8');
 console.log(message); // bar console.log(message); // bar
 </code> </code>

Site Tools