thangnm93 / coccoc-shipping-service
It helps Vietnamese buy products on Amazon website.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:php-extension
Requires
- php: >=7.1.0
Requires (Dev)
- phpunit/phpunit: ^7.5||^8.0
This package is auto-updated.
Last update: 2024-11-05 11:24:20 UTC
README
This is an easy to use package to calculate the cross price.
Shipping Service Providers Available:
- Amazon
1. Requirements
2. Installation
Require using Composer:
$ composer install
3. How to use
include_once './vendor/autoload.php'; use \Coccoc\ShippingService\Providers\AmazonProvider; use \Coccoc\ShippingService\Services\OrderService; use \Coccoc\ShippingService\Product; $products = array( array( 'price' => 10, 'weight' => 120, // gram 'width' => 100, // cm 'height' => 120, // cm 'depth' => 10, ), array( 'price' => 20, 'weight' => 150, // gram 'width' => 110, // cm 'height' => 120, // cm 'depth' => 8, ) ); $provider = new AmazonProvider(); $order_service = new OrderService($provider); foreach ($products as $_product) { $product = new Product(); $product->setPrice($_product['price']); $product->setWeight($_product['weight']); $product->setWidth($_product['width']); $product->setHeight($_product['height']); $product->setDepth($_product['depth']); $order_service->setProduct($product); } $order_gross_price = $order_service->handle();
4. Testing
$ ./vendor/bin/phpunit --testdox --coverage-text --coverage-clover=coverage.clover
or using this command
$ composer test