Import the Module

Import agent checkout into your app

import co.tradedepot.shop.sdk.checkout.Checkout;
import co.tradedepot.shop.sdk.checkout.Registration;
import shopAgent from 'react-native-agent-checkout';

Register a ShopTopUp Buyer

This is to register an agent

Registration registration = Registration.Builder.create()
               .agentId("MyAgentId")
               .firstName("My First Name")
               .lastName("My Last Name")
               .phoneNumber("08099447050")
               .countryCode("NG")
               .company("Chibuzor Enterprises")
               .address("plot 259, etim iyang crescent, Victoria Island Lagos").build();
               Checkout.registerAgent(registration);
shopAgent.registerAgent({
  // Pre-defined user attributes
  agentId: 'fhj50tgoonoo',
  firstName: 'chisom',
  lastName: 'onwuegbuzie',
  phoneNumber: '+2348066379681',
  countryCode: 'NG',
  company: 'Goldtek Ventures',
  latitude: 3.134555,
  longitude: 3.058585,
  address: '259 etim inyang crescent'
});

Open Cart

This is to open a view which will allow you to place orders

checkout.openCart();
shopAgent.openCart();

Open Transaction

This is to view all orders made by the agent for the user

checkout.openTransactions()
shopAgent.openTransaction();

What’s Next