The Bidco user profile stores all the personal, address and payment details of the user.

There are two types of user profiles:

  • Temporary: Which lets you build a frictionless Bidco experience by allowing guest users to make payments without requiring a Bidco account.
  • Permanent: A profile that exists on the Bidco server which allows a user to log into the same profile at a later time or on another device.

The ProfileManager is used used to retrieve and modify profiles in the following ways:



Note: For those using RxJava, all the methods described below are available in the RxProfileManager


Retrieving the Current User's Profile Information

  1. The profile of the currently authenticated user's, which reflects any successful modifications, can be retrieved using the ManagerFactory:
ProfileManager profileManager = ManagerFactory.getInstance().getProfileManager();
Profile profile = profileManager.getCurrentProfile();
  1. Get the list of addresses currently added to the profile with:
List<Address> addresses = profile.getAddresses();
  1. Get the default address with:
Address address = profile.getDefaultAddress();
  1. Get the list of payment instruments currently added to the profile with:
List<PaymentInstrument> paymentInstruments = profile.getPaymentInstruments();
  1. Get the default payment instrument with:
PaymentInstrument paymentInstrument = profile.getDefaultPaymentInstrument();
  1. Get the device ID associated with the profile:
String deviceId = profile.getDeviceId();
  1. Get the profile ID with:
String profileId = profile.getProfileId();
  1. Check if the user profile is active and can be used:
boolean activeProfile = profile.isActive();
  1. Get a list of any custom data keys attached to the profile:
List<CustomDataValue> customDataValues = profile.getCustomDataValues();

Adding an Address

For more information on displaying addresses see Addresses.

  1. Create a new AddressDetails object and set the address information:
AddressDetails addressDetails = new AddressDetails(Country.UNITED_KINGDOM);
addressDetails.setAlias("Address");
addressDetails.setFirstName("Joe");
addressDetails.setLastName("Bloggs");
addressDetails.setLine1("10 Bloombury Way");
addressDetails.setCity("London");
addressDetails.setPostCode("WC1A 2SL");
addressDetails.setCounty("London");

  1. Validate the address details

Use AddressDetailsValidator to verify that all address details have been entered correctly.

AddressDetailsValidator addressDetailsValidator = new AddressDetailsValidator();
List<ValidationFailure> errors = addressDetailsValidator.validate(addressDetails);
if (errors != null) {
	for (int s = 0; s < errors.size(); s++) {
		ValidationFailure validationFailure = errors.get(s);
		String property = validationFailure.getPropertyName();
		ValidationError errorCode = validationFailure.getErrorCode();
		// Display validation to user and obtain updated value
	}
} else {
	// No issues found while validating the address details
}

For more information on validators please see the Validators page.


  1. Add the address to the user profile using the ProfileManager:
profileManager.addAddress(address, new PowaTagCallback<Address>() {
	public void onSuccess(Address addedAddress) {
		// Address was successfully added
	}
	public void onError(PowaTagException exception) {
	}
});

Updating an Address

  1. Create an AddressDetails object from an existing Address and modify the address information:
Address originalAddress = profile.getDefaultAddress();
AddressDetails modifiedAddress = originalAddress.editableCopy();
modifiedAddress.setAlias("Work Address");

  1. Validate the address details

Use the AddressDetailsValidator to validate the address details as described in step 2 of Adding an Address


  1. Use the ProfileManager to update the address information:
profileManager.updateAddress(originalAddress, modifiedAddress, new PowaTagCallback<Address>() {
	public void onSuccess(Address updatedAddress) {
		// Address was successfully updated
	}
	public void onError(PowaTagException exception) {
	}
});

Deleting an Address

  1. Use the ProfileManager to delete an existing address:
profileManager.deleteAddress(address, new PowaTagCallback<Profile>() {
	public void onSuccess(Profile updatedProfile) {
		// Address was successfully deleted from profile
	}
	public void onError(PowaTagException exception) {
	}
});

Adding a Payment Instrument

  1. Create a new PaymentMethodDetails object to store the card information:
PaymentMethodDetails paymentMethodDetails = new PaymentMethodDetails();
paymentMethodDetails.setCardHolderFirstName("Joe");
paymentMethodDetails.setCardHolderFirstName("Bloggs");
paymentMethodDetails.setCardNumber("4111111111111111");
paymentMethodDetails.setValidFromDate(new YearMonth(2015, 7));
paymentMethodDetails.setExpiryDate(new YearMonth(2019, 1));

  1. Validate the payment method details

Use PaymentMethodDetailsValidator to verify that all payment method details have been entered correctly.

PaymentMethodDetailsValidator paymentMethodDetailsValidator = new PaymentMethodDetailsValidator();
List<ValidationFailure> errors = paymentMethodDetailsValidator.validate(paymentMethodDetails);
if (errors != null) {
	for (int s = 0; s < errors.size(); s++) {
		ValidationFailure validationFailure = errors.get(s);
		String property = validationFailure.getPropertyName();
		ValidationError errorCode = validationFailure.getErrorCode();
		// Display validation to user and obtain an updated value
	}
} else {
	// No issues found while validating the payment details
}

For more information on validators please see the Validators page.


  1. Create a new PaymentInstrumentDetails object and set the payment method, billing address and other information:
PaymentInstrumentDetails paymentInstrumentDetails = new PaymentInstrumentDetails();  
paymentInstrumentDetails.setPaymentMethodDetails(paymentMethodDetails);
paymentInstrumentDetails.setIssuer(CreditCardIssuer.VISA);
paymentInstrumentDetails.setPaymentType(PaymentType.PAYMENT_CARD);
paymentInstrumentDetails.setPhone("01234567890");
paymentInstrumentDetails.setEmail("customer@email.com");
paymentInstrumentDetails.setBillingAddress(address);

  1. Add the payment instrument to the user profile using the ProfileManager:
profileManager.addPaymentInstrument(paymentInstrument, new PowaTagCallback<PaymentInstrument>() {
	public void onSuccess(PaymentInstrument addedPaymentInstrument) {
		// Payment instrument was successfully added
	}
	public void onError(PowaTagException exception) {
	}
});

  1. If the payment instrument needs to be activated, send an activation code to the user.
// Check whether the payment instrument requires activation
if (paymentInstrument.getActivationStatus() != ActivationStatus.NOT_REQUIRED) {
	profileManager.sendActivationCode(paymentInstrument);
}

The activation code is sent to the user's mobile number.


  1. The user inputs the activation code and you activate the payment instrument.
profileManager.activatePaymentInstrument(activationCode, paymentInstrument);

The new payment instrument is now available in the current profile.


Updating a Payment Instrument

Only the billing address of a payment instrument may be modifed.

  1. Use the ProfileManager to update the billing address of a payment instrument:
profileManager.updatePaymentInstrument(paymentInstrument, newBillingAddress, new PowaTagCallback<PaymentInstrument>() {
	public void onSuccess(PaymentInstrument updatedPaymentInstrument) {
		// Payment instrument was successfully updated
	}
	public void onError(PowaTagException exception) {
	}
});

Deleting a Payment Instrument

  1. Use the ProfileManager to delete an existing payment instrument:
profileManager.deletePaymentInstrument(paymentInstrument, new PowaTagCallback<Profile>() {
	public void onSuccess(Profile updatedProfile) {
		// Payment instrument was successfully deleted from profile
	}
	public void onError(PowaTagException exception) {
	}
});

Getting the Payment Instruments Accepted by a Merchant

  1. To obtain the list of payment instruments from the user profile that are accepted by a specified Merchant:
List<PaymentInstrument> acceptedPaymentInstruments = profileManager.getAcceptedPaymentInstruments(merchant);

In the case where the profile does not contain any accepted payment instruments an empty List is returned.


Checking the Profile Against a Merchant's Requirements

  1. Before transacting with a merchant you should check if the profile contains all the information required for the merchant.
boolean canTransact = profile.hasRequiredInfo(merchant);

Storing a passcode

  1. A passcode is set as a security measure to ensure that the user is the only one that can authorize payments or make changes to the profile.
profileManager.setPassCode(passcodeEditText.getText().toString(), passwordEditText.getText().toString(), new PowaTagCallback<Void>) {
	public void onSuccess(Void result) {
		// the passcode has been set
	}
	public void onError(PowaTagException exception) {
	}
}

Updating the Profile

  1. Create a new ProfileDetails object and set the profile information:
ProfileDetails profileDetails = new ProfileDetails();
profileDetails.setTitle(Title.M);
profileDetails.setFirstName("Joe");
profileDetails.setLastName("Bloggs");
profileDetails.setEmail("jbloggs@email.com");
profileDetails.setMobileNumber("01233355555");
profileDetails.setGender(profile.getGender());
profileDetails.setDateOfBirth(profile.getDateOfBirth());
profileDetails.setPhoneAreaCode(profile.getPhoneAreaCode());
profileDetails.setDefaultAddress(profile.getDefaultAddress());
profileDetails.setDefaultPaymentInstrument(profile.getDefaultPaymentInstrument());
profileDetails.setCustomDataValues(profile.getCustomDataValues());

  1. Validate the profile details

Use ProfileDetailsValidator to verify that all profile details have been entered correctly.

ProfileDetailsValidator profileDetailsValidator = new ProfileDetailsValidator(input.getCountry().getAlpha2code());
List<ValidationFailure> errors = profileDetailsValidator.validate(profileDetails);
if (errors != null) {
	for (int s = 0; s < errors.size(); s++) {
		ValidationFailure validationFailure = errors.get(s);
		String property = validationFailure.getPropertyName();
		ValidationError errorCode = validationFailure.getErrorCode();
		// Display validation to user and obtain an updated value
	}
} else {
	// No issues found while validating the profile details
}

  1. Use the ProfileManager to update the current profile:
profileManager.updateProfile(profileDetails, new PowaTagCallback<Profile>) {
	public void onSuccess(Profile updatedProfile) {
		// Profile information is updated
	}
	public void onError(PowaTagException exception) {
	}
}

  1. The updated profile information will be reflected in the user's current profile:
Profile profile = profileManager.getCurrentProfile();

Saving the Profile

Saving a guest profile to the Bidco server allows the user to log into the profile at a later time or on another device.
The saveProfile method returns a set of coupons that the user can redeem on future purchases. The coupons are automatically saved to the user's profile but returned here so they can be displayed to the user.


  1. Populate the SignUpDetails with the user credentials

You can use the user ID from your App as the identifier for the Bidco profile:

SignUpDetails signUpDetails = new SignUpDetails(hostAppUserId ,passwordEditText.getText().toString());

If you would rather use the Bidco profileId as the identifier:

SignUpDetails signUpDetails = new SignUpDetails(passwordEditText.getText().toString());

  1. Save the temporary profile
profileManager.saveProfile(signUpDetails, new PowaTagCallback<List<Coupon>>() {
	public void onSuccess(@Nullable List<Coupon> registrationCoupons) {
		// Profile is now permanent. 
		// Display returned coupons to user
	}
	public void onError(PowaTagException exception) {
	}
}

The synchronous version of the saveProfile method should not be used in the main thread to avoid performance issues.