Created
November 29, 2013 17:19
-
-
Save shadyvb/7708977 to your computer and use it in GitHub Desktop.
usa-epay patch to send item data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 33ba1d8b22781027e9c02f42a01342c35a5a11da Mon Sep 17 00:00:00 2001 | |
From: Shady Sharaf <shady@sharaf.me> | |
Date: Fri, 29 Nov 2013 07:01:05 +0200 | |
Subject: [PATCH] Add missing fields | |
--- | |
woocommerce-gateway-usaepay.php | 12 ++++++++++++ | |
1 file changed, 12 insertions(+) | |
diff --git a/woocommerce-gateway-usaepay.php b/woocommerce-gateway-usaepay.php | |
index 10706b4..babd628 100755 | |
--- a/woocommerce-gateway-usaepay.php | |
+++ b/woocommerce-gateway-usaepay.php | |
@@ -321,6 +321,18 @@ function woocommerce_gateway_usaepay_init() { | |
$tran->cvv2 = $this->get_post('usaepay_cvv'); | |
} | |
+ // Add line items | |
+ foreach ( $order->get_items() as $item ) { | |
+ $tran->addLine( | |
+ get_post_meta( $item['product_id'], '_sku', true ), | |
+ $item['name'], | |
+ $item['name'], | |
+ $item['line_total'], | |
+ $item['qty'], | |
+ ! empty( $item['line_tax'] ) | |
+ ); | |
+ } | |
+ | |
// Billing Fields | |
$tran->billfname = $order->billing_first_name; | |
$tran->billlname = $order->billing_last_name; | |
-- | |
1.8.4.3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice work. Looking for a complete one?
http://pledgedplugins.com/product/usa-epay-payment-gateway-woocommerce/