odenktools / php-bca

Bank Central Asia Api
MIT License
81 stars 58 forks source link

fundTransfers - Error: ESB-14-016 - Format JSON tidak valid #10

Closed ghost closed 5 years ago

ghost commented 5 years ago

Saya melakukana porting aplikasi ini ke android hasilnya sebagai berikut: ACCESS_TOKEN, BALANCE_INFORMATION, ACCOUNT_STATEMENT semua berfungsi normal.

//////////////////////////////////////////////////////////////////////////////////////////////////////

12-11 20:44:54.347 : -- ACCESS TOKEN -- 12-11 20:44:54.347 access_token: 7KqkGqyHMIzs8UqFsq2L6i31MthXB5FbiYLBEW7dcLH4LuXXXXXXXX 12-11 20:44:54.348 token_type: Bearer 12-11 20:44:54.348 expires_in: 3600 12-11 20:44:54.348 scope: resource.WRITE resource.READ 12-11 20:44:54.348 :
12-11 20:44:58.197 : -- BALANCE INFORMATION -- 12-11 20:44:58.197 account_number: 0201245680 12-11 20:44:58.198 currency: IDR 12-11 20:44:58.198 balance: 118849999.53 12-11 20:44:58.198 available_balance: 118849999.53 12-11 20:44:58.198 float_amount: 0.00 12-11 20:44:58.198 hold_amount: 0.00 12-11 20:44:58.198 plafon: 0.00 12-11 20:44:58.198 :
12-11 20:45:03.321 : -- ACCOUNT STATEMENT -- 12-11 20:45:03.322 start_date: 2016-09-01 12-11 20:45:03.322 end_date: 2016-09-01 12-11 20:45:03.322 currency: IDR 12-11 20:45:03.322 start_balance: 94163880.00 12-11 20:45:03.343 :
12-11 20:45:03.343 transaction_date: PEND 12-11 20:45:03.343 branch_code: 0000 12-11 20:45:03.343 transaction_type: D 12-11 20:45:03.343 transaction_amount: 100000.00 12-11 20:45:03.343 transaction_name: TRSF E-BANKING DB 12-11 20:45:03.343 transaction_trailer: 0109/FTSCY/WS95051 100000.00 Online Transfer PT DUMMY2 12-11 20:45:03.344 :
12-11 20:45:03.344 transaction_date: PEND 12-11 20:45:03.344 branch_code: 0061 12-11 20:45:03.344 transaction_type: C 12-11 20:45:03.344 transaction_amount: 3000000.00 12-11 20:45:03.344 transaction_name: NK - LLG 12-11 20:45:03.344 :
12-11 20:45:03.345 transaction_date: PEND 12-11 20:45:03.345 branch_code: 0000 12-11 20:45:03.345 transaction_type: D 12-11 20:45:03.345 transaction_amount: 250000.00 12-11 20:45:03.345 transaction_name: TRSF E-BANKING DB 12-11 20:45:03.345 transaction_trailer: 0109/FTSCY/WS95051 250800.00 Transfer DUMMY1 12-11 20:45:03.345 :
12-11 20:45:03.345 transaction_date: PEND 12-11 20:45:03.345 branch_code: 0000 12-11 20:45:03.345 transaction_type: D 12-11 20:45:03.346 transaction_amount: 100000.00 12-11 20:45:03.346 transaction_name: BA JASA E-BANKING 12-11 20:45:03.346 transaction_trailer: 0109/TRCHG/WS95051BIAYA TRANSFER SME 12-11 20:45:03.346 :
12-11 20:45:03.346 transaction_date: PEND 12-11 20:45:03.346 branch_code: 0101 12-11 20:45:03.346 transaction_type: C 12-11 20:45:03.346 transaction_amount: 10000.00 12-11 20:45:03.346 transaction_name: KR OTOMATIS 12-11 20:45:03.347 transaction_trailer: DUMMY7 039903811112 12-11 20:45:03.347 :
12-11 20:45:03.347 transaction_date: PEND 12-11 20:45:03.347 branch_code: 0038 12-11 20:45:03.347 transaction_type: D 12-11 20:45:03.347 transaction_amount: 100000.00 12-11 20:45:03.347 transaction_name: TARIKAN TUNAI 12-11 20:45:03.347 :
12-11 20:45:08.247 : -- FUND TRANSFER -- 12-11 20:45:08.247 : fundTransfers - Error: ESB-14-016 - Format JSON tidak valid //////////////////////////////////////////////////////////////////////////////////////////////////////

Ketika melakukan FUND_TRANSFER saya memperoleh pesan:

fundTransfers- Error: ESB-14-016 - Format JSON tidak valid

Yang ingin saya tanyakan:

  1. Apakah kegunanan json_encode yang berada di fungsi fundTransfers()?

    $encoderData = json_encode($bodyData, JSON_UNESCAPED_SLASHES);

  2. Seperti apakah isi variable $encoderData yang berada di fungsi fundTransfer() (JSON yang valid untuk payload (body) sebelum diproses hash256)?

Saya sudah mencoba format json seperti dibawah ini tetapi gagal: Strip Whitespace Characters

{"Amount":"100000.00","BeneficiaryAccountNumber":"0201245681","CorporateID":"BCAAPI2016","CurrencyCode":"IDR","ReferenceID":"12345/PO/2016","Remark1":"Transfer Test","Remark2":"Online Transfer","SourceAccountNumber":"0201245680","TransactionDate":"2016-01-30","TransactionID":"00000001"}

Strip Whitespace Characters + Trim Spaces

{"Amount":"100000.00","BeneficiaryAccountNumber":"0201245681","CorporateID":"BCAAPI2016","CurrencyCode":"IDR","ReferenceID":"12345/PO/2016","Remark1":"TransferTest","Remark2":"OnlineTransfer","SourceAccountNumber":"0201245680","TransactionDate":"2016-01-30","TransactionID":"00000001"}

Kombinasi lain

{\"Amount\":\"100000.00\",\"BeneficiaryAccountNumber\":\"0201245681\",\"CorporateID\":\"BCAAPI2016\",\"CurrencyCode\":\"IDR\",\"ReferenceID\":\"12345\/PO\/2016\",\"Remark1\":\"TransferTest\",\"Remark2\":\"OnlineTransfer\",\"SourceAccountNumber\":\"0201245680\",\"TransactionDate\":\"2016-01-30\",\"TransactionID\":\"00000001\"}

Terimakasih, Ano

ghost commented 5 years ago

Untuk JSON format kedua yang benar. Tidak hanya karakter whitespace yang dihapus, juga karakter spasi.

Kesalahan saya adalah proses stripWhitespace belum saya lakukan saat melakukan passing payload/body ke http process.

Terimakasih.