SubmitRtps

Definition

BreadPayments.submitRtps(rtpsConfig: UnifiedRtpsConfig): void;

Example

// Helper function to log all events and data callback during development
BreadPayments.on('CARD:*', function(data) {
  console.log(this.event, data);
});

// Called once before calling submitRTPS
BreadPayments.setup({
  loyaltyID: 'xxxxxx', 
  env: 'STAGE', 
  storeNumber: '1234567', // replace with actual value from ADS
  buyer: {
    givenName: 'Jack',
    familyName: 'Seamus', additionalName: 'C.', birthDate: '1974-08-21',
    email: '[email protected]',
    phone: '+13235323423',
    billingAddress: {
      address1: '323 something lane', address2: 'apt. B',
      country: 'USA',
      locality: 'NYC',
      region: 'NY',
      postalCode: '11222',
    },
  },
});
BreadPayments.submitRtps({
  financingType: 'card',
  locationType: 'checkout', // homepage, landing, search, product, category, banner, checkout cart 
  // If you want to mock out the rtps flow use the following
  mockResponse: 'success', // 'success', 'noHit', 'makeOffer', 'ackknowledge', 'existingAccount', 'existingOffer', 'newOffer', 'error';
});

Related

UnifiedRtpsConfig