Use this utility to integrate Yo! Payments APIs in your Java Code. Follow the procedure below to test this code with your own Yo! Payments credentials. To generate RSA keys, follow the guide in chapter 4.2 of the main API documentation.
- Clone this source code.
- Put your keys under ./target/keys. Then, make sure you set your key variables to the right path.
- The main method is in YoPaymentsSample.java.
- To test acwithdrawfunds method, in main method, un comment a line which has: //testWithdawRequest();
- To test normal verification, in main method, uncomment the line which has: //normalVerification();
- To test secondary verification, in main method, uncomment //secondaryVerification(); The Secondary verification uses a different public key.
- Test other aspects like Bulk payments, Bulk Payments Check status and other parts as per the examples commented in there.
After Successful compilation, run and you should see similar output as below:
Status: OK StatusCode: 0 StatusMessage: ErrorMessage: TransactionStatus: SUCCEEDED TransactionReference: q1XYY4fpvCxQFHeIMwZ0isNzC3oIzBbr194cOT2ksdOxmvaXLyJYIDfprArr0vzK9d7ab0af314d6f475272cecf1b2cf246 NetworkReferenceId: 348086079
URL http://sandbox.yo.co.ug/services/yopaymentsdev/task.php
Status 200
Request Headers Content-transfer-encoding: text Content-Type: text/xml
Request Data
90003066053do9t-IqUe-FxJW-IgUI-NV1E-fDee-YhOQ-iikQacwithdrawfunds500256783086794Java SampleR1004-758722264-113416455MUHqKEJ+LtM4fIn6pDv7WLxYau7TOFpVjzahvrHkS0HDlJ40WqfkEirqAGF46XZC5kXUaLf1TTJVQHJ5uU+iS5jhS2s5ZWLIEGdPVNMHA2IK4+8kNnBb+/ySFg9vquzxdwnPif8fLnlEYHxfl/hRz5J6WxNI0pXV25bPT3m0MumJhT2zP+TsZwHzPjQZGW7rDG8/Pic/BRvwuzTtBQXhnl7LK2iw+qPRBFl0mmeYFwX4S5ctlMCMlrCwftAJaWEo8PYzUJpilHhm3hZBYF+ZiTkufu8ePyXebDkmhLF6lSADxWenFmtIopFMfZQx9QmXjjX+WfaQaa50UJAnqaTlSA==Respoonse Headers Cache-Control: no-cache Server: Apache/2.2.3 (Red Hat) Connection: close Pragma: no-cache Expires: Tue, 12 Mar 1910 10:45:00 GMT Content-Length: 382 Content-transfer-encoding: text Date: Fri, 22 May 2020 18:08:59 GMT Content-Type: text/xml;charset=UTF-8 X-Powered-By: PHP/5.6.30
Respones Data
OK0SUCCEEDEDq1XYY4fpvCxQFHeIMwZ0isNzC3oIzBbr194cOT2ksdOxmvaXLyJYIDfprArr0vzK9d7ab0af314d6f475272cecf1b2cf246348086079Error Message