Skip to content
This repository has been archived by the owner on Sep 18, 2019. It is now read-only.

Cart not clearer after checkout and how to capture payment #72

Open
rained23 opened this issue Sep 5, 2018 · 0 comments
Open

Cart not clearer after checkout and how to capture payment #72

rained23 opened this issue Sep 5, 2018 · 0 comments

Comments

@rained23
Copy link

rained23 commented Sep 5, 2018

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' => 'test@test.com'
        ],
        [
          '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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant