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

How to add virtual item which is Nonconsumable #89

Open
PrajapatiDhara1510 opened this issue Aug 3, 2021 · 1 comment
Open

How to add virtual item which is Nonconsumable #89

PrajapatiDhara1510 opened this issue Aug 3, 2021 · 1 comment

Comments

@PrajapatiDhara1510
Copy link

I am using this SDK with laravel project. I am using api for creating virtual item. There is no document how to use with php and also request parameters are also different then mentioned in API reference of the official document. I somehow found the code from the source of the sdk. I did following code.

            $virtualItem = [
                'sku' => $request->sku,
                'name' => [
                    'en' => $request->name,
                ],
                'description' => [
                    'en' => $request->description,
                ],
                'prices' => [
                    'USD' => $request->price,
                ],
                'default_currency' => 'USD',
                'enabled' => $request->enabled,
                'free' => $request->free,
                'disposable' => false,
            ];

            $client = XsollaClient::factory(array(
                'merchant_id' => config('configuration.xsolla_merchant_id'),
                'api_key' => config('configuration.xsolla_api_key'),
            ));
            $response = $client->CreateVirtualItem([
                'project_id' => config('configuration.xsolla_project_id'),
                'request' => $virtualItem,
            ]);

As you can see for the php SDK there is difference with API reference. Now I want to create virtual item which is Nonconsumable. I tried item_type=>'Consumable' , item_type=>Nonconsumable', is_consumable=>false' , but nothing seems working.

Please help me how to do that also where can I find proper documentation.

@CoolisCodes
Copy link

I have the same problem with my solution, please help!

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

2 participants