@@ -18,6 +18,7 @@ class Openpay
1818 private static $ apiEndpoint = '' ;
1919 private static $ apiSandboxEndpoint = '' ;
2020 private static $ sandboxMode = true ;
21+ private static $ classification = '' ;
2122
2223 public function __construct () {
2324
@@ -49,6 +50,17 @@ public static function getUserAgent(){
4950 return $ userAgent ;
5051 }
5152
53+ public static function setClassificationMerchant ($ classification ){
54+ if ($ classification != '' ) {
55+ self ::$ classification = $ classification ;
56+ }
57+ }
58+
59+ public static function getClassificationMerchant (){
60+ $ classification = self ::$ classification ;
61+ return $ classification ;
62+ }
63+
5264 public static function setApiKey ($ key = '' ) {
5365 if ($ key != '' ) {
5466 self ::$ apiKey = $ key ;
@@ -114,8 +126,13 @@ public static function setProductionMode($mode) {
114126
115127 public static function setEndpointUrl ($ country ){
116128 if ($ country == 'MX ' ){
117- self ::$ apiEndpoint = 'https://api.openpay.mx/v1 ' ;
118- self ::$ apiSandboxEndpoint = 'https://sandbox-api.openpay.mx/v1 ' ;
129+ if (self ::getClassificationMerchant () != 'eglobal ' ){
130+ self ::$ apiEndpoint = 'https://api.openpay.mx/v1 ' ;
131+ self ::$ apiSandboxEndpoint = 'https://sandbox-api.openpay.mx/v1 ' ;
132+ }else {
133+ self ::$ apiEndpoint = 'https://api.ecommercebbva.com/v1 ' ;
134+ self ::$ apiSandboxEndpoint = 'https://sand-api.ecommercebbva.com/v1 ' ;
135+ }
119136 }elseif ($ country == 'CO ' ){
120137 self ::$ apiEndpoint = 'https://api.openpay.co/v1 ' ;
121138 self ::$ apiSandboxEndpoint = 'https://sandbox-api.openpay.co/v1 ' ;
@@ -148,6 +165,10 @@ public static function getInstance($r, $p = null) {
148165 return parent ::getInstance ($ resourceName );
149166 }
150167
168+ public function getMerchantInfo (){
169+ return parent ::getMerchantInfo ();
170+ }
171+
151172 protected function getResourceUrlName ($ p = true ) {
152173 return '' ;
153174 }
0 commit comments