<?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>DEV Community: Bekam B</title>
    <description>The latest articles on DEV Community by Bekam B (@ogbek).</description>
    <link>https://dev.to/ogbek</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%2F3977466%2Fc332a509-3697-4132-a721-694bdab9b1d6.png</url>
      <title>DEV Community: Bekam B</title>
      <link>https://dev.to/ogbek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ogbek"/>
    <language>en</language>
    <item>
      <title>I Built an Open Source Telebirr SDK for Laravel After Fighting Signature Failures for Days</title>
      <dc:creator>Bekam B</dc:creator>
      <pubDate>Wed, 10 Jun 2026 10:25:51 +0000</pubDate>
      <link>https://dev.to/ogbek/open-source-telebirr-php-laravel-sdk-for-production-ready-ethiopian-payment-integration-4ldg</link>
      <guid>https://dev.to/ogbek/open-source-telebirr-php-laravel-sdk-for-production-ready-ethiopian-payment-integration-4ldg</guid>
      <description>&lt;p&gt;If you've integrated Telebirr in Laravel or PHP before, you've probably seen this error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;60200099 Verify the sign field failed
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first it looks simple.&lt;/p&gt;

&lt;p&gt;Then you spend hours debugging:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RSA padding&lt;/li&gt;
&lt;li&gt;parameter ordering&lt;/li&gt;
&lt;li&gt;webhook verification&lt;/li&gt;
&lt;li&gt;H5 signing rules&lt;/li&gt;
&lt;li&gt;PEM formatting&lt;/li&gt;
&lt;li&gt;sandbox vs production differences&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;…and nothing works consistently.&lt;/p&gt;

&lt;p&gt;After dealing with these problems repeatedly, I decided to build a production-focused Telebirr PHP &amp;amp; Laravel SDK that handles the interoperability issues automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub Repository
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/OgBek/Telebirr-laravel-package-sdk" rel="noopener noreferrer"&gt;https://github.com/OgBek/Telebirr-laravel-package-sdk&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  The Biggest Problem Wasn't the API
&lt;/h1&gt;

&lt;p&gt;The actual API calls are easy.&lt;/p&gt;

&lt;p&gt;The hard part was making signatures work reliably across:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sandbox&lt;/li&gt;
&lt;li&gt;production&lt;/li&gt;
&lt;li&gt;different PHP environments&lt;/li&gt;
&lt;li&gt;Laravel request handling&lt;/li&gt;
&lt;li&gt;H5 redirect signing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I found that many integration examples online:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;signed the wrong fields&lt;/li&gt;
&lt;li&gt;used inconsistent sorting&lt;/li&gt;
&lt;li&gt;mixed RSA-PSS and PKCS1&lt;/li&gt;
&lt;li&gt;ignored replay protection&lt;/li&gt;
&lt;li&gt;failed in production even when sandbox worked&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  One Tiny Mistake Breaks Everything
&lt;/h1&gt;

&lt;p&gt;For example, Telebirr H5 signing only expects these fields:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;appid
merch_code
nonce_str
prepay_id
timestamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you accidentally include fields like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;version&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;trade_type&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;redirect_url&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;inside the signed payload, you'll randomly get signature failures.&lt;/p&gt;

&lt;p&gt;That single issue alone wasted a ridiculous amount of debugging time.&lt;/p&gt;




&lt;h1&gt;
  
  
  What the SDK Handles
&lt;/h1&gt;

&lt;p&gt;The package now automatically handles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;RSA-PSS signing&lt;/li&gt;
&lt;li&gt;Optional PKCS1 support&lt;/li&gt;
&lt;li&gt;Deterministic recursive sorting&lt;/li&gt;
&lt;li&gt;Webhook verification&lt;/li&gt;
&lt;li&gt;Replay attack protection&lt;/li&gt;
&lt;li&gt;Timestamp validation&lt;/li&gt;
&lt;li&gt;Smart PEM key loading&lt;/li&gt;
&lt;li&gt;Laravel integration&lt;/li&gt;
&lt;li&gt;Vanilla PHP compatibility&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Installation
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;composer require bekambeyene/telebirr
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Publish the config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php artisan vendor:publish &lt;span class="nt"&gt;--tag&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"telebirr-config"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Example Laravel Usage
&lt;/h1&gt;

&lt;p&gt;Create an H5 payment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$paymentUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Telebirr&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;createOrder&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s1"&gt;'Premium Subscription'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="mf"&gt;250.00&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;'ORDER-'&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nb"&gt;uniqid&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;away&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$paymentUrl&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Webhook verification:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Telebirr&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;handleWebhook&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$request&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The SDK automatically validates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;signatures&lt;/li&gt;
&lt;li&gt;timestamps&lt;/li&gt;
&lt;li&gt;nonce replay attempts&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  One Unexpected Issue: PEM Keys
&lt;/h1&gt;

&lt;p&gt;A surprisingly annoying issue was &lt;code&gt;.env&lt;/code&gt; key formatting.&lt;/p&gt;

&lt;p&gt;Some developers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;store raw keys&lt;/li&gt;
&lt;li&gt;use base64&lt;/li&gt;
&lt;li&gt;use file paths&lt;/li&gt;
&lt;li&gt;accidentally break multiline formatting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The SDK now supports:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;TELEBIRR_PRIVATE_KEY="file:///var/www/keys/private_key.pem"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;as well as raw/base64 formats automatically.&lt;/p&gt;




&lt;h1&gt;
  
  
  Production vs Sandbox Is Different
&lt;/h1&gt;

&lt;p&gt;One thing I learned quickly:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sandbox success does NOT guarantee production success.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Production Telebirr environments tend to be stricter about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;padding modes&lt;/li&gt;
&lt;li&gt;timestamps&lt;/li&gt;
&lt;li&gt;payload ordering&lt;/li&gt;
&lt;li&gt;signature consistency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the package focuses heavily on deterministic behavior.&lt;/p&gt;




&lt;h1&gt;
  
  
  Security Features
&lt;/h1&gt;

&lt;p&gt;The SDK includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;replay attack detection&lt;/li&gt;
&lt;li&gt;timestamp expiration validation&lt;/li&gt;
&lt;li&gt;strict webhook verification&lt;/li&gt;
&lt;li&gt;deterministic canonicalization&lt;/li&gt;
&lt;li&gt;configurable RSA padding&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Why I Open Sourced It
&lt;/h1&gt;

&lt;p&gt;There aren't many well-maintained open source Telebirr integrations focused on Laravel and production interoperability.&lt;/p&gt;

&lt;p&gt;I wanted to build something developers could actually rely on instead of repeatedly debugging cryptographic edge cases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Repository
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/OgBek/Telebirr-laravel-package-sdk" rel="noopener noreferrer"&gt;https://github.com/OgBek/Telebirr-laravel-package-sdk&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback, issues, and contributions are welcome.&lt;/p&gt;




&lt;h1&gt;
  
  
  Tags
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;laravel&lt;/code&gt; &lt;code&gt;php&lt;/code&gt; &lt;code&gt;opensource&lt;/code&gt; &lt;code&gt;payments&lt;/code&gt; &lt;code&gt;ethiopia&lt;/code&gt; &lt;code&gt;sdk&lt;/code&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>opensource</category>
      <category>laravel</category>
      <category>php</category>
    </item>
  </channel>
</rss>
