Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
steph1902 opened this issue Apr 6, 2024 · 0 comments
Open

Comments

@steph1902
Copy link

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);
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant