The Bidco SDK provides the mechanism to allow a users to pay for their selected goods and services.

Before a payment can be made, an invoice must exist:

  • See Baskets for how to create a PaymentInvoice.

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


Authorizing an Invoice

Depending on thresholds set by the merchant, an invoice may require authorization from the end user before payment can be made. The user provides authorization by entering their passcode.

PaymentManager paymentManager = ManagerFactory.getInstance().getPaymentManager();
if (invoice.isAuthorizationRequired()) {
	// prompt user for their passcode
	paymentManager.authorize(invoice, passcodeEditText.getText().toString(), new PowaTagCallback<Void>() {
		@Override
		public void onSuccess(@Nullable Void aVoid) {
			// invoice has been authorized.
		}
			
		@Override
		public void onError(@NonNull PowaTagException e) {
		}
	});
}

Paying for an Invoice

The invoice has been authorized and payment can now be made.

To check if CVV is required for the payment:

invoice.getPaymentInstrument().isCvvRequired();

A Payment object is returned after successful payment which contains:

  • Bidco Transaction ID: This ID is used to retrieve transaction information.
  • Merchant Payment ID The merchant's payment reference.
  • Triggered Coupons: Returns a set of coupons that the user can redeem on future purchases.
  • Payment Date: The payment date.

Paying using the CVV

  1. Create PaymentDetails using the CVV:
PaymentDetails paymentDetails = new PaymentDetails("123");
  1. Use the PaymentManager to pay for the invoice:
PaymentManager paymentManager = ManagerFactory.getInstance().getPaymentManager();
paymentManager.pay(invoice, paymentDetails, new PowaTagCallback<Payment>() {
	public void onSuccess(Payment payment) {
		// payment contains information such as the Bidco payment ID, Merchant payment ID, invoice and a possible list of triggered coupons.
		Set<Coupons> triggeredCoupons = payment.getCoupons();
		//display coupons to user.
	}
	public void onError(PowaTagException exception) {
	}
});

Paying for an Invoice Without CVV

  1. Use the PaymentManager to pay for the invoice:
paymentManager.pay(invoice, new PowaTagCallback<Payment>() {
public void onSuccess(Payment payment) {
	// payment contains information such as the Bidco payment ID, Merchant payment ID, invoice and a possible list of triggered coupons.
	Set<Coupons> triggeredCoupons = payment.getCoupons();
	//display coupons to user.
}
public void onError(PowaTagException exception) {
}