It allows you to apply a coupon to an order.
const order = await checkout.getOrderTokenized("1b753a67-ed2c-4cdb-9f8e")
await order.data?.applyCoupon("CUP01")
It allows you to get getInstallments
the bin are the first 6 digits of the credit card
const {data, error} = await checkoutOrderModel.getInstallments("bin")
It is used to obtain the state of Nequi
const response = await checkoutOrderModel.getNequiStatus()
Allows you to get a single order.
const order = await checkoutOrderModel.getOrder()
It allows you to get all shipping methods you currently have.
const date = new Date();
const addressPayload = {
id: 100,
user_id: "1093",
first_name: "Jhon",
last_name: "Doe",
phone: "+53 663663663",
identity_document: "42424242",
lat: -2452302,
lng: 05662145,
address1: "Av. Example 123",
address2: "Av. Examaple 234",
city: "Quito",
zipcode: "2040E",
state_name: "Pichincha",
state_code: "SS13",
country: "Ecuador",
address_type: "home",
additional_description: "casa",
is_default_address:true,
is_last_address:true,
is_billing_address:true,
created_at: date,
updated_at: date,
deleted_at: date,
country_code: "EC",
}
const {data, error} = await checkoutOrderModel.getShippingMethods(addressPayload)
It is used to obtain shipping rate
const response = await checkoutOrderModel.getShippingRate()
It allows us to process the payments that we currently have in process Internally, several internal methods are processed that helped in the process of purchasing an order.
const getOrderTokenized = await checkout.getOrderTokenized("1b753a67-ed2c-4cdb")
if(getOrderTokenized.error !== null){
console.warn("Error getting order")
return;
}
const orderModel = getOrderTokenized.data!;
const {data, error} = await orderModel.processPayment()
It allows us to retrieve the order
const {data,error} = await checkoutOrderModel.refetchOrder()
It allows us to remove a coupon from an order.
const order = await checkout.getOrderTokenized("1b753a67-ed2c-4cdb-9f8e")
await order.data?.removeCoupon("CUP01")
It allows you to declare the payment address to an order.
const addressPayload = {
id: 100,
user_id: "1093",
first_name: "Jhon",
last_name: "Doe",
phone: "+53 663663663",
identity_document: "42424242",
lat: -2452302,
lng: 05662145,
address1: "Av. Example 123",
address2: "Av. Examaple 234",
city: "Quito",
zipcode: "2040E",
state_name: "Pichincha",
state_code: "SS13",
country: "Ecuador",
address_type: "home",
additional_description: "casa",
is_default_address:true,
is_last_address:true,
is_billing_address:true,
created_at: date,
updated_at: date,
deleted_at: date,
country_code: "EC",
}
const {data,error} = await checkoutOrderModel.setBillingAddress(addressPayload)
Use this method when you need to use callbackUrl
const response = await checkoutOrderModel.setCallbackUrl("www.yourURL.com")
It allows you to set a tokenized card
setCardTokenized
const CardTokenized = {
id: "",
user_id: "",
card_holder: "",
card_holder_dni: "",
token: "",
company: "",
last_four: "",
first_six: "",
expiration_date: "",
created_at: "",
updated_at: "",
deleted_at: "",
}
const response = await checkoutOrderModel.setCardTokenized(CardTokenized,"your_cvv","your_zipcode")
Allows you to set the cash change
const response = await checkoutOrderModel.setCashChange(1093)
Use this method if you need to pay with a card without save
const card = {
expiry_month: "04",
expiry_year: "2022",
card_holder: "Jhon Doe",
card_holder_dni: "999999",
card_number: "4242424242424242",
card_cvv: "123",
address1: "Av. example 9999",
zip: "01823",
city: "Guadalajara",
state: "Jalisco",
country: "Mexico",
phone: "+52 999999999",
}
const response = await checkoutOrderModel.setCreditCard(card)
It allows us to set the device ID
const response = await checkoutOrderModel.setDeviceId("XXXX")
Use this method when you need to use PSE
const response = await checkoutOrderModel.setFinancialInstitution("financialInstitution")
Use this method in case that your user is guest
const response = await checkoutOrderModel.setGuestEmail("jhonDoe@yourmail.com")
It allows us to establish the quota selected by the user.
const response = await checkoutOrderModel.setInstallments(Installment)
It allows you to declare the payment method of an order.
const response = await checkoutOrderModel.setPaymentMethod(paymentMethod)
Allows you to set the Recaptcha token
const response = await checkoutOrderModel.setRecaptchaToken("1b753a67-ed2c-4cdb")
Allows you to set a scheduled date
const date = new Date();
const addressPayload = {
id: 100,
user_id: "1093",
first_name: "Jhon",
last_name: "Doe",
phone: "+53 663663663",
identity_document: "42424242",
lat: -2452302,
lng: 05662145,
address1: "Av. Example 123",
address2: "Av. Examaple 234",
city: "Quito",
zipcode: "2040E",
state_name: "Pichincha",
state_code: "SS13",
country: "Ecuador",
address_type: "home",
additional_description: "casa",
is_default_address:true,
is_last_address:true,
is_billing_address:true,
created_at: date,
updated_at: date,
deleted_at: date,
country_code: "EC",
}
const scheduledData = {
shipping_method_code: "Cod-Method",
selected_date: "2022-04-22",
}
scheduledData: ScheduledData
const response = await checkoutOrderModel.setScheduledDate(scheduledData,addressPayload)
It allows you to set your own shipping methods with their own rate.
const date = new Date();
const addressPayload = {
id: 100,
user_id: "1093",
first_name: "Jhon",
last_name: "Doe",
phone: "+53 663663663",
identity_document: "42424242",
lat: -2452302,
lng: 05662145,
address1: "Av. Example 123",
address2: "Av. Examaple 234",
city: "Quito",
zipcode: "2040E",
state_name: "Pichincha",
state_code: "SS13",
country: "Ecuador",
address_type: "home",
additional_description: "casa",
is_default_address:true,
is_last_address:true,
is_billing_address:true,
created_at: date,
updated_at: date,
deleted_at: date,
country_code: "EC",
}
const {data,error} = await checkoutOrderModel.setShippingMethod("methodCode",addressPayload)
It allows you to declare a shippingRate to an order.
const date = new Date();
const addressPayload = {
id: 100,
user_id: "1093",
first_name: "Jhon",
last_name: "Doe",
phone: "+53 663663663",
identity_document: "42424242",
lat: -2452302,
lng: 05662145,
address1: "Av. Example 123",
address2: "Av. Examaple 234",
city: "Quito",
zipcode: "2040E",
state_name: "Pichincha",
state_code: "SS13",
country: "Ecuador",
address_type: "home",
additional_description: "casa",
is_default_address:true,
is_last_address:true,
is_billing_address:true,
created_at: date,
updated_at: date,
deleted_at: date,
country_code: "EC",
}
const {data,error} = await checkoutOrderModel.setShippingRate(addressPayload)
Use this method to add user instructions to purchase
const response = await checkoutOrderModel.setUserInstructions("userInstructions")
It allow us to verify payments of the order and the client in process
For this method as input parameter we enter an OTP code in string format
const response = await checkoutOrderModel.verifyPaymentWithOTP("otpCode")
It allow us to verify payments of the order and the client in process
For this method as input parameter we enter an OTP code in string format This method is currently deprecated
Generated using TypeDoc
Will allow us to handle the purchase processing with the following methods get order, get shipping rate, retrieve order process payments, establish billing address, declare your payment method, declare your tokenized card, payment verification, declare credit card, set guest email, get financial institution, apply coupons, remove coupons, get shipping methods, set scheduled date, get fees