pz_package_test_checkout_providers
v1.1.1
Published
A library module for adding a payment method.
Downloads
3
Readme
pz_checkout_providers
A library module for adding a payment method.
Warning: pz-core version must be f7338da or higher
Usage
1. Install the app
At project root, create a requirements.txt if it doesn't exist and add the following line to it;
# For latest version
-e git+https://[email protected]/akinonteam/pz_checkout_providers.git#egg=pz_checkout_providers
# For specific version (Recommended)
-e git+https://[email protected]/akinonteam/pz_checkout_providers.git@eb74c4c#egg=pz_checkout_providers
For more information about this syntax, check pip install docs.
Next, run the following command to install the package.
# in venv
pip install -r requirements.txt
2. Install the npm package
# in /templates
# For latest version
yarn add git+ssh://[email protected]:akinonteam/pz_checkout_providers.git
# For specific version (Recommended)
yarn add git+ssh://[email protected]:akinonteam/pz_checkout_providers.git#eb74c4c
Make sure to use the same git commit id as in requirements.txt
.
3. Add to the project
# omnife_base/settings.py:
INSTALLED_APPS.append('pz_checkout_providers')
4. Import template:
Add a div with the class name js-checkout-providers to the page you want to use
Basket
<div class="js-checkout-providers"></div>
List and product detail page
<div class="js-checkout-providers" data-product="{{ product.pk }}"></div>
5. JS settings
Pass an object, which will be taken as destructured parameters, to customize things on the JS class.
//Import
import PzCheckoutProvider from 'pz-checkout-providers';
// Simple Using
new PzCheckoutProvider();
// Passing Parameters (w/ Default Parameters)
new PzCheckoutProvider({
clearBasket: true,
options: [
{
slug: 'akipay',
options: {
title: 'Pay With Akifast',
className: 'akipay-quick-pay-button'
}
}
]
});
clearBasket(Boolean, Optional): Deletes other products other than the product added to the cart from the cart
options(Object, Optional): Retrieves the title and class name values. In this way, special values can be given to the buttons.
6. Import styles:
@import '~pz-checkout-providers/';