Android™ PiConnect - Cloud: Get Credit Sale

Back to Index

Get a Credit Sale

Documentation: https://api-cloud.piconnect.io/#a8f66051-d98a-c0e4-b4ec-f341cdc9c7a9

CURL Command

curl --request GET \
  --url 'https://pipay.io/piconnect/cloud?method=creditsale&account=1512407959&sn=31415926&cloud=app&amount=21.03&ticketid=R212203&userid=Cristy'

Android™ Example

// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    CkRest rest = new CkRest();
    boolean success;

    //  URL: https://pipay.io/piconnect/cloud?method=creditsale&account=1512407959&sn=31415926&cloud=app&amount=21.03&ticketid=R212203&userid=Cristy
    boolean bTls = true;
    int port = 443;
    boolean bAutoReconnect = true;
    success = rest.Connect("pipay.io",port,bTls,bAutoReconnect);
    if (success != true) {
        Log.i(TAG, "ConnectFailReason: " + String.valueOf(rest.get_ConnectFailReason()));
        Log.i(TAG, rest.lastErrorText());
        return;
        }

    CkStringBuilder sbResponseBody = new CkStringBuilder();
    success = rest.FullRequestNoBodySb("GET","/piconnect/cloud?method=creditsale&account=1512407959&sn=31415926&cloud=app&amount=21.03&ticketid=R212203&userid=Cristy",sbResponseBody);
    if (success != true) {
        Log.i(TAG, rest.lastErrorText());
        return;
        }


  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}