Skip to content

Instantly share code, notes, and snippets.

@ngangavic
Created June 17, 2020 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngangavic/35eda7ff62c9022e363ed6497f2e0373 to your computer and use it in GitHub Desktop.
Save ngangavic/35eda7ff62c9022e363ed6497f2e0373 to your computer and use it in GitHub Desktop.
Africas Talking Check Transaction
package africastalking;
import com.africastalking.AfricasTalking;
import com.africastalking.PaymentService;
import com.africastalking.payment.Transaction;
import com.africastalking.payment.response.CheckoutResponse;
public class CheckTransaction {
public static void main(String[] args) {
/* Set your app credentials */
String USERNAME = Secrets.username;
String API_KEY = Secrets.apiKey;
/* Initialize SDK */
AfricasTalking.initialize(USERNAME, API_KEY);
/* Get the payments service */
PaymentService payment = AfricasTalking.getService(AfricasTalking.SERVICE_PAYMENT);
try {
Transaction response = payment.findTransaction("ATPid_3fed67fdf305772b75608c4ab87cb655");
System.out.println(response.toString());
} catch(Exception ex) {
ex.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment