2017 © Pedro Peláez
 

library shop-client

Paloma Shop client library

image

paloma/shop-client

Paloma Shop client library

  • Wednesday, July 11, 2018
  • by pkraeutli
  • Repository
  • 3 Watchers
  • 0 Stars
  • 878 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 27 Versions
  • 30 % Grown

The README.md

Paloma Shop PHP Client

PHP client library for the Paloma Shop. Facilitates the access to the following APIs (see https://docs.paloma.one/ for details and code examples):, (*1)

  • Catalog
  • Checkout
  • Customers

Note: This is v3 of the Paloma Shop PHP Client. It is not backwards-compatible with v2 and is intended to be used together with the Paloma Shop Bundle for Symfony., (*2)

Usage


// Create Paloma client $factory = new Paloma\Shop\PalomaClientFactory($options); $client = $factory->create([ 'base_url' => 'https://demo.paloma.one/api/', 'api_key' => 'yourAPIKey', 'channel' => 'yourChannel', 'locale' => 'yourLocale', ]); // Create security service $security = new MyPalomaSecurity(); // implements \Paloma\Shop\Security\PalomaSecurityInterface // Create Paloma catalog $catalog = new \Paloma\Shop\Catalog\Catalog($client, new \Paloma\Shop\Common\PricingContextProvider($security)); // Call API, e.g. fetch catalog categories $categories = $catalog->getCategories(); // Create Symfony validator $validator = new Validator(); // implements Symfony\Component\Validator\Validator\ValidatorInterface // Create Paloma checkout $checkout = new \Paloma\Shop\Checkout\Checkout($client, $security, $validator); // Add cart item $checkout->addCartItem('100-200', 1);

Examples

Hint: Find more examples at https://docs.paloma.one/., (*3)

Get product for a category, sorted by price:, (*4)

$page = $catalog->search(new SearchRequest(...));

Get cart (e.g. to render shopping cart view):, (*5)

$order = $checkout->getCart();

Add product to cart:, (*6)

$order = $checkout->addCartItem('12345', 1);

Update cart item quantity:, (*7)

$checkout->updateCartItem('123' /* order item id */, 2 /* quantity */);

Remove a cart item:, (*8)

$checkout->removeCartItem('123');

Get cart items count:, (*9)

// Number of order items
$checkout->getCart()->itemsCount();

// Number of items times quantities
$checkout->getCart()->unitsCount();

Set order addresses:, (*10)

$billingAddress = new Address(...);
$shippingAddress = new Address(...);
$checkout->setAddresses($billingAddress, $shippingAddress);

Initialize payment:, (*11)

$payment = $checkout->initializePayment(new PaymentInitParameters(...));

Use $payment->getProviderParams() to create payment URL or to render payment form., (*12)

Place the order:, (*13)

$orderPurchase = $checkout->purchase();
echo 'Purchased order ' . $orderPurchase->getOrderNumber() . '!';

The Versions

11/07 2018

dev-master

9999999-dev

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

11/07 2018
22/06 2018
17/05 2018
17/05 2018
19/04 2018
23/03 2018
20/03 2018
22/02 2018
06/02 2018
08/12 2017
03/12 2017
01/12 2017
29/11 2017

2.2.1

2.2.1.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

27/11 2017

2.2.0

2.2.0.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

26/11 2017

2.1.0

2.1.0.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

21/11 2017

2.0.3

2.0.3.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

15/11 2017

2.0.2

2.0.2.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

02/11 2017

2.0.1

2.0.1.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

18/10 2017

v1.3.1

1.3.1.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

18/10 2017

v2.0.0

2.0.0.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

18/10 2017

v1.3.0

1.3.0.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

05/09 2017

v1.2.2

1.2.2.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

01/09 2017

v1.2.1

1.2.1.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

01/09 2017

v1.2.0

1.2.0.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

28/08 2017

v1.1.0

1.1.0.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires

24/08 2017

v1.0.0

1.0.0.0

Paloma Shop client library

  Sources   Download

MIT

The Requires

 

The Development Requires