-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
Error Class "Xendit\Xendit\Invoice\CreateInvoiceRequest" not found
Laravel 8.75
public function __construct() {
// Xendit::setApiKey(env('XENDIT_SECRET_KEY'));
Configuration::setXenditKey(env('XENDIT_SECRET_KEY'));
}
public function create(Request $request)
{
// Configuration::setXenditKey("YOUR_API_KEY_HERE");
$apiInstance = new InvoiceApi();
$create_invoice_request = new Xendit\Invoice\CreateInvoiceRequest([
'external_id' => 'test1234',
'description' => 'Test Invoice',
'amount' => 10000,
'invoice_duration' => 172800,
'currency' => 'IDR',
'reminder_time' => 1
]); // \Xendit\Invoice\CreateInvoiceRequest
$for_user_id = "62efe4c33e45694d63f585f0"; // string | Business ID of the sub-account merchant (XP feature)
try {
$result = $apiInstance->createInvoice($create_invoice_request, $for_user_id);
return response()->json($result);
} catch (\Xendit\XenditSdkException $e) {
return response()->json(['error' => $e->getMessage()], 500);
}
}
Metadata
Metadata
Assignees
Labels
No labels