diff --git a/src/Payeezy/Transaction.php b/src/Payeezy/Transaction.php index 790064b..820759a 100755 --- a/src/Payeezy/Transaction.php +++ b/src/Payeezy/Transaction.php @@ -131,7 +131,7 @@ public function postTransaction($payload, $headers) public function doPrimaryTransaction($args = array()) { $this->url = $this->baseURL; - $payload = json_encode($args, JSON_FORCE_OBJECT); + $payload = json_encode($args); $headerArray = $this->hmacAuthorizationToken($payload); $response_in_JSON = $this->postTransaction($payload, $headerArray); diff --git a/tests/Payeezy/CreditCardTest.php b/tests/Payeezy/CreditCardTest.php index cb276a2..bca2903 100644 --- a/tests/Payeezy/CreditCardTest.php +++ b/tests/Payeezy/CreditCardTest.php @@ -14,6 +14,61 @@ private function getPrimaryTxPayload() "card_number" => "4788250000028291", "exp_date" => "1020", "cvv" => "123" + ), + "billing_address" => array( + "street" => "123 Fake St.", + "state_province" => "NY", + "city" => "New York", + "country" => "USA", + "email" => "test@phpunit.com", + "zip_postal_code" => "12345", + "phone" => array( + "type" => "Cell", + "number" => "123-456-7890" + ) + ), + "level2" => array( + "tax1_amount" => "100", + "tax1_number" => "101", + "tax2_amount" => "200", + "tax2_number" => "202", + "customer_ref" => "7000" + ), + "level3" => array( + "alt_tax_amount" => "100", + "alt_tax_id" => "1000", + "discount_amount" => "5", + "duty_amount" => "6", + "freight_amount" => "7", + "ship_from_zip" => "10000", + "ship_to_address" => array( + "address_1" => "123 Ship St.", + "city" => "New York", + "state" => "NY", + "zip" => "12345", + "country" => "USA", + "email" => "shipto@me.com", + "phone" => "555-666-7777", + "name" => "The Customer" + ), + "line_items" => array( + array( + "description" => "Tacos", + "quantity" => "10", + "commodity_code" => "090909", + "discount_amount" => "69", + "discount_indicator" => "1", + "gross_net_indicator" => "0", + "line_item_total" => "14300", + "product_code" => "Level3", + "tax_amount" => "100", + "tax_rate" => "5", + "tax_type" => "2", + "unit_cost" => "1500", + "unit_of_measure" => "EA", + "email" => "tac@os.com" + ) + ) ) ];