Create an instance of the
PPHInvoice class to create an invoice. Set a currency type, add one or more items, and set the tax or other required information:
PPHInvoice *invoice = [[PPHInvoice alloc] initWithCurrency:@"USD"]; [invoice addItemWithId:@"Item" name:@"Purchase" quantity:[NSDecimalNumber one] unitPrice:[NSDecimalNumber one] taxRate:nil taxRateName:nil];
You can also create an invoice by calling the PPHTransactionManager class
beginPayment method. This call creates an invoice and makes the SDK begin watching the card reader for card swipes simultaneously. Your app doesn’t need to save a transaction invoice before it begins watching for card swipes, it can save the invoice in parallel with receiving swipe data. It must save the invoice, though, before it attempts to pay the invoice.
Note: Meet these requirements to set item prices and tax rates:
- Store tax rates as string values, not floating point values.
- Use the following rule for tax rounding: round to the nearest penny (to two digits after the decimal point) at the item level.
Add details about each invoice item on the receipt, if possible.