php-sdk icon indicating copy to clipboard operation
php-sdk copied to clipboard

Cart not clearer after checkout and how to capture payment

Open rained23 opened this issue 6 years ago • 0 comments

Hi,

I tried the php-sdk and when I follow the example, the quantity of the item will always increase even the cart already checked out and payment authorized.

Here is the sample

    $products = $moltin->products->all()->data();
    $moltin->cart()->addProduct($products[0]->id, 1);
    $order = $moltin->cart()->checkout(
        [
          'name'  => 'test',
          'email' => '[email protected]'
        ],
        [
          'first_name' => 'Jon',
          'last_name' => 'Doe',
          'line_1' => '123 Sunny Street',
          'line_2' => 'Sunnycreek',
          'county' => 'California',
          'postcode' => 'CA94040',
          'country' => 'US'
        ]
      );
      $payment = $order->pay('manual','authorize',[]);

One more thing is how can I capture the payment, after authorized.

rained23 avatar Sep 05 '18 04:09 rained23