php-sdk
php-sdk copied to clipboard
Cart not clearer after checkout and how to capture payment
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.