<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Md. Yousuf Hossain</title>
    <description>The latest articles on Forem by Md. Yousuf Hossain (@wddyousuf).</description>
    <link>https://forem.com/wddyousuf</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F877392%2Fa9e02388-9407-463e-a202-8f849c5b22d2.jpeg</url>
      <title>Forem: Md. Yousuf Hossain</title>
      <link>https://forem.com/wddyousuf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/wddyousuf"/>
    <language>en</language>
    <item>
      <title>Paperfly Courier Integration Package for Laravel Framework</title>
      <dc:creator>Md. Yousuf Hossain</dc:creator>
      <pubDate>Wed, 15 Jun 2022 06:50:34 +0000</pubDate>
      <link>https://forem.com/wddyousuf/paperfly-courier-integration-package-for-laravel-framework-7g5</link>
      <guid>https://forem.com/wddyousuf/paperfly-courier-integration-package-for-laravel-framework-7g5</guid>
      <description>&lt;h2&gt;
  
  
  Step 1
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer require wddyousuf/paperfly
php artisan vendor:publish --provider=Wddyousuf\Paperfly\PaperflyServiceProvider
php artisan config:cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a courier.php in the config/ directory. Set your desired provider as default_provider and fill up the necessary environment variable of that provider.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2
&lt;/h2&gt;

&lt;p&gt;Set .env configuration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;COURIER_USERNAME="XXXXXXXX"
COURIER_PASSWORD="XXXXXXXXXX"
COURIER_API_KEY="Paperfly_~La?Rj73FcLm"
COURIER_PROVIDER="PAPERFLY"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Sample Code For Requesting a Pick Up
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use Wddyousuf\Paperfly\Facades\PaperflyCourier;

$OrderInformation=[
    "OrderNo" =&amp;gt; "111111",
    "MerchantName" =&amp;gt; "Mr. X",
    "MerchantAddress" =&amp;gt; "Test",
    "MerchantThana" =&amp;gt; "Dhanmondi",
    "MerchantDistrict" =&amp;gt; "Dhaka",
    "MerchantPhone" =&amp;gt; "017xxxxx",
    "SizeWeight" =&amp;gt; "standard",
    "productDetails" =&amp;gt; "Usb Fan",
    "packagePrice" =&amp;gt; "0",
    "deliveryType" =&amp;gt; "regular",
    "CustomerName" =&amp;gt; "Mr. Y",
    "CustomerAddress" =&amp;gt; "Road 27, Dhanmondi",
    "CustomerThana" =&amp;gt; "Adabor",
    "CustomerDistrict" =&amp;gt; "Dhaka",
    "CustomerPhone" =&amp;gt; "017xxxxx",
    "max_weight" =&amp;gt; "10",
];
$response = PaperflyCourier::sendRequest($OrderInformation);

//Collect Thana list from paperfly
//Collect District list from paperfly
// max_weight is only for weight Enabled Pickup Request
//If Thana and District doesn't match with paperfly list,It will occur error
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Sample Code For Tracking an Order
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use Wddyousuf\Paperfly\Facades\PaperflyCourier;

$orderId='XXXXXXX';
$response = PaperflyCourier::trackOrder($orderId);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Sample Code For Invoice
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use Wddyousuf\Paperfly\Facades\PaperflyCourier;

$orderId='XXXXXXX';
$response = PaperflyCourier::courierInvoice($orderId);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Sample Code For Cancel Order
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use Wddyousuf\Paperfly\Facades\PaperflyCourier;

$orderId='XXXXXXX';
$response = PaperflyCourier::CourierOrderCancel($orderId);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you feel something is missing then make a issue regarding that. Your can pull reques. If you want to contribute in this library, then you are highly welcome to do that....&lt;br&gt;
For accesing to repo and all method list visit github link from here &lt;a href="https://github.com/wddyousuf/paperfly"&gt;https://github.com/wddyousuf/paperfly&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>paperfly</category>
    </item>
  </channel>
</rss>
