ipaymu / ipaymu-php-api

The Official iPaymu-php-api
https://ipaymu.com
GNU General Public License v3.0
15 stars 9 forks source link

Workaround to fix: https://github.com/ipaymu/ipaymu-php-api/issues/2 #3

Closed NikarashiHatsu closed 3 years ago

NikarashiHatsu commented 3 years ago

Untuk meresolve issue #2, Saya membuat workaround seperti ini.

arakattack commented 3 years ago

Hallo, Untuk sandbox apakah sudah menggunakan example yang disediakan? Terimakasih,

Pada tanggal Sel, 5 Jan 2021 01:59, Aghits Nidallah < notifications@github.com> menulis:

Untuk meresolve issue #2 https://github.com/ipaymu/ipaymu-php-api/issues/2, Saya membuat workaround seperti ini.

You can view, comment on, or merge this pull request online at:

https://github.com/ipaymu/ipaymu-php-api/pull/3 Commit Summary

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ipaymu/ipaymu-php-api/pull/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5ZRGC7SIELNKPKJYIGP5TSYIFXTANCNFSM4VTNKL2A .

NikarashiHatsu commented 3 years ago

Halo, terima kasih atas responsenya.

Saya sudah menggunakan contoh yang Anda berikan. Mengetahui masalahnya terdapat pada COD, saya mencoba script seperti berikut:

$ipaymu->setCOD([
    'pickupArea' => "45151",
    'pickupAddress' => "Cirebon",
    'deliveryArea' => "45151",
    'deliveryAddress' => "Cirebon",
]);

Ketika saya jalankan script di atas, muncul error Exception: undefined Data dengan dump response JSON sebagai berikut:

array:2 [
  "Status" => 400
  "Message" => "location does not support COD"
]

Mengingat aplikasi yang saya bangun juga tidak membutuhkan fitur COD, apakah metode setCOD ini bersifat mandatory? Karena melihat README.md, Anda mencatat "Set COD (Only if COD method)".

arakattack commented 3 years ago

Hallo, Untuk sandbox, apakah sudah menggunakan file https://raw.githubusercontent.com/ipaymu/ipaymu-php-api/master/Example/demo.php? Apakah sudah mencoba unit testing? ` ❯ composer test

@php vendor/bin/phpunit -c ./ --color PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

Runtime: PHP 7.3.25 Configuration: /Users/administrator/repo/ipaymu-php-api/phpunit.xml

........ 8 / 8 (100%)

Time: 1.25 seconds, Memory: 6.00MB

OK (8 tests, 1 assertion)

`

Selanjutnya setelah production, cod bisa dinonaktifkan.

Terima kasih,

NikarashiHatsu commented 3 years ago

Halo, terima kasih atas responsenya.

Untuk sandbox, saya sudah menggunakan contoh yang disediakan dari https://raw.githubusercontent.com/ipaymu/ipaymu-php-api/master/Example/demo.php. Semua berjalan lancar saat pickupArea dan pickupAddress mengikuti contoh yang ada.

Untuk unit testing, sepertinya ada sedikit permasalahan disaat menggunakan PHP 7.4.12, berikut adalah log yang saya dapatkan saat menjalankan composer test:

> @php vendor/bin/phpunit -c ./ --color
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.4.12
Configuration: /home/hatsushiroyuki/Development/native/ipaymu-php-api/phpunit.xml

...E..                                                              6 / 6 (100%)

Time: 791 ms, Memory: 6.00MB

There was 1 error:

1) CartTest::testRemoveProductFromCart
Trying to access array offset on value of type null

/home/hatsushiroyuki/Development/native/ipaymu-php-api/iPaymu/iPaymu.php:186
/home/hatsushiroyuki/Development/native/ipaymu-php-api/tests/CartTest.php:50

ERRORS!
Tests: 6, Assertions: 1, Errors: 1.
Script @php vendor/bin/phpunit -c ./ --color handling the test event returned with error code 2

Karena jawaban Anda adalah Saya bisa menonaktifkan COD, saya akan menutup issue #2 dan menutup pull request ini. Saya masih berharap adanya update library ini untuk PHP versi 7.4.

Terima kasih atas waktunya.