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 PTKPaymentInvoice.

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.

if (invoice.authorizationRequired) {
	// prompt user for their passcode
	PTKPaymentManager *paymentManager = [PTKPaymentManager sharedManager];
	[paymentManager authorizeForInvoice:invoice passcode:passcode completion:^(NSError *error) {
		if (!error) {
			// Invoice has been authorized
		}
	}];
}

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.paymentInstrument.isCvvRequired;

A PTKPayment 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 PTKPaymentDetails using the CVV:
PTKPaymentDetails *paymentDetails = [PTKPaymentDetails paymentDetailsWithCvv:@"123"];
  1. Use the PTKPaymentManager to pay for the invoice:
[paymentManager payForInvoice:invoice paymentDetails:paymentDetails completion:^(PTKPayment *payment, NSError *error) {
	if (!error) {
		// Payment contains information such as the PowaTag payment ID, Merchant payment ID and the invoice that was paid for
		NSArray<PTKCoupon> coupons = payment.triggeredCoupons;
		// Display coupons to user.
	}
}];

Paying for an Invoice Without CVV

  1. Use the PTKPaymentManager to pay for the invoice:
[paymentManager payForInvoice:invoice completion:^(PTKPayment *payment, NSError *error) {
	if (!error) {
		// Payment contains information such as the PowaTag payment ID, Merchant payment ID and the invoice that was paid for
		NSArray<PTKCoupon> coupons = payment.triggeredCoupons;
		// Display coupons to user.
	}
}];