Changeset 803586
- Timestamp:
- 11/13/2013 07:58:40 AM (12 years ago)
- Location:
- woocommerce-mpay24-gateway/trunk
- Files:
-
- 2 edited
-
MPay24/MDXI.xsd (modified) (9 diffs)
-
gateway-mpay24.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-mpay24-gateway/trunk/MPay24/MDXI.xsd
r803175 r803586 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> 3 <xs:simpleType name="LanguageType"> 4 <xs:restriction base="xs:string"> 5 <xs:enumeration value="EN"/> 6 <xs:enumeration value="DE"/> 7 <xs:enumeration value="BG"/> 8 <xs:enumeration value="FR"/> 9 <xs:enumeration value="HU"/> 10 <xs:enumeration value="NL"/> 11 <xs:enumeration value="ES"/> 12 <xs:enumeration value="IT"/> 13 <xs:enumeration value="CS"/> 14 <xs:enumeration value="HR"/> 15 <xs:enumeration value="SK"/> 16 <xs:enumeration value="SL"/> 17 <xs:enumeration value="SR"/> 18 <xs:enumeration value="RO"/> 19 <xs:enumeration value="RU"/> 20 <xs:enumeration value="PL"/> 21 <xs:enumeration value="PT"/> 22 <xs:enumeration value="TR"/> 23 <xs:enumeration value="ZH"/> 24 <xs:enumeration value="JA"/> 25 </xs:restriction> 26 </xs:simpleType> 27 <xs:simpleType name="ClientIPType"> 28 <xs:restriction base="xs:string"> 29 <xs:maxLength value="15"/> 30 <xs:pattern value="[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"/> 31 </xs:restriction> 32 </xs:simpleType> 33 <xs:simpleType name="PaymentTypeType"> 34 <xs:restriction base="xs:string"> 35 <xs:enumeration value="CC"/> 36 <xs:enumeration value="CB"/> 37 <xs:enumeration value="MAESTRO"/> 38 <xs:enumeration value="EPS"/> 39 <xs:enumeration value="MIA"/> 40 <xs:enumeration value="PB"/> 41 <xs:enumeration value="PSC"/> 42 <xs:enumeration value="CASH-TICKET"/> 43 <xs:enumeration value="ELV"/> 44 <xs:enumeration value="QUICK"/> 45 <xs:enumeration value="GIROPAY"/> 46 <xs:enumeration value="PAYPAL"/> 47 <xs:enumeration value="MPASS"/> 48 <xs:enumeration value="BILLPAY"/> 49 <xs:enumeration value="INVOICE"/> 50 <xs:enumeration value="HP"/> 51 <xs:enumeration value="SAFETYPAY"/> 52 <xs:enumeration value="KLARNA"/> 53 </xs:restriction> 54 </xs:simpleType> 55 <xs:simpleType name="PaymentBrandType"> 56 <xs:restriction base="xs:string"> 57 <xs:enumeration value="AMEX"/> 58 <xs:enumeration value="DINERS"/> 59 <xs:enumeration value="MASTERCARD"/> 60 <xs:enumeration value="VISA"/> 61 <xs:enumeration value="JCB"/> 62 <xs:enumeration value="BANK-BGLD"/> 63 <xs:enumeration value="BAWAG"/> 64 <xs:enumeration value="BA"/> 65 <xs:enumeration value="ERSTE"/> 66 <xs:enumeration value="RZB"/> 67 <xs:enumeration value="HYPO"/> 68 <xs:enumeration value="VOLKSBANK"/> 69 <xs:enumeration value="ARZ"/> 70 <xs:enumeration value="ONE"/> 71 <xs:enumeration value="T-MOBILE"/> 72 <xs:enumeration value="ORANGE"/> 73 <xs:enumeration value="EPS"/> 74 <xs:enumeration value="ATOS"/> 75 <xs:enumeration value="HOBEX-AT"/> 76 <xs:enumeration value="HOBEX-DE"/> 77 <xs:enumeration value="HOBEX-NL"/> 78 <xs:enumeration value="INVOICE"/> 79 <xs:enumeration value="HP"/> 80 </xs:restriction> 81 </xs:simpleType> 82 <xs:simpleType name="PriceType"> 83 <xs:restriction base="xs:float"> 84 <xs:pattern value="-?\d{1,9}\.\d{2}|-?\d{1,9}"/> 85 </xs:restriction> 86 </xs:simpleType> 87 <xs:simpleType name="CurrencyType"> 88 <xs:restriction base="xs:string"> 89 <xs:length value="3"/> 90 <xs:pattern value="[A-Z]{3}"/> 91 </xs:restriction> 92 </xs:simpleType> 93 <xs:simpleType name="AddressFieldType"> 94 <xs:restriction base="xs:string"> 95 <xs:maxLength value="50"/> 96 </xs:restriction> 97 </xs:simpleType> 98 <xs:simpleType name="CustomerIDType"> 99 <xs:restriction base="xs:string"> 100 <xs:maxLength value="32"/> 101 </xs:restriction> 102 </xs:simpleType> 103 <xs:simpleType name="ProfileIDType"> 104 <xs:restriction base="xs:string"> 105 <xs:maxLength value="12"/> 106 </xs:restriction> 107 </xs:simpleType> 108 <xs:attributeGroup name="BasicAttributes"> 109 <xs:attribute name="Style" type="xs:string"/> 110 <xs:attribute name="LogoStyle" type="xs:string"/> 111 <xs:attribute name="PageHeaderStyle" type="xs:string"/> 112 <xs:attribute name="PageCaptionStyle" type="xs:string"/> 113 <xs:attribute name="PageStyle" type="xs:string"/> 114 <xs:attribute name="InputFieldsStyle" type="xs:string"/> 115 <xs:attribute name="DropDownListsStyle" type="xs:string"/> 116 <xs:attribute name="ButtonsStyle" type="xs:string"/> 117 <xs:attribute name="ErrorsStyle" type="xs:string"/> 118 <xs:attribute name="ErrorsHeaderStyle" type="xs:string"/> 119 <xs:attribute name="SuccessTitleStyle" type="xs:string"/> 120 <xs:attribute name="ErrorTitleStyle" type="xs:string"/> 121 <xs:attribute name="FooterStyle" type="xs:string"/> 122 </xs:attributeGroup> 3 123 <xs:complexType name="AddressType"> 4 124 <xs:sequence> 5 125 <xs:choice> 6 <xs:element name="Name" type="AddressFieldType"/> 126 <xs:element name="Name"> 127 <xs:complexType> 128 <xs:simpleContent> 129 <xs:extension base="AddressFieldType"> 130 <xs:attribute name="Gender"> 131 <xs:simpleType> 132 <xs:restriction base="xs:string"> 133 <xs:length value="1"/> 134 <xs:enumeration value="M"/> 135 <xs:enumeration value="F"/> 136 </xs:restriction> 137 </xs:simpleType> 138 </xs:attribute> 139 <xs:attribute name="Birthday" type="xs:date"/> 140 </xs:extension> 141 </xs:simpleContent> 142 </xs:complexType> 143 </xs:element> 7 144 <xs:sequence> 8 145 <xs:annotation> … … 26 163 </xs:choice> 27 164 <xs:sequence minOccurs="0"> 28 <xs:element name="Street" type="AddressFieldType"/> 165 <xs:element name="Street"> 166 <xs:complexType> 167 <xs:simpleContent> 168 <xs:extension base="AddressFieldType"/> 169 </xs:simpleContent> 170 </xs:complexType> 171 </xs:element> 29 172 <xs:element name="Street2" type="AddressFieldType" minOccurs="0"/> 30 173 <xs:element name="Zip" type="AddressFieldType"/> … … 57 200 <xs:restriction base="xs:string"> 58 201 <xs:maxLength value="64"/> 202 </xs:restriction> 203 </xs:simpleType> 204 </xs:element> 205 <xs:element name="Phone" minOccurs="0"> 206 <xs:simpleType> 207 <xs:restriction base="xs:string"> 208 <xs:maxLength value="20"/> 59 209 </xs:restriction> 60 210 </xs:simpleType> … … 70 220 </xs:attribute> 71 221 </xs:complexType> 72 <xs:simpleType name="PriceType">73 <xs:restriction base="xs:float">74 <xs:pattern value="-?\d{1,9}\.\d{2}|-?\d{1,9}"/>75 </xs:restriction>76 </xs:simpleType>77 <xs:simpleType name="CurrencyType">78 <xs:restriction base="xs:string">79 <xs:length value="3"/>80 <xs:pattern value="[A-Z]{3}"/>81 </xs:restriction>82 </xs:simpleType>83 <xs:simpleType name="AddressFieldType">84 <xs:restriction base="xs:string">85 <xs:maxLength value="50"/>86 </xs:restriction>87 </xs:simpleType>88 222 <xs:element name="Order"> 89 223 <xs:complexType> 90 224 <xs:sequence> 225 <xs:element name="ClientIP" type="ClientIPType" minOccurs="0"/> 91 226 <xs:element name="UserField" type="xs:string" minOccurs="0"/> 92 227 <xs:element name="Tid"> … … 94 229 <xs:restriction base="xs:string"> 95 230 <xs:maxLength value="32"/> 231 <xs:minLength value="1"/> 96 232 </xs:restriction> 97 233 </xs:simpleType> … … 102 238 <xs:extension base="xs:string"> 103 239 <xs:attribute name="CSSName" type="xs:string"/> 104 <xs:attribute name="Language"> 105 <xs:simpleType> 106 <xs:restriction base="xs:string"> 107 <xs:enumeration value="EN"/> 108 <xs:enumeration value="DE"/> 109 <xs:enumeration value="BG"/> 110 <xs:enumeration value="FR"/> 111 <xs:enumeration value="HU"/> 112 <xs:enumeration value="NL"/> 113 <xs:enumeration value="ES"/> 114 <xs:enumeration value="IT"/> 115 <xs:enumeration value="CS"/> 116 <xs:enumeration value="HR"/> 117 </xs:restriction> 118 </xs:simpleType> 119 </xs:attribute> 240 <xs:attribute name="Language" type="LanguageType"/> 120 241 </xs:extension> 121 242 </xs:simpleContent> … … 127 248 <xs:element name="Payment" maxOccurs="unbounded"> 128 249 <xs:complexType> 129 <xs:attribute name="Type" use="required"> 130 <xs:simpleType> 131 <xs:restriction base="xs:string"> 132 <xs:enumeration value="CC"/> 133 <xs:enumeration value="CB"/> 134 <xs:enumeration value="MAESTRO"/> 135 <xs:enumeration value="EPS"/> 136 <xs:enumeration value="MIA"/> 137 <xs:enumeration value="PB"/> 138 <xs:enumeration value="PSC"/> 139 <xs:enumeration value="CASH-TICKET"/> 140 <xs:enumeration value="ELV"/> 141 <xs:enumeration value="QUICK"/> 142 <xs:enumeration value="GIROPAY"/> 143 <xs:enumeration value="PAYPAL"/> 144 <xs:enumeration value="MPASS"/> 145 <xs:enumeration value="INVOICE"/> 146 <xs:enumeration value="HP"/> 147 <xs:enumeration value="SAFETYPAY"/> 148 </xs:restriction> 149 </xs:simpleType> 150 </xs:attribute> 151 <xs:attribute name="Brand"> 152 <xs:simpleType> 153 <xs:restriction base="xs:string"> 154 <xs:enumeration value="AMEX"/> 155 <xs:enumeration value="DINERS"/> 156 <xs:enumeration value="MASTERCARD"/> 157 <xs:enumeration value="VISA"/> 158 <xs:enumeration value="JCB"/> 159 <xs:enumeration value="BANK-BGLD"/> 160 <xs:enumeration value="BAWAG"/> 161 <xs:enumeration value="BA"/> 162 <xs:enumeration value="ERSTE"/> 163 <xs:enumeration value="RZB"/> 164 <xs:enumeration value="HYPO"/> 165 <xs:enumeration value="VOLKSBANK"/> 166 <xs:enumeration value="ARZ"/> 167 <xs:enumeration value="ONE"/> 168 <xs:enumeration value="T-MOBILE"/> 169 <xs:enumeration value="ORANGE"/> 170 <xs:enumeration value="ATOS"/> 171 <xs:enumeration value="HOBEX-AT"/> 172 <xs:enumeration value="HOBEX-DE"/> 173 <xs:enumeration value="HOBEX-NL"/> 174 <xs:enumeration value="BILLPAY"/> 175 </xs:restriction> 176 </xs:simpleType> 177 </xs:attribute> 250 <xs:attribute name="Type" type="PaymentTypeType" use="required"/> 251 <xs:attribute name="Brand" type="PaymentBrandType"/> 178 252 </xs:complexType> 179 253 </xs:element> … … 182 256 <xs:annotation> 183 257 <xs:documentation>Enable or disable the specified payment types</xs:documentation> 258 </xs:annotation> 259 </xs:attribute> 260 </xs:complexType> 261 </xs:element> 262 <xs:element name="PaymentProfiles" minOccurs="0"> 263 <xs:complexType> 264 <xs:sequence> 265 <xs:element name="ProfileID" type="ProfileIDType" maxOccurs="unbounded"/> 266 </xs:sequence> 267 <xs:attribute name="Enable" type="xs:boolean" default="true"> 268 <xs:annotation> 269 <xs:documentation>Enable or disable specified customer payment profiles</xs:documentation> 184 270 </xs:annotation> 185 271 </xs:attribute> … … 390 476 </xs:element> 391 477 </xs:sequence> 392 <xs:attribute name="Style" type="xs:string"/> 393 <xs:attribute name="LogoStyle" type="xs:string"/> 394 <xs:attribute name="PageHeaderStyle" type="xs:string"/> 395 <xs:attribute name="PageCaptionStyle" type="xs:string"/> 396 <xs:attribute name="PageStyle" type="xs:string"/> 397 <xs:attribute name="InputFieldsStyle" type="xs:string"/> 398 <xs:attribute name="DropDownListsStyle" type="xs:string"/> 399 <xs:attribute name="ButtonsStyle" type="xs:string"/> 400 <xs:attribute name="ErrorsStyle" type="xs:string"/> 401 <xs:attribute name="ErrorsHeaderStyle" type="xs:string"/> 402 <xs:attribute name="SuccessTitleStyle" type="xs:string"/> 403 <xs:attribute name="ErrorTitleStyle" type="xs:string"/> 404 <xs:attribute name="FooterStyle" type="xs:string"/> 478 <xs:attributeGroup ref="BasicAttributes"/> 479 </xs:complexType> 480 </xs:element> 481 <xs:element name="Profile"> 482 <xs:complexType> 483 <xs:sequence> 484 <xs:element name="ClientIP" type="ClientIPType" minOccurs="0"/> 485 <xs:element name="TemplateSet" minOccurs="0"> 486 <xs:complexType> 487 <xs:simpleContent> 488 <xs:extension base="xs:string"> 489 <xs:attribute name="CSSName" type="xs:string"/> 490 <xs:attribute name="Language" type="LanguageType"/> 491 </xs:extension> 492 </xs:simpleContent> 493 </xs:complexType> 494 </xs:element> 495 <xs:element name="PaymentTypes" minOccurs="0"> 496 <xs:complexType> 497 <xs:sequence> 498 <xs:element name="Payment" maxOccurs="unbounded"> 499 <xs:complexType> 500 <xs:attribute name="Type" type="PaymentTypeType" use="required"/> 501 <xs:attribute name="Brand" type="PaymentBrandType"/> 502 </xs:complexType> 503 </xs:element> 504 </xs:sequence> 505 <xs:attribute name="Enable" type="xs:boolean" default="true"> 506 <xs:annotation> 507 <xs:documentation>Enable or disable the specified payment types</xs:documentation> 508 </xs:annotation> 509 </xs:attribute> 510 </xs:complexType> 511 </xs:element> 512 <xs:element name="CustomerID"> 513 <xs:complexType> 514 <xs:simpleContent> 515 <xs:extension base="CustomerIDType"> 516 <xs:attribute name="ProfileID" type="ProfileIDType"> 517 <xs:annotation> 518 <xs:documentation>Should be set to update an existing profile</xs:documentation> 519 </xs:annotation> 520 </xs:attribute> 521 </xs:extension> 522 </xs:simpleContent> 523 </xs:complexType> 524 </xs:element> 525 <xs:element name="URL" minOccurs="0"> 526 <xs:complexType> 527 <xs:sequence> 528 <xs:element name="Success" type="xs:anyURI" minOccurs="0"/> 529 <xs:element name="Cancel" type="xs:anyURI" minOccurs="0"/> 530 </xs:sequence> 531 </xs:complexType> 532 </xs:element> 533 </xs:sequence> 534 <xs:attributeGroup ref="BasicAttributes"/> 405 535 </xs:complexType> 406 536 </xs:element> -
woocommerce-mpay24-gateway/trunk/gateway-mpay24.php
r696575 r803586 4 4 Plugin URI: http://www.woothemes.com/product-category/woocommerce-extensions/ 5 5 Description: Add mPAY24 Payment Gateway with credit card support to WooCommerce Plugin 6 Version: 1. 16 Version: 1.2 7 7 Author: datenwerk innovationsagentur GmbH 8 8 Author URI: http://www.datenwerk.at 9 9 Requires at least: 3.5 10 Tested up to: 3. 5.110 Tested up to: 3.7.1 11 11 */ 12 12 … … 22 22 23 23 if ( ! defined( 'GATEWAY_MPAY24_VERSION' ) ) { 24 define( 'GATEWAY_MPAY24_VERSION', '1. 1' );24 define( 'GATEWAY_MPAY24_VERSION', '1.2' ); 25 25 } 26 26 if ( ! defined( 'GATEWAY_MPAY24_TABLE_NAME' ) ) { … … 180 180 public function init_form_fields() { 181 181 $this->form_fields = array( 182 'enabled' => array( 183 'title' => __( 'Enable/Disable', 'wc-mpay24' ), 184 'label' => __( 'Enable mPAY24', 'wc-mpay24' ), 185 'type' => 'checkbox', 186 'description' => '', 187 'default' => 'no' 188 ), 189 'title' => array( 190 'title' => __( 'Title', 'wc-mpay24' ), 191 'type' => 'text', 192 'description' => __( 'This controls the title which the user sees during checkout.', 'wc-mpay24' ), 193 'default' => __( 'Credit card', 'wc-mpay24' ) 194 ), 195 'description' => array( 196 'title' => __( 'Description', 'wc-mpay24' ), 197 'type' => 'textarea', 198 'description' => __( 'This controls the description which the user sees during checkout.', 'wc-mpay24' ), 199 'default' => __( 'Pay with your credit card via mPAY24.', 'wc-mpay24' ) 200 ), 201 'thankyou_text' => array( 202 'title' => __( 'Thank you page text', 'wc-mpay24' ), 203 'type' => 'textarea', 204 'description' => __( 'This controls the text which the user sees on the order thank you page above order details.', 'wc-mpay24' ) 205 ), 206 'email_text' => array( 207 'title' => __( 'Customer email text', 'wc-mpay24' ), 208 'type' => 'textarea', 209 'description' => __( 'This controls the text which the user sees in order confirmation email below order table.', 'wc-mpay24' ) 210 ), 211 'payment_page_lang' => array( 212 'title' => __( 'mPAY24 Payment page Language', 'wc-mpay24' ), 213 'type' => 'select', 214 'options' => array( 215 'BG' => __( 'Bulgarian', 'wc-mpay24' ), 216 'CS' => __( 'Czech', 'wc-mpay24' ), 217 'DE' => __( 'German', 'wc-mpay24' ), // default 218 'EN' => __( 'English', 'wc-mpay24' ), 219 'ES' => __( 'Spanish', 'wc-mpay24' ), 220 'FR' => __( 'French', 'wc-mpay24' ), 221 'HU' => __( 'Hungarian', 'wc-mpay24' ), 222 'NL' => __( 'Dutch', 'wc-mpay24' ) 223 ), // see mPAY24 specification Appendix B for supported languages 224 'description' => __( 'This controls in which langage the payment page is shown.', 'wc-mpay24' ), 225 'default' => 'DE' 226 ), 227 'apiusertest' => array( 228 'title' => __( 'Username TEST', 'wc-mpay24' ), 229 'type' => 'text', 230 'description' => __( 'This is the SOAP API username (without leading u) for test environment.', 'wc-mpay24' ), 231 'default' => '' 232 ), 233 'apipasstest' => array( 234 'title' => __( 'Password TEST', 'wc-mpay24' ), 235 'type' => 'password', 236 'description' => __( 'This is the SOAP API password for test environment.', 'wc-mpay24' ), 237 'default' => '' 238 ), 239 'apiuserprod' => array( 240 'title' => __( 'Username PROD', 'wc-mpay24' ), 241 'type' => 'text', 242 'description' => __( 'This is the SOAP API username (without leading u) for prod environment.', 'wc-mpay24' ), 243 'default' => '' 244 ), 245 'apipassprod' => array( 246 'title' => __( 'Password PROD', 'wc-mpay24' ), 247 'type' => 'password', 248 'description' => __( 'This is the SOAP API password for prod environment.', 'wc-mpay24' ), 249 'default' => '' 250 ), 251 'testmode' => array( 252 'title' => __( 'mPAY24 Test Mode', 'wc-mpay24' ), 253 'label' => __( 'Enable Test Mode', 'wc-mpay24' ), 254 'type' => 'checkbox', 255 'description' => __( 'Place the payment gateway in development mode.', 'wc-mpay24' ), 256 'default' => 'yes' 257 ), 258 'debug' => array( 259 'title' => __( 'Debug Log', 'wc-mpay24' ), 260 'type' => 'checkbox', 261 'label' => __( 'Enable logging', 'wc-mpay24' ), 262 'default' => 'no', 263 'description' => __( 'Log mPAY24 events inside <code>woocommerce/logs/mpay24.txt</code>', 'wc-mpay24' ), 264 ), 182 'enabled' => array( 183 'title' => __( 'Enable/Disable', 'wc-mpay24' ), 184 'label' => __( 'Enable mPAY24', 'wc-mpay24' ), 185 'type' => 'checkbox', 186 'description' => '', 187 'default' => 'no' 188 ), 189 'title' => array( 190 'title' => __( 'Title', 'wc-mpay24' ), 191 'type' => 'text', 192 'description' => __( 'This controls the title which the user sees during checkout.', 'wc-mpay24' ), 193 'default' => __( 'Credit card', 'wc-mpay24' ) 194 ), 195 'description' => array( 196 'title' => __( 'Description', 'wc-mpay24' ), 197 'type' => 'textarea', 198 'description' => __( 'This controls the description which the user sees during checkout.', 'wc-mpay24' ), 199 'default' => __( 'Pay with your credit card via mPAY24.', 'wc-mpay24' ) 200 ), 201 'thankyou_text' => array( 202 'title' => __( 'Thank you page text', 'wc-mpay24' ), 203 'type' => 'textarea', 204 'description' => __( 'This controls the text which the user sees on the order thank you page above order details.', 'wc-mpay24' ) 205 ), 206 'email_text' => array( 207 'title' => __( 'Customer email text', 'wc-mpay24' ), 208 'type' => 'textarea', 209 'description' => __( 'This controls the text which the user sees in order confirmation email below order table.', 'wc-mpay24' ) 210 ), 211 'payment_page_lang' => array( 212 'title' => __( 'mPAY24 Payment page Language', 'wc-mpay24' ), 213 'type' => 'select', 214 'options' => array( 215 'BG' => __( 'Bulgarian', 'wc-mpay24' ), 216 'ZH' => __( 'Chinese', 'wc-mpay24' ), 217 'HR' => __( 'Croatian', 'wc-mpay24' ), 218 'CS' => __( 'Czech', 'wc-mpay24' ), 219 'NL' => __( 'Dutch', 'wc-mpay24' ), 220 'EN' => __( 'English', 'wc-mpay24' ), 221 'FR' => __( 'French', 'wc-mpay24' ), 222 'DE' => __( 'German', 'wc-mpay24' ), // default 223 'HU' => __( 'Hungarian', 'wc-mpay24' ), 224 'IT' => __( 'Italian', 'wc-mpay24' ), 225 'JA' => __( 'Japanese', 'wc-mpay24' ), 226 'PL' => __( 'Polish', 'wc-mpay24' ), 227 'PT' => __( 'Portuguese', 'wc-mpay24' ), 228 'RO' => __( 'Romanian', 'wc-mpay24' ), 229 'RU' => __( 'Russian', 'wc-mpay24' ), 230 'SR' => __( 'Serbian', 'wc-mpay24' ), 231 'SK' => __( 'Slovak', 'wc-mpay24' ), 232 'SL' => __( 'Slovenian', 'wc-mpay24' ), 233 'ES' => __( 'Spanish', 'wc-mpay24' ), 234 'TR' => __( 'Turkish', 'wc-mpay24' ) 235 ), // see mPAY24 specification Appendix for supported languages 236 'description' => __( 'This controls in which langage the payment page is shown.', 'wc-mpay24' ), 237 'default' => 'DE' 238 ), 239 'apiusertest' => array( 240 'title' => __( 'Username TEST', 'wc-mpay24' ), 241 'type' => 'text', 242 'description' => __( 'This is the SOAP API username (without leading u) for test environment.', 'wc-mpay24' ), 243 'default' => '' 244 ), 245 'apipasstest' => array( 246 'title' => __( 'Password TEST', 'wc-mpay24' ), 247 'type' => 'password', 248 'description' => __( 'This is the SOAP API password for test environment.', 'wc-mpay24' ), 249 'default' => '' 250 ), 251 'apiuserprod' => array( 252 'title' => __( 'Username PROD', 'wc-mpay24' ), 253 'type' => 'text', 254 'description' => __( 'This is the SOAP API username (without leading u) for prod environment.', 'wc-mpay24' ), 255 'default' => '' 256 ), 257 'apipassprod' => array( 258 'title' => __( 'Password PROD', 'wc-mpay24' ), 259 'type' => 'password', 260 'description' => __( 'This is the SOAP API password for prod environment.', 'wc-mpay24' ), 261 'default' => '' 262 ), 263 'testmode' => array( 264 'title' => __( 'mPAY24 Test Mode', 'wc-mpay24' ), 265 'label' => __( 'Enable Test Mode', 'wc-mpay24' ), 266 'type' => 'checkbox', 267 'description' => __( 'Place the payment gateway in development mode.', 'wc-mpay24' ), 268 'default' => 'yes' 269 ), 270 'debug' => array( 271 'title' => __( 'Debug Log', 'wc-mpay24' ), 272 'type' => 'checkbox', 273 'label' => __( 'Enable logging', 'wc-mpay24' ), 274 'default' => 'no', 275 'description' => __( 'Log mPAY24 events inside <code>woocommerce/logs/mpay24.txt</code>', 'wc-mpay24' ) 276 ) 265 277 ); 266 278 } … … 299 311 300 312 $testmode = ( 'yes' == $this->testmode ) ? true : false; 301 $user = ( 'yes' == $this->testmode ) ? $this->apiusertest : $this->apiuserprod;302 $pass = ( 'yes' == $this->testmode ) ? $this->apipasstest : $this->apipassprod;313 $user = ( 'yes' == $this->testmode ) ? $this->apiusertest : $this->apiuserprod; 314 $pass = ( 'yes' == $this->testmode ) ? $this->apipasstest : $this->apipassprod; 303 315 304 316 // start mpay24 transaction … … 316 328 317 329 $shop->setSuccessUrl( $this->get_return_url( $order ) ); // thank you page 318 $shop->setErrorUrl ($order->get_cancel_order_url() ); 330 $shop->setErrorUrl ($order->get_cancel_order_url() ); // failed orders will also be marked as cancelled 319 331 $shop->setCancelUrl( $order->get_cancel_order_url() ); 320 332 $shop->setConfirmUrl( $this->notify_url ); … … 329 341 // open payment page 330 342 return array( 331 'result' => 'success',332 'redirect' => $result->getLocation()343 'result' => 'success', 344 'redirect' => $result->getLocation() 333 345 ); 334 346 335 347 //// Remove cart 336 348 //$woocommerce->cart->empty_cart(); 337 //349 // 338 350 //// Empty awaiting payment session 339 351 //unset( $_SESSION['order_awaiting_payment'] ); 340 //352 // 341 353 //// Return thankyou redirect 342 354 //return array( 343 // 'result' => 'success',344 // 'redirect' => add_query_arg( 'key', $order->order_key, add_query_arg( 'order', $order_id, get_permalink( get_option( 'woocommerce_thanks_page_id' ) ) ) )355 // 'result' => 'success', 356 // 'redirect' => add_query_arg( 'key', $order->order_key, add_query_arg( 'order', $order_id, get_permalink( get_option( 'woocommerce_thanks_page_id' ) ) ) ) 345 357 //); 346 358 } … … 399 411 function check_ipn_request_is_valid() { 400 412 $get_params = $_GET; 401 $args = array();413 $args = array(); 402 414 403 415 foreach ( $get_params as $key => $value ) { … … 408 420 409 421 $testmode = ( 'yes' == $this->testmode ) ? true : false; 410 $user = ( 'yes' == $this->testmode ) ? $this->apiusertest : $this->apiuserprod;411 $pass = ( 'yes' == $this->testmode ) ? $this->apipasstest : $this->apipassprod;422 $user = ( 'yes' == $this->testmode ) ? $this->apiusertest : $this->apiuserprod; 423 $pass = ( 'yes' == $this->testmode ) ? $this->apipasstest : $this->apipassprod; 412 424 413 425 $shop = new WC_MPAY24_Shop( $user, $pass, $testmode ); … … 418 430 419 431 return true; 420 }432 } 421 433 422 434 /** … … 451 463 if ( ! empty( $posted['TID'] ) ) { 452 464 453 $order = new WC_Order( (int) $posted['TID'] );454 $table_name = $wpdb->prefix . GATEWAY_MPAY24_TABLE_NAME;465 $order = new WC_Order( (int) $posted['TID'] ); 466 $table_name = $wpdb->prefix . GATEWAY_MPAY24_TABLE_NAME; 455 467 $transaction_db = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table_name WHERE tid = %s", $posted['TID'] ) ); 456 468
Note: See TracChangeset
for help on using the changeset viewer.