2017 © Pedro Peláez
 

library rivio-php-sdk

Rivio PHP SDK

image

rivio/rivio-php-sdk

Rivio PHP SDK

  • Friday, April 6, 2018
  • by pestig
  • Repository
  • 2 Watchers
  • 0 Stars
  • 184 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 23 Versions
  • 5 % Grown

The README.md

Rivio PHP SDK

The Rivio PHP SDK provides integration access to the Rivio API., (*1)

Dependencies

PHP version >= 5.2.0 is required., (*2)

Install and configure

Download, (*3)

Or use composer

Composer is a package manager for PHP. In the composer.json file in your project add:, (*4)

{
  "require" : {
    "rivio/rivio-php-sdk": "*"
  }
}

And then run:, (*5)

php composer.phar install

Quick Start Examples

For testing, you will need your Rivio API key and your Secret key. You can get them, from here., (*6)

Product Reviews Widget

get_init_js();

$rivio_embed_html=$rivio->product_reviews_widget(
    "1492411012", //$product_id REQUIRED
    "Samsung Galaxy S6", //$product_name REQUIRED
    "https://example.com/products/galaxy-s6", //$product_url OPTIONAL
    "https://images.example.com/big/200", //$product_image_url OPTIONAL
    "This is the product description", //$product_description OPTIONAL
    "1234567890123", //$product_barcode OPTIONAL
    "Mobile phone", //$product_category OPTIONAL
    "Samsung", //$product_brand OPTIONAL
    "499", //$product_price OPTIONAL
    $reviews_html //$reviews_html OPTIONAL (from product_reviews_html)
);

?>
<html>
    <head>
        <title>Embed module - Rivio PHP SDK example</title>
    </head>
    <body>
        <h1>Rivio Embed Module</h1>
        <?php echo $rivio_embed_html;?>
        <?php echo $rivio_init_script;?>
    </body>
</html>

Register Post-purchase Email

After a purchase in your store, this code will send a "Post purchase email" to the buyer to write a review about it.
You can also configure this email sending here., (*7)

register_post_purchase_email(
    "1492411013331", //$order_id REQUIRED
    "2015-09-28T09:16:16-04:00", //$ordered_date REQUIRED
    "user@example.com", //$customer_email REQUIRED
    "John", //$customer_first_name REQUIRED
    "1492411012", //$product_id REQUIRED
    "Samsung Galaxy S6", //$product_name REQUIRED
    "https://example.com/products/galaxy-s6", //$product_url OPTIONAL
    "https://images.example.com/big/200", //$product_image_url OPTIONAL
    "This is the product description", //$product_description OPTIONAL
    "1234567890123", //$product_barcode OPTIONAL
    "Mobile phone", //$product_category OPTIONAL
    "Samsung", //$product_brand OPTIONAL
    "499" //$product_price OPTIONAL
);

?>
<html>
    <head>
        <title>Register Postpurchase Email - Rivio PHP SDK example</title>
    </head>
    <body>
        <h1>Rivio Register Postpurchase Email</h1>
        <p>result:</p>
        <pre><?php print_r($result);?></pre>
        Check your postpurchase email queue on 
        <a href="http://dashboard.getrivio.com/dashboard/email/summary" target="_blank">Rivio Dashboard</a>.
        If the "Email status" is "Pending" then the test was successful.
    </body>
</html>

You can add multiple products, using the example below. This way, Rivio will choose the most expensive product from the order. If price is not available for the products, it will choose the first product. After that Rivio is going to send the PostPurchase email about that product., (*8)

 "1492411013331", //$product_id REQUIRED
   "name" => "Samsung Galaxy S6", //$product_name REQUIRED
   "url" => "https://example.com/products/galaxy-s6", //$product_url OPTIONAL
   "image_url" => "https://images.example.com/big/200", //$product_image_url OPTIONAL
   "description" => "This is the product description", //$product_description OPTIONAL
   "barcode" => "1234567890123", //$product_barcode OPTIONAL
   "brand" => "Samsung", //$product_brand OPTIONAL,
   "price" => "499", //$product_price OPTIONAL
));

// The second product
array_push($products, array(
   "id" => "2811046815449", //$product_id REQUIRED
   "name" => "Google Pixel", //$product_name REQUIRED
   "url" => "https://example.com/products/pixel", //$product_url OPTIONAL
   "image_url" => "https://images.example.com/big/300", //$product_image_url OPTIONAL
   "description" => "This is the product description", //$product_description OPTIONAL
   "barcode" => "9876543210987", //$product_barcode OPTIONAL
   "brand" => "Google", //$product_brand OPTIONAL,
   "price" => "799", //$product_price OPTIONAL
));

$result = $rivio->register_post_purchase_email_multiple_product(
    "1492411013331", //$order_id REQUIRED
    "2015-09-28T09:16:16-04:00", //$ordered_date REQUIRED
    "user@example.com", //$customer_email REQUIRED
    "John", //$customer_first_name REQUIRED
    $products
);

?>
<html>
    <head>
        <title>Register Postpurchase Email with muliple products - Rivio PHP SDK example</title>
    </head>
    <body>
        <h1>Rivio Register Postpurchase Email with muliple products</h1>
        <p>result:</p>
        <pre><?php print_r($result);?></pre>
        Check your postpurchase email queue on 
        <a href="http://dashboard.getrivio.com/dashboard/email/summary" target="_blank">Rivio Dashboard</a>.
        If the "Email status" is "Pending" then the test was successful.
    </body>
</html>

For more examples upload the project to your storage and take a look at the examples/index.php.

The Versions

06/04 2018

dev-REEV-431

dev-REEV-431

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

11/09 2017

dev-master

9999999-dev

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

06/06 2017

dev-f/starts_html_translate_string

dev-f/starts_html_translate_string

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

06/06 2017

1.2.2

1.2.2.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

30/05 2017

dev-pospurchase_with_multiple_products

dev-pospurchase_with_multiple_products

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

30/05 2017

1.2.1

1.2.1.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

11/05 2017

1.2.0

1.2.0.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

03/05 2017

1.0.0

1.0.0.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

20/10 2016

0.2.0

0.2.0.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

14/01 2016

0.1.13

0.1.13.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

12/01 2016

0.1.12

0.1.12.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

23/12 2015

0.1.11

0.1.11.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.10

0.1.10.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.9

0.1.9.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.8

0.1.8.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.7

0.1.7.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.6

0.1.6.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.5

0.1.5.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.4

0.1.4.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.3

0.1.3.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.2

0.1.2.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.1

0.1.1.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti

10/12 2015

0.1.0

0.1.0.0

Rivio PHP SDK

  Sources   Download

MIT

The Requires

  • php >=5.2.0

 

by George Pesti