Changeset 2914592
- Timestamp:
- 05/19/2023 06:24:21 AM (3 years ago)
- Location:
- zipmoney-payments-woocommerce
- Files:
-
- 188 added
- 7 edited
-
tags/2.3.17 (added)
-
tags/2.3.17/README.txt (added)
-
tags/2.3.17/assets (added)
-
tags/2.3.17/assets/css (added)
-
tags/2.3.17/assets/css/woocommerce-zipmoney-payment-admin.css (added)
-
tags/2.3.17/assets/css/woocommerce-zipmoney-payment-front.css (added)
-
tags/2.3.17/assets/img (added)
-
tags/2.3.17/assets/img/loader.gif (added)
-
tags/2.3.17/assets/img/loading.gif (added)
-
tags/2.3.17/assets/js (added)
-
tags/2.3.17/assets/js/admin_options.js (added)
-
tags/2.3.17/assets/js/woocommerce-zipmoney-payment-front.js (added)
-
tags/2.3.17/assets/js/zip_order_button.js (added)
-
tags/2.3.17/build (added)
-
tags/2.3.17/build/index.asset.php (added)
-
tags/2.3.17/build/index.js (added)
-
tags/2.3.17/build/index.js.map (added)
-
tags/2.3.17/includes (added)
-
tags/2.3.17/includes/api (added)
-
tags/2.3.17/includes/api/class-wc-zipmoney-payment-gateway-api-abstract.php (added)
-
tags/2.3.17/includes/api/class-wc-zipmoney-payment-gateway-api-charge.php (added)
-
tags/2.3.17/includes/api/class-wc-zipmoney-payment-gateway-api-checkout.php (added)
-
tags/2.3.17/includes/class-wc-zipmoney-payment-gateway-blocks-support.php (added)
-
tags/2.3.17/includes/class-wc-zipmoney-payment-gateway-config.php (added)
-
tags/2.3.17/includes/class-wc-zipmoney-payment-gateway-util.php (added)
-
tags/2.3.17/includes/class-wc-zipmoney-payment-gateway-widget.php (added)
-
tags/2.3.17/includes/class-wc-zipmoney-payment-gateway.php (added)
-
tags/2.3.17/includes/compatibility (added)
-
tags/2.3.17/includes/compatibility/abstract-wc-data-compatibility.php (added)
-
tags/2.3.17/includes/compatibility/class-wc-core-compatibility.php (added)
-
tags/2.3.17/includes/compatibility/class-wc-order-compatibility.php (added)
-
tags/2.3.17/includes/controller (added)
-
tags/2.3.17/includes/controller/class-wc-zipmoney-payment-abstract-controller.php (added)
-
tags/2.3.17/includes/controller/class-wc-zipmoney-payment-charge-controller.php (added)
-
tags/2.3.17/includes/controller/class-wc-zipmoney-payment-checkout-controller.php (added)
-
tags/2.3.17/includes/view (added)
-
tags/2.3.17/includes/view/backend (added)
-
tags/2.3.17/includes/view/backend/admin_options.php (added)
-
tags/2.3.17/includes/view/backend/charge_buttons.php (added)
-
tags/2.3.17/includes/view/frontend (added)
-
tags/2.3.17/includes/view/frontend/checkout_notification_section.php (added)
-
tags/2.3.17/includes/view/frontend/error_page.php (added)
-
tags/2.3.17/includes/view/frontend/express_payment_button.php (added)
-
tags/2.3.17/includes/view/frontend/iframe_redirect.php (added)
-
tags/2.3.17/includes/view/frontend/notification_page.php (added)
-
tags/2.3.17/includes/view/frontend/order_button.php (added)
-
tags/2.3.17/languages (added)
-
tags/2.3.17/languages/default.mo (added)
-
tags/2.3.17/languages/default.po (added)
-
tags/2.3.17/languages/default.pot (added)
-
tags/2.3.17/languages/zippayment-es_MX.mo (added)
-
tags/2.3.17/languages/zippayment-es_MX.po (added)
-
tags/2.3.17/tests (added)
-
tags/2.3.17/tests/bootstrap.php (added)
-
tags/2.3.17/tests/test-charge-api.php (added)
-
tags/2.3.17/tests/test-checkout-api.php (added)
-
tags/2.3.17/tests/test-sample.php (added)
-
tags/2.3.17/tests/wc-zipmoney-test-main.php (added)
-
tags/2.3.17/vendor (added)
-
tags/2.3.17/vendor/autoload.php (added)
-
tags/2.3.17/vendor/composer (added)
-
tags/2.3.17/vendor/composer/ClassLoader.php (added)
-
tags/2.3.17/vendor/composer/LICENSE (added)
-
tags/2.3.17/vendor/composer/autoload_classmap.php (added)
-
tags/2.3.17/vendor/composer/autoload_namespaces.php (added)
-
tags/2.3.17/vendor/composer/autoload_psr4.php (added)
-
tags/2.3.17/vendor/composer/autoload_real.php (added)
-
tags/2.3.17/vendor/composer/autoload_static.php (added)
-
tags/2.3.17/vendor/composer/installed.json (added)
-
tags/2.3.17/vendor/zipmoney (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/LICENSE.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/README.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/autoload.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/build (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/build.xml (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/build/shell (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/build/shell/publish.sh (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/composer.json (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Api (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Api/ChargesApi.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Api/CheckoutsApi.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Api/CustomersApi.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Api/RefundsApi.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Api/SettlementsApi.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Api/TokensApi.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Address.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Authority.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CaptureChargeRequest.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Charge.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/ChargeCollection.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/ChargeOrder.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Checkout.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CheckoutConfiguration.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CheckoutFeatures.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CheckoutFeaturesTokenisation.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CheckoutOrder.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CreateChargeRequest.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CreateCheckoutRequest.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CreateCheckoutRequestFeatures.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CreateCheckoutRequestFeaturesTokenisation.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CreateRefundRequest.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/CreateTokenRequest.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Customer.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/ErrorResponse.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/ErrorResponseError.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/ErrorResponseErrorDetails.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Flightadditionaldetails.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/FlightadditionaldetailsPassengers.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/HateoasLinks.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/HateoaslinksLinks.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/InlineResponse200.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Metadata.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/OrderItem.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/OrderItemAdditionalDetails.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/OrderShipping.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/OrderShippingTracking.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Refund.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Settlement.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/SettlementTransactions.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Shopper.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/ShopperStatistics.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/docs/Model/Token.md (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Api (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Api/ChargesApi.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Api/CheckoutsApi.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Api/CustomersApi.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Api/RefundsApi.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Api/SettlementsApi.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Api/TokensApi.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/ApiClient.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/ApiException.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Configuration.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Address.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Authority.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CaptureChargeRequest.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Charge.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/ChargeCollection.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/ChargeOrder.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Checkout.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CheckoutConfiguration.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CheckoutFeatures.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CheckoutFeaturesTokenisation.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CheckoutOrder.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CreateChargeRequest.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CreateCheckoutRequest.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CreateCheckoutRequestFeatures.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CreateCheckoutRequestFeaturesTokenisation.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CreateRefundRequest.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CreateTokenRequest.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/CurrencyUtil.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Customer.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/ErrorResponse.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/ErrorResponseError.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/ErrorResponseErrorDetails.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Flightadditionaldetails.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/FlightadditionaldetailsPassengers.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/HateoasLinks.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/HateoaslinksLinks.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/InlineResponse200.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Metadata.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/OrderItem.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/OrderItemAdditionalDetails.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/OrderShipping.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/OrderShippingTracking.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Refund.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Settlement.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/SettlementTransactions.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Shopper.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/ShopperStatistics.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/Model/Token.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/lib/ObjectSerializer.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/phpunit.xml.dist (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/test (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/test/Api (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/test/Api/ChargesApiTest.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/test/Api/CheckoutsApiTest.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/test/Api/RefundsApiTest.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/test/ConfigurationTest.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/test/Helper (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/test/Helper/Payload.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/test/Setup.php (added)
-
tags/2.3.17/vendor/zipmoney/merchantapi-php/test/auth.ini (added)
-
tags/2.3.17/zipmoney-payment-gateway.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/includes/class-wc-zipmoney-payment-gateway.php (modified) (1 diff)
-
trunk/tests/bootstrap.php (modified) (1 diff)
-
trunk/tests/test-charge-api.php (modified) (1 diff)
-
trunk/tests/test-checkout-api.php (modified) (1 diff)
-
trunk/tests/wc-zipmoney-test-main.php (modified) (previous)
-
trunk/zipmoney-payment-gateway.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
zipmoney-payments-woocommerce/trunk/README.txt
r2806192 r2914592 3 3 Tags: zipmoney payments woocommerce, zipmoney payments module for woocommerce, zipmoney woocommerce addon , zipmoney payment gateway for woocommerce, zipmoney for woocommerce, zipmoney payment gateway for wordpress, buy now pay later, zippay woocommerce plugin, Own it now, pay later, Zip Co, Zip 4 4 Requires at least: WP 4.0 5 Tested up to: 6. 0.36 Stable tag: 2.3.1 65 Tested up to: 6.2 6 Stable tag: 2.3.17 7 7 License: GPLv2 or later License http://www.gnu.org/licenses/gpl-2.0.html 8 8 … … 218 218 219 219 = 2.3.16 = 220 * Fixed some security related issues 220 * Fixed some security related 221 222 = 2.3.17 = 223 * Test plugin with wordpress 6.2 and woocommerce 7.5.1 -
zipmoney-payments-woocommerce/trunk/includes/class-wc-zipmoney-payment-gateway.php
r2806192 r2914592 24 24 public $description = 'Own the way you pay'; 25 25 26 public $version = '2.3.1 6';26 public $version = '2.3.17'; 27 27 28 28 public $supports = array( 'products', 'refunds' ); -
zipmoney-payments-woocommerce/trunk/tests/bootstrap.php
r2283719 r2914592 18 18 */ 19 19 function _manually_load_plugin() { 20 require'/tmp/wordpress/wp-content/plugins/woocommerce/woocommerce.php';20 require '/tmp/wordpress/wp-content/plugins/woocommerce/woocommerce.php'; 21 21 require dirname( dirname( __FILE__ ) ) . '/zipmoney-payment-gateway.php'; 22 22 } -
zipmoney-payments-woocommerce/trunk/tests/test-charge-api.php
r2374952 r2914592 6 6 * @package Woocommerce_Zipmoneypayment_Apiv2 7 7 */ 8 class ChargeApiTest extends WC_ZipmoneyPaymentGatewayTestMain 9 { 10 11 public function charge_result_provider() 12 { 13 $states = array('captured', 'authorised', 'cancelled') ; 14 15 $result = array(); 16 17 foreach($states as $state){ 18 $result[] = array(new \zipMoney\Model\Charge( 19 array( 20 'id' => 'test', 21 'state' => $state 22 ) 23 )); 24 } 25 26 return $result; 27 } 28 29 public function exception_provider() 30 { 31 return array( 32 array(new \Exception()), 33 array(new \zipMoney\ApiException()) 34 ); 35 } 36 37 /** 38 * @dataProvider charge_result_provider 39 */ 40 public function test_create_charge($charge_result) 41 { 42 $api_instance = $this->getMock('\zipMoney\Api\ChargesApi'); 43 $api_instance->expects($this->once()) 44 ->method('chargesCreate') 45 ->will($this->returnValue($charge_result)); 46 47 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 48 $this->payment_gateway, 49 $api_instance 50 ); 51 52 $order = self::get_mock_order(); 53 54 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->create_charge($this->WC_Session, 'key', $order); 55 56 $this->assertArrayHasKey('success', $response); 57 $this->assertArrayHasKey('message', $response); 58 $this->assertArrayHasKey('order', $response); 59 60 if($charge_result->getState() == 'cancelled'){ 61 $this->assertFalse($response['success']); 62 } else { 63 $this->assertTrue($response['success']); 64 } 65 } 66 67 68 /** 69 * @dataProvider exception_provider 70 */ 71 public function test_create_charge_with_exception($exception) 72 { 73 $api_instance = $this->getMock('\zipMoney\Api\ChargesApi'); 74 $api_instance->expects($this->once()) 75 ->method('chargesCreate') 76 ->will($this->throwException($exception)); 77 78 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 79 $this->payment_gateway, 80 $api_instance 81 ); 82 83 $order = self::get_mock_order(); 84 85 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->create_charge($this->WC_Session, 'key', $order); 86 $this->assertArrayHasKey('success', $response); 87 $this->assertArrayHasKey('message', $response); 88 89 $this->assertFalse($response['success']); 90 } 91 92 /** 93 * @dataProvider charge_result_provider 94 */ 95 public function test_capture_charge($charge_result) 96 { 97 $api_instance = $this->getMock('\zipMoney\Api\ChargesApi'); 98 $api_instance->expects($this->any()) 99 ->method('chargesCapture') 100 ->will($this->returnValue($charge_result)); 101 102 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 103 $this->payment_gateway, 104 $api_instance 105 ); 106 107 $order = self::get_mock_order(); 108 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->capture_order_charge($order, 'key'); 109 $this->assertFalse($response); 110 111 //order status is not authorized 112 update_post_meta($this->get_order_id($order), WC_Zipmoney_Payment_Gateway_Config::META_CHARGE_ID, 'charge_id'); 113 $order = self::get_mock_order('processing'); 114 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->capture_order_charge($order, 'key'); 115 $this->assertFalse($response); 116 117 $order = self::get_mock_order(WC_Zipmoney_Payment_Gateway_Config::ZIP_ORDER_STATUS_AUTHORIZED_KEY_COMPARE); 118 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->capture_order_charge($order, 'key'); 119 120 if ($charge_result->getState() == 'captured') { 121 $this->assertTrue($response); 122 } else { 123 $this->assertFalse($response); 124 } 125 } 126 127 /** 128 * @param null $status 129 * @return mixed 130 */ 131 private function get_mock_order($status = null) 132 { 133 $order = $this->getMock('WC_Order'); 134 $order->expects($this->any()) 135 ->method('payment_complete') 136 ->will($this->returnValue(null)); 137 138 $order = $this->set_order_id($order); 139 140 if(empty($status)){ 141 return $order; 142 } 143 144 $order->expects($this->any()) 145 ->method('get_status') 146 ->will($this->returnValue($status)); 147 148 return $order; 149 } 150 151 /** 152 * @dataProvider exception_provider 153 */ 154 public function test_capture_charge_with_exception($exception) 155 { 156 $api_instance = $this->getMock('\zipMoney\Api\ChargesApi'); 157 $api_instance->expects($this->any()) 158 ->method('chargesCapture') 159 ->will($this->throwException($exception)); 160 161 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 162 $this->payment_gateway, 163 $api_instance 164 ); 165 166 $order = self::get_mock_order(); 167 168 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->capture_order_charge($order, 'key'); 169 $this->assertFalse($response); 170 } 171 172 /** 173 * @dataProvider charge_result_provider 174 */ 175 public function test_cancel_order_charge($charge_result) 176 { 177 $api_instance = $this->getMock('\zipMoney\Api\ChargesApi'); 178 $api_instance->expects($this->any()) 179 ->method('chargesCancel') 180 ->will($this->returnValue($charge_result)); 181 182 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 183 $this->payment_gateway, 184 $api_instance 185 ); 186 187 $order = self::get_mock_order(); 188 189 //order without charge_id 190 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->cancel_order_charge($order, 'key'); 191 $this->assertFalse($response); 192 193 //order status is not authorized 194 update_post_meta($this->get_order_id($order), WC_Zipmoney_Payment_Gateway_Config::META_CHARGE_ID, 'charge_id'); 195 self::get_mock_order('processing'); 196 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->cancel_order_charge($order, 'key'); 197 $this->assertFalse($response); 198 199 $order = self::get_mock_order(WC_Zipmoney_Payment_Gateway_Config::ZIP_ORDER_STATUS_AUTHORIZED_KEY_COMPARE); 200 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->cancel_order_charge($order, 'key'); 201 202 if ($charge_result->getState() == 'cancelled') { 203 $this->assertTrue($response); 204 } else { 205 $this->assertFalse($response); 206 } 207 } 208 209 /** 210 * @dataProvider exception_provider 211 */ 212 public function test_cancel_charge_with_exception($exception) 213 { 214 $api_instance = $this->getMock('\zipMoney\Api\ChargesApi'); 215 $api_instance->expects($this->any()) 216 ->method('chargesCancel') 217 ->will($this->throwException($exception)); 218 219 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 220 $this->payment_gateway, 221 $api_instance 222 ); 223 224 $order = self::get_mock_order(); 225 226 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->capture_order_charge($order, 'key'); 227 $this->assertFalse($response); 228 } 229 230 public function test_refund_order() 231 { 232 $api_instance = $this->getMock('\zipMoney\Api\RefundsApi'); 233 $api_instance->expects($this->any()) 234 ->method('refundsCreate') 235 ->will($this->returnValue(new \zipMoney\Model\Refund())); 236 237 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 238 $this->payment_gateway, 239 $api_instance 240 ); 241 242 $order = self::get_mock_order(); 243 244 //order without charge_id 245 $order = $this->set_order_id($order); 246 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->refund_order_charge( 247 $order, 248 'key', 249 100, 250 'Reason' 251 ); 252 $this->assertFalse($response); 253 254 update_post_meta($this->get_order_id($order), WC_Zipmoney_Payment_Gateway_Config::META_CHARGE_ID, 'charge_id'); 255 256 //order with <=0 amount 257 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->refund_order_charge( 258 $order, 259 'key', 260 0, 261 'Reason' 262 ); 263 $this->assertFalse($response); 264 265 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->refund_order_charge( 266 $order, 267 'key', 268 -100, 269 'Reason' 270 ); 271 $this->assertFalse($response); 272 273 //correct order 274 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->refund_order_charge( 275 $order, 276 'key', 277 100, 278 'Reason' 279 ); 280 $this->assertTrue($response); 281 } 282 283 /** 284 * @dataProvider exception_provider 285 */ 286 public function test_refund_order_with_exception($exception) 287 { 288 $api_instance = $this->getMock('\zipMoney\Api\RefundsApi'); 289 $api_instance->expects($this->any()) 290 ->method('refundsCreate') 291 ->will($this->throwException($exception)); 292 293 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 294 $this->payment_gateway, 295 $api_instance 296 ); 297 298 $order = self::get_mock_order(); 299 update_post_meta($this->get_order_id($order), WC_Zipmoney_Payment_Gateway_Config::META_CHARGE_ID, 'charge_id'); 300 301 //correct order 302 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->refund_order_charge( 303 $order, 304 'key', 305 100, 306 'Reason' 307 ); 308 $this->assertFalse($response); 309 } 310 311 public function get_order_id($order){ 312 return version_compare(WC_VERSION, "3.0", "<") ? $order->id : $order->get_id(); 313 } 314 public function set_order_id($order, $value = 1){ 315 if(version_compare(WC_VERSION, "3.0", "<")){ 316 $order->id = $value; 317 }else{ 318 $order->expects($this->any()) 319 ->method('get_id') 320 ->will($this->returnValue($value)); 321 } 322 return $order; 323 } 8 class ChargeApiTest extends WC_ZipmoneyPaymentGatewayTestMain { 9 10 11 public function charge_result_provider() { 12 $states = array( 'captured', 'authorised', 'cancelled' ); 13 14 $result = array(); 15 16 foreach ( $states as $state ) { 17 $result[] = array( 18 new \zipMoney\Model\Charge( 19 array( 20 'id' => 'test', 21 'state' => $state, 22 ) 23 ), 24 ); 25 } 26 27 return $result; 28 } 29 30 public function exception_provider() { 31 return array( 32 array( new \Exception() ), 33 array( new \zipMoney\ApiException() ), 34 ); 35 } 36 37 /** 38 * @dataProvider charge_result_provider 39 */ 40 public function test_create_charge( $charge_result ) { 41 $api_instance = $this->getMock( '\zipMoney\Api\ChargesApi' ); 42 $api_instance->expects( $this->once() ) 43 ->method( 'chargesCreate' ) 44 ->will( $this->returnValue( $charge_result ) ); 45 46 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 47 $this->payment_gateway, 48 $api_instance 49 ); 50 51 $order = self::get_mock_order(); 52 53 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->create_charge( $this->WC_Session, 'key', $order ); 54 55 $this->assertArrayHasKey( 'success', $response ); 56 $this->assertArrayHasKey( 'message', $response ); 57 $this->assertArrayHasKey( 'order', $response ); 58 59 if ( $charge_result->getState() == 'cancelled' ) { 60 $this->assertFalse( $response['success'] ); 61 } else { 62 $this->assertTrue( $response['success'] ); 63 } 64 } 65 66 67 /** 68 * @dataProvider exception_provider 69 */ 70 public function test_create_charge_with_exception( $exception ) { 71 $api_instance = $this->getMock( '\zipMoney\Api\ChargesApi' ); 72 $api_instance->expects( $this->once() ) 73 ->method( 'chargesCreate' ) 74 ->will( $this->throwException( $exception ) ); 75 76 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 77 $this->payment_gateway, 78 $api_instance 79 ); 80 81 $order = self::get_mock_order(); 82 83 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->create_charge( $this->WC_Session, 'key', $order ); 84 $this->assertArrayHasKey( 'success', $response ); 85 $this->assertArrayHasKey( 'message', $response ); 86 87 $this->assertFalse( $response['success'] ); 88 } 89 90 /** 91 * @dataProvider charge_result_provider 92 */ 93 public function test_capture_charge( $charge_result ) { 94 $api_instance = $this->getMock( '\zipMoney\Api\ChargesApi' ); 95 $api_instance->expects( $this->any() ) 96 ->method( 'chargesCapture' ) 97 ->will( $this->returnValue( $charge_result ) ); 98 99 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 100 $this->payment_gateway, 101 $api_instance 102 ); 103 104 $order = self::get_mock_order(); 105 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->capture_order_charge( $order, 'key' ); 106 $this->assertFalse( $response ); 107 108 // order status is not authorized 109 update_post_meta( $this->get_order_id( $order ), WC_Zipmoney_Payment_Gateway_Config::META_CHARGE_ID, 'charge_id' ); 110 $order = self::get_mock_order( 'processing' ); 111 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->capture_order_charge( $order, 'key' ); 112 $this->assertFalse( $response ); 113 114 $order = self::get_mock_order( WC_Zipmoney_Payment_Gateway_Config::ZIP_ORDER_STATUS_AUTHORIZED_KEY_COMPARE ); 115 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->capture_order_charge( $order, 'key' ); 116 117 if ( $charge_result->getState() == 'captured' ) { 118 $this->assertTrue( $response ); 119 } else { 120 $this->assertFalse( $response ); 121 } 122 } 123 124 /** 125 * @param null $status 126 * @return mixed 127 */ 128 private function get_mock_order( $status = null ) { 129 $order = $this->getMock( 'WC_Order' ); 130 $order->expects( $this->any() ) 131 ->method( 'payment_complete' ) 132 ->will( $this->returnValue( null ) ); 133 134 $order = $this->set_order_id( $order ); 135 136 if ( empty( $status ) ) { 137 return $order; 138 } 139 140 $order->expects( $this->any() ) 141 ->method( 'get_status' ) 142 ->will( $this->returnValue( $status ) ); 143 144 return $order; 145 } 146 147 /** 148 * @dataProvider exception_provider 149 */ 150 public function test_capture_charge_with_exception( $exception ) { 151 $api_instance = $this->getMock( '\zipMoney\Api\ChargesApi' ); 152 $api_instance->expects( $this->any() ) 153 ->method( 'chargesCapture' ) 154 ->will( $this->throwException( $exception ) ); 155 156 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 157 $this->payment_gateway, 158 $api_instance 159 ); 160 161 $order = self::get_mock_order(); 162 163 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->capture_order_charge( $order, 'key' ); 164 $this->assertFalse( $response ); 165 } 166 167 /** 168 * @dataProvider charge_result_provider 169 */ 170 public function test_cancel_order_charge( $charge_result ) { 171 $api_instance = $this->getMock( '\zipMoney\Api\ChargesApi' ); 172 $api_instance->expects( $this->any() ) 173 ->method( 'chargesCancel' ) 174 ->will( $this->returnValue( $charge_result ) ); 175 176 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 177 $this->payment_gateway, 178 $api_instance 179 ); 180 181 $order = self::get_mock_order(); 182 183 // order without charge_id 184 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->cancel_order_charge( $order, 'key' ); 185 $this->assertFalse( $response ); 186 187 // order status is not authorized 188 update_post_meta( $this->get_order_id( $order ), WC_Zipmoney_Payment_Gateway_Config::META_CHARGE_ID, 'charge_id' ); 189 self::get_mock_order( 'processing' ); 190 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->cancel_order_charge( $order, 'key' ); 191 $this->assertFalse( $response ); 192 193 $order = self::get_mock_order( WC_Zipmoney_Payment_Gateway_Config::ZIP_ORDER_STATUS_AUTHORIZED_KEY_COMPARE ); 194 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->cancel_order_charge( $order, 'key' ); 195 196 if ( $charge_result->getState() == 'cancelled' ) { 197 $this->assertTrue( $response ); 198 } else { 199 $this->assertFalse( $response ); 200 } 201 } 202 203 /** 204 * @dataProvider exception_provider 205 */ 206 public function test_cancel_charge_with_exception( $exception ) { 207 $api_instance = $this->getMock( '\zipMoney\Api\ChargesApi' ); 208 $api_instance->expects( $this->any() ) 209 ->method( 'chargesCancel' ) 210 ->will( $this->throwException( $exception ) ); 211 212 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 213 $this->payment_gateway, 214 $api_instance 215 ); 216 217 $order = self::get_mock_order(); 218 219 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->capture_order_charge( $order, 'key' ); 220 $this->assertFalse( $response ); 221 } 222 223 public function test_refund_order() { 224 $api_instance = $this->getMock( '\zipMoney\Api\RefundsApi' ); 225 $api_instance->expects( $this->any() ) 226 ->method( 'refundsCreate' ) 227 ->will( $this->returnValue( new \zipMoney\Model\Refund() ) ); 228 229 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 230 $this->payment_gateway, 231 $api_instance 232 ); 233 234 $order = self::get_mock_order(); 235 236 // order without charge_id 237 $order = $this->set_order_id( $order ); 238 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->refund_order_charge( 239 $order, 240 'key', 241 100, 242 'Reason' 243 ); 244 $this->assertFalse( $response ); 245 246 update_post_meta( $this->get_order_id( $order ), WC_Zipmoney_Payment_Gateway_Config::META_CHARGE_ID, 'charge_id' ); 247 248 // order with <=0 amount 249 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->refund_order_charge( 250 $order, 251 'key', 252 0, 253 'Reason' 254 ); 255 $this->assertFalse( $response ); 256 257 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->refund_order_charge( 258 $order, 259 'key', 260 -100, 261 'Reason' 262 ); 263 $this->assertFalse( $response ); 264 265 // correct order 266 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->refund_order_charge( 267 $order, 268 'key', 269 100, 270 'Reason' 271 ); 272 $this->assertTrue( $response ); 273 } 274 275 /** 276 * @dataProvider exception_provider 277 */ 278 public function test_refund_order_with_exception( $exception ) { 279 $api_instance = $this->getMock( '\zipMoney\Api\RefundsApi' ); 280 $api_instance->expects( $this->any() ) 281 ->method( 'refundsCreate' ) 282 ->will( $this->throwException( $exception ) ); 283 284 $WC_Zipmoney_Payment_Gateway_API_Request_Charge = new WC_Zipmoney_Payment_Gateway_API_Request_Charge( 285 $this->payment_gateway, 286 $api_instance 287 ); 288 289 $order = self::get_mock_order(); 290 update_post_meta( $this->get_order_id( $order ), WC_Zipmoney_Payment_Gateway_Config::META_CHARGE_ID, 'charge_id' ); 291 292 // correct order 293 $response = $WC_Zipmoney_Payment_Gateway_API_Request_Charge->refund_order_charge( 294 $order, 295 'key', 296 100, 297 'Reason' 298 ); 299 $this->assertFalse( $response ); 300 } 301 302 public function get_order_id( $order ) { 303 return version_compare( WC_VERSION, '3.0', '<' ) ? $order->id : $order->get_id(); 304 } 305 public function set_order_id( $order, $value = 1 ) { 306 if ( version_compare( WC_VERSION, '3.0', '<' ) ) { 307 $order->id = $value; 308 } else { 309 $order->expects( $this->any() ) 310 ->method( 'get_id' ) 311 ->will( $this->returnValue( $value ) ); 312 } 313 return $order; 314 } 324 315 } -
zipmoney-payments-woocommerce/trunk/tests/test-checkout-api.php
r2283719 r2914592 6 6 * @package Woocommerce_Zipmoneypayment_Apiv2 7 7 */ 8 class CheckoutApiTest extends WC_ZipmoneyPaymentGatewayTestMain 9 { 10 public function exception_provider() 11 { 12 return array( 13 array(new \Exception()), 14 array(new \zipMoney\ApiException()) 15 ); 16 } 8 class CheckoutApiTest extends WC_ZipmoneyPaymentGatewayTestMain { 17 9 18 public function test_successful_checkout() 19 { 10 public function exception_provider() { 11 return array( 12 array( new \Exception() ), 13 array( new \zipMoney\ApiException() ), 14 ); 15 } 20 16 21 //set the output result 22 $checkout_result = new \zipMoney\Model\Checkout(array('id' => 'co_IwvE8adHGKg9YMURefHDD0')); 17 public function test_successful_checkout() { 18 // set the output result 19 $checkout_result = new \zipMoney\Model\Checkout( array( 'id' => 'co_IwvE8adHGKg9YMURefHDD0' ) ); 23 20 24 $api_instance = $this->getMock('\zipMoney\Api\CheckoutsApi');25 $api_instance->expects($this->once())26 ->method('checkoutsCreate')27 ->will($this->returnValue($checkout_result));21 $api_instance = $this->getMock( '\zipMoney\Api\CheckoutsApi' ); 22 $api_instance->expects( $this->once() ) 23 ->method( 'checkoutsCreate' ) 24 ->will( $this->returnValue( $checkout_result ) ); 28 25 29 $WC_Zipmoney_Payment_Gateway_API_Request_Checkout = new WC_Zipmoney_Payment_Gateway_API_Request_Checkout(30 $this->payment_gateway,31 $api_instance32 );26 $WC_Zipmoney_Payment_Gateway_API_Request_Checkout = new WC_Zipmoney_Payment_Gateway_API_Request_Checkout( 27 $this->payment_gateway, 28 $api_instance 29 ); 33 30 34 $this->createOrder(); 35 31 $this->createOrder(); 36 32 37 //$order = $this->getMock('WC_Order');33 // $order = $this->getMock('WC_Order'); 38 34 39 $result = $WC_Zipmoney_Payment_Gateway_API_Request_Checkout->create_checkout($this->WC_Session, 'url', 'key', $this->order);35 $result = $WC_Zipmoney_Payment_Gateway_API_Request_Checkout->create_checkout( $this->WC_Session, 'url', 'key', $this->order ); 40 36 41 $this->assertNotEmpty($result);42 $this->assertNotEmpty($result->getId());43 $this->assertEquals(get_class($result), 'zipMoney\Model\Checkout');44 }37 $this->assertNotEmpty( $result ); 38 $this->assertNotEmpty( $result->getId() ); 39 $this->assertEquals( get_class( $result ), 'zipMoney\Model\Checkout' ); 40 } 45 41 46 /**47 * @dataProvider exception_provider48 */49 // public function test_exception_checkout($exception)50 // {51 //$api_instance = $this->getMock('\zipMoney\Api\CheckoutsApi');42 /** 43 * @dataProvider exception_provider 44 */ 45 // public function test_exception_checkout($exception) 46 // { 47 // $api_instance = $this->getMock('\zipMoney\Api\CheckoutsApi'); 52 48 53 //$api_instance->expects($this->once())54 //->method('checkoutsCreate')55 //->will($this->throwException($exception));49 // $api_instance->expects($this->once()) 50 // ->method('checkoutsCreate') 51 // ->will($this->throwException($exception)); 56 52 57 // $WC_Zipmoney_Payment_Gateway_API_Request_Checkout = new WC_Zipmoney_Payment_Gateway_API_Request_Checkout( 58 // $this->payment_gateway, 59 // $api_instance 60 // ); 61 62 // $this->createOrder(); 53 // $WC_Zipmoney_Payment_Gateway_API_Request_Checkout = new WC_Zipmoney_Payment_Gateway_API_Request_Checkout( 54 // $this->payment_gateway, 55 // $api_instance 56 // ); 63 57 64 // $result = $WC_Zipmoney_Payment_Gateway_API_Request_Checkout->create_checkout($this->WC_Session, 'url', 'key',$this->order);58 // $this->createOrder(); 65 59 66 // $this->assertEmpty($result); 67 // } 60 // $result = $WC_Zipmoney_Payment_Gateway_API_Request_Checkout->create_checkout($this->WC_Session, 'url', 'key',$this->order); 68 61 69 private function createOrder(){ 70 global $woocommerce; 62 // $this->assertEmpty($result); 63 // } 71 64 72 if ( ! defined( 'WOOCOMMERCE_CART' ) ) 73 define( 'WOOCOMMERCE_CART', true ); 74 75 if(!$this->orderD){ 76 $woocommerce->cart->add_to_cart(53); 65 private function createOrder() { 66 global $woocommerce; 77 67 78 WC()->cart->calculate_totals(); 68 if ( ! defined( 'WOOCOMMERCE_CART' ) ) { 69 define( 'WOOCOMMERCE_CART', true ); 70 } 79 71 80 $order_id = $woocommerce->checkout()->create_order(array()); 72 if ( ! $this->orderD ) { 73 $woocommerce->cart->add_to_cart( 53 ); 81 74 82 $this->order = new WC_Order( $order_id ); 83 } 84 } 75 WC()->cart->calculate_totals(); 76 77 $order_id = $woocommerce->checkout()->create_order( array() ); 78 79 $this->order = new WC_Order( $order_id ); 80 } 81 } 85 82 86 83 } -
zipmoney-payments-woocommerce/trunk/zipmoney-payment-gateway.php
r2806192 r2914592 7 7 * Give your customers the power to pay later, interest free and watch your sales grow. 8 8 * Take advantage of our fast-growing customer base, proven revenue uplift, fast and simple integration. 9 * Version: 2.3.1 69 * Version: 2.3.17 10 10 * Author: Zip 11 11 * Author URI: https://www.zip.co/ … … 14 14 * Github URI: https://github.com/zipMoney/woocommerce/ 15 15 * WC requires at least: 2.6.13 16 * WC tested up to: 6.7.016 * WC tested up to: 7.5.1 17 17 * 18 * @version 2.3.1 618 * @version 2.3.17 19 19 * @package Zip 20 20 * @author Zip
Note: See TracChangeset
for help on using the changeset viewer.