Skip to content

Error Class "Xendit\Xendit\Invoice\CreateInvoiceRequest" not found #225

@steph1902

Description

@steph1902

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions