How to Use
Step 1: Install the latest package
npm install react-slope-js
Step 2: Import SlopeCheckout and pass in props as seen below
import SlopeCheckout from 'react-slope-js';
const checkoutInfo = {
buyer: {
first_name: "first_name",
last_name: "last_name",
email: "buyer@email.com",
phone_number: "+18282822828",
business_type: 1,
business_name: "name of the bussiness",
address: {
line_1: "address line 1",
line_2: "address line 2",
city: "sf",
state: "CA",
country: "USA",
zip_code: "99999"
},
},
items: [
{
id: "12",
name: "item_name",
description: "item description",
count: 1,
price: 12,
currency: 'usd'
}
],
loan_price: {
amount: 123,
currency: "usd"
}
}
<SlopeCheckout
checkoutInfo={checkoutInfo}
onSuccess={success}
onFailure={failure}
apiKey={API_KEY}
>
Pay with Slope
</SlopeCheckout>
const success = (loanInfo) => {
console.log('on Success: ', loanInfo);
}
const failure = () => {
console.log('on failure');
}
- Child View under SlopeCheckout can be any react view
- The modal will be shown on click of that child view.