BaseMax / bonbast-api

Dollar and Euro: Live irr exchange rates in free market - bonbast.com
https://www.bonbast.com
MIT License
2 stars 2 forks source link

fix: integration with the new Bonbast web-service #2

Closed Scrip7 closed 3 years ago

Scrip7 commented 3 years ago

Hey there, This PR closes #1

I also ran the example.php file, and here's the sample response:

Array
(
    [US Dollar] => Array
        (
            [sell] => 25500
            [buy] => 25400
        )
    [Euro] => Array
        (
            [sell] => 30300
            [buy] => 30150
        )
    [British Pound] => Array
        (
            [sell] => 35515
            [buy] => 35315
        )
    [Swiss Franc] => Array
        (
            [sell] => 28165
            [buy] => 28015
        )
    [Canadian Dollar] => Array
        (
            [sell] => 20465
            [buy] => 20365
        )
    [Australian Dollar] => Array
        (
            [sell] => 18755
            [buy] => 18655
        )
    [Swedish Krona] => Array
        (
            [sell] => 2970
            [buy] => 2955
        )
    [Norwegian Krone] => Array
        (
            [sell] => 2895
            [buy] => 2880
        )
    [Russian Ruble] => Array
        (
            [sell] => 349
            [buy] => 346
        )
    [Thai Baht] => Array
        (
            [sell] => 775
            [buy] => 770
        )
    [Singapore Dollar] => Array
        (
            [sell] => 18855
            [buy] => 18755
        )
    [Hong Kong Dollar] => Array
        (
            [sell] => 3280
            [buy] => 3250
        )
    [Azerbaijani Manat] => Array
        (
            [sell] => 14985
            [buy] => 14885
        )
    [Armenian Dram] => Array
        (
            [sell] => 525
            [buy] => 520
        )
    [Danish Krone] => Array
        (
            [sell] => 4075
            [buy] => 4055
        )
    [UAE Dirham] => Array
        (
            [sell] => 6940
            [buy] => 6920
        )
    [Japanese Yen] => Array
        (
            [sell] => 2325
            [buy] => 2315
        )
    [Turkish Lira] => Array
        (
            [sell] => 3020
            [buy] => 3000
        )
    [Chinese Yuan] => Array
        (
            [sell] => 3945
            [buy] => 3925
        )
    [KSA Riyal] => Array
        (
            [sell] => 6800
            [buy] => 6770
        )
    [Indian Rupee] => Array
        (
            [sell] => 342
            [buy] => 340
        )
    [Ringgit] => Array
        (
            [sell] => 6035
            [buy] => 6005
        )
    [Afghan Afghani] => Array
        (
            [sell] => 318
            [buy] => 316
        )
    [Kuwaiti Dinar] => Array
        (
            [sell] => 84850
            [buy] => 84450
        )
    [Iraqi Dinar] => Array
        (
            [sell] => 1745
            [buy] => 1735
        )
    [Bahraini Dinar] => Array
        (
            [sell] => 67645
            [buy] => 67145
        )
    [Omani Rial] => Array
        (
            [sell] => 66235
            [buy] => 65935
        )
    [Qatari Riyal] => Array
        (
            [sell] => 7005
            [buy] => 6975
        )
    [Azadi] => Array
        (
            [sell] => 10800000
            [buy] => 10500000
        )
    [Emami] => Array
        (
            [sell] => 11200000
            [buy] => 11000000
        )
    [½ Azadi] => Array
        (
            [sell] => 5850000
            [buy] => 5680000
        )
    [¼ Azadi] => Array
        (
            [sell] => 3750000
            [buy] => 3600000
        )
    [Gerami] => Array
        (
            [sell] => 2300000
            [buy] => 2200000
        )
    [Gold Gram] => Array
        (
            [sell] => 1092386
        )
    [Gold Mithqal] => Array
        (
            [sell] => 4732000
        )
    [Gold Ounce] => Array
        (
            [sell] => 1807.17
        )
    [Bitcoin] => Array
        (
            [sell] => 39581.79
        )
)

JSON:

{"US Dollar":{"sell":"25500","buy":"25400"},"Euro":{"sell":"30300","buy":"30150"},"British Pound":{"sell":"35515","buy":"35315"},"Swiss Franc":{"sell":"28165","buy":"28015"},"Canadian Dollar":{"sell":"20465","buy":"20365"},"Australian Dollar":{"sell":"18755","buy":"18655"},"Swedish Krona":{"sell":"2970","buy":"2955"},"Norwegian Krone":{"sell":"2895","buy":"2880"},"Russian Ruble":{"sell":"349","buy":"346"},"Thai Baht":{"sell":"775","buy":"770"},"Singapore Dollar":{"sell":"18855","buy":"18755"},"Hong Kong Dollar":{"sell":"3280","buy":"3250"},"Azerbaijani Manat":{"sell":"14985","buy":"14885"},"Armenian Dram":{"sell":"525","buy":"520"},"Danish Krone":{"sell":"4075","buy":"4055"},"UAE Dirham":{"sell":"6940","buy":"6920"},"Japanese Yen":{"sell":"2325","buy":"2315"},"Turkish Lira":{"sell":"3020","buy":"3000"},"Chinese Yuan":{"sell":"3945","buy":"3925"},"KSA Riyal":{"sell":"6800","buy":"6770"},"Indian Rupee":{"sell":"342","buy":"340"},"Ringgit":{"sell":"6035","buy":"6005"},"Afghan Afghani":{"sell":"318","buy":"316"},"Kuwaiti Dinar":{"sell":"84850","buy":"84450"},"Iraqi Dinar":{"sell":"1745","buy":"1735"},"Bahraini Dinar":{"sell":"67645","buy":"67145"},"Omani Rial":{"sell":"66235","buy":"65935"},"Qatari Riyal":{"sell":"7005","buy":"6975"},"Azadi":{"sell":"10800000","buy":"10500000"},"Emami":{"sell":"11200000","buy":"11000000"},"\u00bd Azadi":{"sell":"5850000","buy":"5680000"},"\u00bc Azadi":{"sell":"3750000","buy":"3600000"},"Gerami":{"sell":"2300000","buy":"2200000"},"Gold Gram":{"sell":"1092386"},"Gold Mithqal":{"sell":"4732000"},"Gold Ounce":{"sell":"1807.17"},"Bitcoin":{"sell":"39581.79"}}
BaseMax commented 3 years ago

Thank you very much for your participation and for completing the draft code I wrote. @Scrip7 I'm curious how you got to this repository. How about this repo?

Scrip7 commented 3 years ago

Thank you very much for your participation and for completing the draft code I wrote. @Scrip7 I'm curious how you got to this repository. How about this repo?

No problem, buddy :D I'm a friend of SirSobhan, we were chatting earlier today He's a newbie programmer, and he told me he ran into this issue and couldn't figure how to solve it. Then he linked me to the issue he created, and I submitted this PR!

The last time I coded in PHP was probably like four years ago :) I moved on to Node.JS and Golang, so this brought up my good memories, It was fun. 😄