|
| 1 | +<p align="center"> |
| 2 | + <img src="https://pathao.com/wp-content/uploads/2019/02/Pathao-logo.svg"> |
| 3 | +</p> |
| 4 | + |
| 5 | +<h1 align="center">Pathao Courier Banagladesh</h1> |
| 6 | +<p align="center" > |
| 7 | +<img src="https://img.shields.io/packagist/dt/codeboxr/pathao-courier"> |
| 8 | +<img src="https://img.shields.io/packagist/stars/codeboxr/pathao-courier"> |
| 9 | +</p> |
| 10 | + |
| 11 | + |
| 12 | +## Requirements |
| 13 | + |
| 14 | +- PHP >=7.2 |
| 15 | +- Laravel >= 6 |
| 16 | + |
| 17 | +## Installation |
| 18 | + |
| 19 | +```bash |
| 20 | +composer require codeboxr/pathao-courier |
| 21 | +``` |
| 22 | + |
| 23 | +### vendor publish (config) |
| 24 | +```bash |
| 25 | +php artisan vendor:publish --provider="Codeboxr\PathaoCourier\PathaoCourierServiceProvider" |
| 26 | +``` |
| 27 | + |
| 28 | +After publish config file setup your credential. you can see this in your config directory pathao.php file |
| 29 | +``` |
| 30 | +"sandbox" => env("PATHAO_SANDBOX", false), // for sandbox mode use true |
| 31 | +"client_id" => env("PATHAO_CLIENT_ID", ""), |
| 32 | +"client_secret" => env("PATHAO_CLIENT_SECRET", ""), |
| 33 | +"username" => env("PATHAO_USERNAME", ""), |
| 34 | +"password" => env("PATHAO_PASSWORD", "") |
| 35 | +``` |
| 36 | + |
| 37 | +### Set .env configuration |
| 38 | +``` |
| 39 | +PATHAO_SANDBOX=true // for production mode use false |
| 40 | +PATHAO_CLIENT_ID="" |
| 41 | +PATHAO_CLIENT_SECRET="" |
| 42 | +PATHAO_USERNAME="" |
| 43 | +PATHAO_PASSWORD="" |
| 44 | +``` |
| 45 | + |
| 46 | + |
| 47 | +## Usage |
| 48 | + |
| 49 | +### 1. Get pathao delivery city list |
| 50 | + |
| 51 | +``` |
| 52 | +use Codeboxr\PathaoCourier\Facade\PathaoCourier |
| 53 | +
|
| 54 | +return PathaoCourierFacade::area()->city(); |
| 55 | +
|
| 56 | +``` |
| 57 | + |
| 58 | +### 2. To get pathao zone list |
| 59 | + |
| 60 | +``` |
| 61 | +use Codeboxr\PathaoCourier\Facade\PathaoCourier |
| 62 | +
|
| 63 | +return PathaoCourier::area()->zone($cityId); // City ID |
| 64 | +``` |
| 65 | + |
| 66 | +### 3. To get pathao delivery area list |
| 67 | + |
| 68 | +``` |
| 69 | +use Codeboxr\PathaoCourier\Facade\PathaoCourier |
| 70 | +
|
| 71 | +return PathaoCourier::area()->area($zoneId); // Zone ID |
| 72 | +``` |
| 73 | + |
| 74 | + |
| 75 | +### 4. Create new store |
| 76 | + |
| 77 | +``` |
| 78 | +use Codeboxr\PathaoCourier\Facade\PathaoCourier |
| 79 | +
|
| 80 | +return PathaoCourier::store() |
| 81 | + ->create([ |
| 82 | + "name" => "", // Store Name |
| 83 | + "contact_name" => "", // Store contact person name |
| 84 | + "contact_number" => "", // Contact person number |
| 85 | + "address" => "", // Store address |
| 86 | + "secondary_contact" => "", // Contact person secondary number not mandatory |
| 87 | + "city_id" => "", // Find in city method |
| 88 | + "zone_id" => "", // Find in zone method |
| 89 | + "area_id" => "", // Find in Area method |
| 90 | + ]); |
| 91 | +``` |
| 92 | + |
| 93 | +### 5. Get Store List |
| 94 | + |
| 95 | +``` |
| 96 | +use Codeboxr\PathaoCourier\Facade\PathaoCourier |
| 97 | +
|
| 98 | +return PathaoCourier::store()->list(); |
| 99 | +``` |
| 100 | + |
| 101 | +### 6. Create new parcel |
| 102 | + |
| 103 | +``` |
| 104 | +use Codeboxr\PathaoCourier\Facade\PathaoCourier |
| 105 | +
|
| 106 | +return PathaoCourier::order() |
| 107 | + ->create([ |
| 108 | + "store_id" => "", // Find in store list, |
| 109 | + "merchant_order_id" => "", // Unique order id |
| 110 | + "recipient_name" => "", // Customer name |
| 111 | + "recipient_phone" => "", // Customer phone |
| 112 | + "recipient_address" => "", // Customer address |
| 113 | + "recipient_city" => "", // Find in city method |
| 114 | + "recipient_zone" => "", // Find in zone method |
| 115 | + "recipient_area" => "", // Find in Area method |
| 116 | + "delivery_type" => "", // 48 for normal delivery or 12 for on demand delivery |
| 117 | + "item_type" => "", // 1 for document, |
| 118 | +2 for parcel |
| 119 | + "special_instruction" => "", |
| 120 | + "item_quantity" => "", // item quantity |
| 121 | + "item_weight" => "", // parcel weight |
| 122 | + "amount_to_collect" => "", // amount to collect |
| 123 | + "item_description" => "" // product details |
| 124 | + ]); |
| 125 | +``` |
| 126 | + |
| 127 | +### 7. Get Order Details |
| 128 | + |
| 129 | +``` |
| 130 | +use Codeboxr\PathaoCourier\Facade\PathaoCourier |
| 131 | +
|
| 132 | +return PathaoCourier::order()->orderDetails($consignmentId); // After successfully create order they given a consignment_id |
| 133 | +``` |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | +## Contributing |
| 150 | + |
| 151 | +Contributions to the Pathao package are welcome. Please note the following guidelines before submitting your pull request. |
| 152 | + |
| 153 | +- Follow [PSR-4](http://www.php-fig.org/psr/psr-4/) coding standards. |
| 154 | +- Read Pathao API documentations first |
| 155 | + |
| 156 | +## License |
| 157 | + |
| 158 | +Pathao package is licensed under the [MIT License](http://opensource.org/licenses/MIT). |
| 159 | + |
| 160 | +Copyright 2022 [Codeboxr](https://codeboxr.com) |
0 commit comments