JBricks is a game that demonstrates the use of the JSR 229 Payment API. The game itself resembles Breakout or Arkanoid. In JBricks, you can buy another life or a new game level. Behind the scenes, the Payment API handles the details.
To see how JBricks uses the Payment API, choose either Buy Life or Buy Level from the game’s main menu. Next, choose whether you want to buy a single life or three lives for a reduced price.
To view your transactions in the emulator, select View > External Events Generator and click on the Payment Transactions tab. Transactions for this specific instance of the emulator are displayed.
In addition, you can view all transactions passing through the SDK’s payment system. Choose File > Utilities, then select Payment Console. A transaction in the console looks something like the following:
PSP Console running, using phone number +5550001. PSP Server running at https://localhost:-1 Received Payment Request from 127.0.0.1 Credit card issued by: VISA Credit Card type: 0 Credit Card Number: 4111111111111111 Credit Card Holder: Jonathan Knudsen Feature ID: 3_lives Credit Card Verification Number (CCV): 123 Payload: null Response to 127.0.0.1 HTTP/1.1 200 OK Content-Length: 0 Pay-Response: SUCCESSFUL Pay-Timestamp: 1156282954734