@@ -1,74 +1,74 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | - 'general' => [ |
|
| 4 | + 'general' => [ |
|
| 5 | 5 | 'failed' => 'Request Failed', |
| 6 | 6 | 'success' => 'Request Successful', |
| 7 | 7 | 'validation' => 'Validation Error', |
| 8 | 8 | 'crashed' => 'Something went wrong', |
| 9 | 9 | 'unauthenticated' => 'Authentication Failed', |
| 10 | 10 | 'unauthorized' => 'Authorization Failed', |
| 11 | - ], |
|
| 12 | - 'client' => [ |
|
| 11 | + ], |
|
| 12 | + 'client' => [ |
|
| 13 | 13 | 'invalid' => 'Invalid client id or secret provided', |
| 14 | 14 | 'id' => [ |
| 15 | - 'invalid' => 'Invalid client id provided', |
|
| 15 | + 'invalid' => 'Invalid client id provided', |
|
| 16 | 16 | ], |
| 17 | 17 | 'secret' => [ |
| 18 | - 'invalid' => 'Invalid client secret provided', |
|
| 18 | + 'invalid' => 'Invalid client secret provided', |
|
| 19 | 19 | ], |
| 20 | 20 | 'environment' => [ |
| 21 | - 'invalid' => 'Invalid environment or secret keys provided', |
|
| 21 | + 'invalid' => 'Invalid environment or secret keys provided', |
|
| 22 | 22 | ] |
| 23 | - ], |
|
| 24 | - 'validation' => [ |
|
| 23 | + ], |
|
| 24 | + 'validation' => [ |
|
| 25 | 25 | 'order_ref' => [ |
| 26 | - 'required' => 'Order reference field is required', |
|
| 26 | + 'required' => 'Order reference field is required', |
|
| 27 | 27 | ], |
| 28 | 28 | 'auth_code' => [ |
| 29 | - 'required' => 'Auth code field is required', |
|
| 29 | + 'required' => 'Auth code field is required', |
|
| 30 | 30 | ], |
| 31 | 31 | 'state' => [ |
| 32 | - 'required' => 'State field is required', |
|
| 32 | + 'required' => 'State field is required', |
|
| 33 | 33 | ], |
| 34 | 34 | 'order_id' => [ |
| 35 | - 'required' => 'Order id field is required', |
|
| 36 | - 'failure' => 'Unable to set order id field. Try again later', |
|
| 35 | + 'required' => 'Order id field is required', |
|
| 36 | + 'failure' => 'Unable to set order id field. Try again later', |
|
| 37 | 37 | ], |
| 38 | 38 | 'customer' => [ |
| 39 | - 'required' => 'Customer object is required', |
|
| 40 | - 'failure' => 'Unable to set customer object field. Try again later', |
|
| 39 | + 'required' => 'Customer object is required', |
|
| 40 | + 'failure' => 'Unable to set customer object field. Try again later', |
|
| 41 | 41 | ], |
| 42 | 42 | 'products' => [ |
| 43 | - 'required' => 'Products object is required', |
|
| 44 | - 'failure' => 'Unable to set products object field. Try again later', |
|
| 43 | + 'required' => 'Products object is required', |
|
| 44 | + 'failure' => 'Unable to set products object field. Try again later', |
|
| 45 | 45 | ], |
| 46 | 46 | 'order_status' => [ |
| 47 | - 'required' => 'Order status field is required', |
|
| 48 | - 'not_matched' => 'Order status does not match with bSecure order statuses.', |
|
| 47 | + 'required' => 'Order status field is required', |
|
| 48 | + 'not_matched' => 'Order status does not match with bSecure order statuses.', |
|
| 49 | 49 | ], |
| 50 | - ], |
|
| 51 | - 'order' => [ |
|
| 50 | + ], |
|
| 51 | + 'order' => [ |
|
| 52 | 52 | 'success' => 'Order placed successfully', |
| 53 | 53 | 'failure' => 'Unable to place order. Try again later', |
| 54 | 54 | 'status' => [ |
| 55 | - 'success' => 'Order status updated received', |
|
| 56 | - 'failure' => 'Unable to receive order status update.', |
|
| 57 | - 'updated' => [ |
|
| 55 | + 'success' => 'Order status updated received', |
|
| 56 | + 'failure' => 'Unable to receive order status update.', |
|
| 57 | + 'updated' => [ |
|
| 58 | 58 | 'success' => 'Order status updated successfully', |
| 59 | 59 | 'failure' => 'Unable to update order status.', |
| 60 | - ] |
|
| 60 | + ] |
|
| 61 | + ], |
|
| 61 | 62 | ], |
| 62 | - ], |
|
| 63 | - 'sso_sco' => [ |
|
| 63 | + 'sso_sco' => [ |
|
| 64 | 64 | 'success' => 'Third-party login succeeded.', |
| 65 | 65 | 'failure' => 'Third-party login failed, please check the connection with bSecure.', |
| 66 | - ], |
|
| 67 | - 'customer' => [ |
|
| 66 | + ], |
|
| 67 | + 'customer' => [ |
|
| 68 | 68 | 'verification' => [ |
| 69 | - 'success' => 'Customer verified', |
|
| 70 | - 'failure' => 'Customer verification failed', |
|
| 69 | + 'success' => 'Customer verified', |
|
| 70 | + 'failure' => 'Customer verification failed', |
|
| 71 | + ] |
|
| 71 | 72 | ] |
| 72 | - ] |
|
| 73 | 73 | |
| 74 | 74 | ]; |
| 75 | 75 | \ No newline at end of file |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | if ($this->app->runningInConsole()) { |
| 39 | 39 | |
| 40 | 40 | $this->publishes([ |
| 41 | - __DIR__.'/config/config.php' => config_path('bSecure.php'), |
|
| 41 | + __DIR__.'/config/config.php' => config_path('bSecure.php'), |
|
| 42 | 42 | ], 'config'); |
| 43 | 43 | |
| 44 | 44 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | // Publishing the translation files. |
| 56 | 56 | $this->publishes([ |
| 57 | - __DIR__.'/resources/lang' => resource_path('lang/vendor/bSecure'), |
|
| 57 | + __DIR__.'/resources/lang' => resource_path('lang/vendor/bSecure'), |
|
| 58 | 58 | ],'lang'); |
| 59 | 59 | |
| 60 | 60 | // Registering package commands. |
@@ -12,14 +12,14 @@ |
||
| 12 | 12 | { |
| 13 | 13 | |
| 14 | 14 | private $orderPayload = [ |
| 15 | - 'order_id' => null, |
|
| 16 | - 'customer' => null, |
|
| 17 | - 'products' => null, |
|
| 18 | - 'shipment_charges' => null, |
|
| 19 | - 'shipment_method_name' => null, |
|
| 20 | - 'sub_total_amount' => null, |
|
| 21 | - 'discount_amount' => null, |
|
| 22 | - 'total_amount' => null |
|
| 15 | + 'order_id' => null, |
|
| 16 | + 'customer' => null, |
|
| 17 | + 'products' => null, |
|
| 18 | + 'shipment_charges' => null, |
|
| 19 | + 'shipment_method_name' => null, |
|
| 20 | + 'sub_total_amount' => null, |
|
| 21 | + 'discount_amount' => null, |
|
| 22 | + 'total_amount' => null |
|
| 23 | 23 | ]; |
| 24 | 24 | |
| 25 | 25 | |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | |
| 21 | 21 | protected $validationRule = [ |
| 22 | - 'order_id' => 'order_id', |
|
| 23 | - 'customer' => 'customer', |
|
| 24 | - 'products' => 'products', |
|
| 22 | + 'order_id' => 'order_id', |
|
| 23 | + 'customer' => 'customer', |
|
| 24 | + 'products' => 'products', |
|
| 25 | 25 | ]; |
| 26 | 26 | |
| 27 | 27 | |
@@ -56,10 +56,10 @@ discard block |
||
| 56 | 56 | public function _setProductsDataStructure($products) |
| 57 | 57 | { |
| 58 | 58 | $orderData = [ |
| 59 | - 'products' => null, |
|
| 60 | - 'sub_total_amount' => null, |
|
| 61 | - 'discount_amount' => null, |
|
| 62 | - 'total_amount' => null, |
|
| 59 | + 'products' => null, |
|
| 60 | + 'sub_total_amount' => null, |
|
| 61 | + 'discount_amount' => null, |
|
| 62 | + 'total_amount' => null, |
|
| 63 | 63 | ]; |
| 64 | 64 | |
| 65 | 65 | if(!empty($products)) |
@@ -89,18 +89,18 @@ discard block |
||
| 89 | 89 | $product_sub_total = ( $price + $options_price ) * $quantity; |
| 90 | 90 | |
| 91 | 91 | $orderItems['products'][] = [ |
| 92 | - "id" => $product['id'], |
|
| 93 | - "name" => $product['name'], |
|
| 94 | - "sku" => $product['sku'], |
|
| 95 | - "quantity" => $quantity, |
|
| 96 | - "price" => $price, |
|
| 97 | - "sale_price" => $sale_price, |
|
| 98 | - "discount" => $discount, |
|
| 99 | - "sub_total" => $product_price, |
|
| 100 | - "image" => $product['image'], |
|
| 101 | - "short_description" => $product['short_description'], |
|
| 102 | - "description" => $product['description'], |
|
| 103 | - "product_options" => $options |
|
| 92 | + "id" => $product['id'], |
|
| 93 | + "name" => $product['name'], |
|
| 94 | + "sku" => $product['sku'], |
|
| 95 | + "quantity" => $quantity, |
|
| 96 | + "price" => $price, |
|
| 97 | + "sale_price" => $sale_price, |
|
| 98 | + "discount" => $discount, |
|
| 99 | + "sub_total" => $product_price, |
|
| 100 | + "image" => $product['image'], |
|
| 101 | + "short_description" => $product['short_description'], |
|
| 102 | + "description" => $product['description'], |
|
| 103 | + "product_options" => $options |
|
| 104 | 104 | ]; |
| 105 | 105 | |
| 106 | 106 | $total_discount += $discount; |
@@ -141,8 +141,8 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | return [ |
| 144 | - 'price' => $price, |
|
| 145 | - 'options' => $product_options |
|
| 144 | + 'price' => $price, |
|
| 145 | + 'options' => $product_options |
|
| 146 | 146 | ]; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -157,15 +157,15 @@ discard block |
||
| 157 | 157 | if( !empty( $auth_code ) ) |
| 158 | 158 | { |
| 159 | 159 | $customer = [ |
| 160 | - "auth_code" => $auth_code, |
|
| 160 | + "auth_code" => $auth_code, |
|
| 161 | 161 | ];; |
| 162 | 162 | } |
| 163 | 163 | else{ |
| 164 | 164 | $customer = [ |
| 165 | - "country_code" => array_key_exists('country_code',$customerData) ? $customerData['country_code'] : '', |
|
| 166 | - "phone_number" => array_key_exists('phone_number',$customerData) ? $customerData['phone_number'] : '', |
|
| 167 | - "name" => array_key_exists('name',$customerData) ? $customerData['name'] : '', |
|
| 168 | - "email" => array_key_exists('email',$customerData) ? $customerData['email'] : '', |
|
| 165 | + "country_code" => array_key_exists('country_code',$customerData) ? $customerData['country_code'] : '', |
|
| 166 | + "phone_number" => array_key_exists('phone_number',$customerData) ? $customerData['phone_number'] : '', |
|
| 167 | + "name" => array_key_exists('name',$customerData) ? $customerData['name'] : '', |
|
| 168 | + "email" => array_key_exists('email',$customerData) ? $customerData['email'] : '', |
|
| 169 | 169 | ]; |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | public function _setShipmentDetails($shipmentData) |
| 179 | 179 | { |
| 180 | 180 | $shipmentDetail = [ |
| 181 | - "charges" => '', |
|
| 182 | - "method_name" => '', |
|
| 181 | + "charges" => '', |
|
| 182 | + "method_name" => '', |
|
| 183 | 183 | ]; |
| 184 | 184 | if(!empty($shipmentData)) |
| 185 | 185 | { |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | { |
| 40 | 40 | $auth_url = $this->_createAuthenticationURL($ssoPayload); |
| 41 | 41 | $response = [ |
| 42 | - 'redirect_url' => $auth_url |
|
| 42 | + 'redirect_url' => $auth_url |
|
| 43 | 43 | ]; |
| 44 | 44 | return ApiResponseHandler::success($response, trans('bSecure::messages.sso_sco.success')); |
| 45 | 45 | } |