eba-alemayehu / telebirr

Telebirr integration helper
41 stars 22 forks source link

400 Operation failed #3

Open abeyshiferaw0 opened 2 years ago

abeyshiferaw0 commented 2 years ago

Hi, i was trying to integrate with telebirr with your package but i keep getting short code inconsistent error so i figured this package was using the production telebirr api link, so i forked your code and tried it with the test api link that we get from tele birr but still

400 Operation failed

is the only thing that i am getting .

this is the link i switched api value to http://196.188.120.3:11443/ammapi/service-openup/toTradeWebPay

any help or tips would be appreciated, what should i do,

also it would be great if you your package could accept isTestEnv value so that it can work with test environment

yeabashenafi commented 2 years ago

@abeyshiferaw0 , The Url you are using is incorrect. For mobile application you should use http://196.188.120.3:11443/ammapi/payment/service-openup/toTradeMobilePay and for Web/H5 usehttp://196.188.120.3:11443/service-openup/toTradeWebPay.

eba-alemayehu commented 2 years ago

You can pass api url as a constructor param on v0.0.3

telebirr = Telebirr( app_id="YOUR APP ID FROM TELEBIRR ADMIN", app_key="YOUR APP KEY FROM TELEBIRR ADMIN", public_key=private_key, notify_url="https://example.com/telebirr/121232", receive_name="Your company name", return_url="https://example.com/", short_code="SHORT CODE FROM TELEBIRR ADMIN", subject="Test", timeout_express="30", total_amount="10", nonce="UNIQUE", out_trade_no="UNIQUE", api="http://196.188.120.3:11443/service-openup/toTradeWebPay" )

Like this