Closed holywingsindonesia closed 4 years ago
Hi @holywingsindonesia Can I have your code snippet that is throwing this error?
`Xendit::setApiKey(getenv('xnd_production_S****'));
$danaParams = [
'external_id' => 'holywings_' . time(),
'amount' => 2000,
'phone' => '082112884647',
'expiration_date' => '2020-05-02T00:00:00.000Z',
'callback_url' => 'https://devtakeaway.holywings.id/callbacks',
'redirect_url' => 'https://devtakeaway.holywings.id/site/wew',
'ewallet_type' => 'DANA'
];
$createDana = \Xendit\EWallets::create($danaParams);
var_dump($createDana);`
@holywingsindonesia Can I have your PHP version as well?
ah sorry, i forget switch php version in server. Thank you
@holywingsindonesia Cool. Is this issue considered resolved then? Please let us know if you encounter any other issues
i back to mode development when i request payment
get error Xendit\Exceptions\ApiException There was an error with the format submitted to the server.
` Xendit::setApiKey(getenv('xnd_development_dsaTihlnl**'));
$danaParams = [
'external_id' => 'demo_' . time(),
'amount' => 32000,
'phone' => '081298498259',
'expiration_date' => '2020-02-20T00:00:00.000Z',
'callback_url' => 'https://my-shop.com/callbacks',
'redirect_url' => 'https://my-shop.com/home',
'ewallet_type' => 'DANA'
];
$createDana = \Xendit\EWallets::create($danaParams);
var_dump($createDana);`
same like production
@holywingsindonesia Your expiration_date
seems to be the problem. It should be a date in the future, your current one is in the past (20 Feb 2020)
@holywingsindonesia Another possible cause for this API error is missing API key. You might be missing a call to setApiKey
@holywingsindonesia Your
expiration_date
seems to be the problem. It should be a date in the future, your current one is in the past (20 Feb 2020)
already change keep same
Xendit::setApiKey(getenv('xnd_development_***'))
this i already call setApiKey
$danaParams = [ 'external_id' => 'demo_' . time(), 'amount' => 32000, 'phone' => '081298498259', 'expiration_date' => '2020-05-02T00:00:00.000Z', 'callback_url' => 'https://my-shop.com/callbacks', 'redirect_url' => 'https://my-shop.com/home', 'ewallet_type' => 'DANA' ];
@holywingsindonesia It should be Xendit::setApiKey('xnd_development_***')
without getenv
okay thank you, i will try at production type now
get response Sender IP address is not whitelisted but i already put the IP server at dashboard
` Xendit::setApiKey('xnd_production_ShitOq***');
$params = ["external_id" => "262**",
"bank_code" => "BRI",
"name" => "Cydh"
];
$createVA = \Xendit\VirtualAccounts::create($params);
var_dump($createVA);
$id = $createVA['id'];
$getVABanks = \Xendit\VirtualAccounts::getVABanks();
var_dump($getVABanks);
$getVA = \Xendit\VirtualAccounts::retrieve($id);
var_dump($getVA);
$updateParams = ["suggested_amount" => 10000];
$updateVA = \Xendit\VirtualAccounts::update($id, $updateParams);
var_dump($updateVA);
$paymentID = "262**_591200000****";
$getFVAPayment = \Xendit\VirtualAccounts::getFVAPayment($paymentID);
var_dump($getFVAPayment);`
or something wrong with this code?
@holywingsindonesia Yes. To use Live API key, you have to whitelist your server's IP address in https://dashboard.xendit.co/settings/developers#ip-whitelists
Already sir
@holywingsindonesia It's probably incorrect 🤔 You can try running this command curl https://ipinfo.io/ip
in your server to see what your server's public IP is
try ping devtakeaway.holywings.id its same like whitelist IP
this dedicated server sir,
already put and remove
Hi @holywingsindonesia I think you had a typo in your whitelisted IP in dashboard. The one set there is 103.28.148.68
while your actual IP is 103.28.148.86
(Notice the difference in the last 2 digits 68 vs 86)
ah im so sorry, last question
26215 59xx000000000 - 26215 59xx999999999
` ["external_id" => "26215"
$paymentID = "26215_59xx000000005";
` That external and payment ID is right?
@holywingsindonesia I'm guessing you're trying to use getFVAPayment
. payment_id
should be the value of payment_id
in payload you get from your callback for VA payment.
ah okay, i get callback "account_number": "2621559126407242xx", its random generate? or i can make static number?
@holywingsindonesia payment_id
is unique to every payment so it can't be fixed. May I know what is that you're trying to achieve?
okay thank you, i wanna make 1 user => 1 account VA we wanna build takeaway service and with another method payment.
so : every transaction make 1 VA, can repeat the same VA for next payment with same user?
anyway thank you for you help.
Cool hope that was helpful for you @holywingsindonesia
Error ketika production request payment
[$rbody, $rcode, $rheaders] = $this->_httpClient()->sendRequest(
HttpClient/GuzzleClient.php
[$rbody, $rcode, $rheader] = $this->_executeRequest($opts, $url);