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

Sell already created product on https://sandbox.2checkout.com/sandbox/products/list_products #28

Open
denGitHub opened this issue Apr 21, 2017 · 1 comment

Comments

@denGitHub
Copy link

denGitHub commented Apr 21, 2017

Is it possible to sell the product which is created on the dashboard of 2CO account?

  1. I have a product on 2CO with "product id" 12345 with all params: tangible, recur........
    Now I want to run just with this product id like "productId" =>"12345"
     $lineItems = array(
             "productId"  => "12345",
         );
       $query = array(
             "sellerId" => config('apikeys.twocheckout.seller_id'),
             "merchantOrderId" => "123465",
             "token" => $this->billing_data['token'],
             "currency" => self::CURRENCY,
             "billingAddr" => $billing_address,
             "lineItems" => array(  $lineItems    ),
     )

And I got error 400 in response

though
2. This example works fine.


          $lineItems = array(
               "productId"  => "2",
               "name"        => "Test Product",
               "quantity"    => "1",
               "tangible"    => "N",
               "startupFee" => "1.00",
               "recurrence"  => "1 Month",
               "description" => "This is a test",
               "price"=>"10.0"
           );

           $query = array(
               "sellerId" => config('apikeys.twocheckout.seller_id'),
               "merchantOrderId" => "123465",
               "token" => $this->billing_data['token'],
               "currency" => self::CURRENCY,
               "billingAddr" => $billing_address,
               "lineItems" => array(
                   $lineItems
               ),
           );

It would be nice if it is possible to sell created product from dashboard.
Thank you.

@calebh05
Copy link

Unfortunately what you're trying to do will not work, you're omitting required attributes from the request.

Please review the documentation here, and scroll down to the lineitem attributes section. From there you'll see a list of required attributes, you would need to pass in the type, name, and price attributes to meet the minimum requirement.

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