Performs the pending resolution process QR Code - Payment List¶
This method must be called to perform the QR Code - Payment List pending resolution.
Methods¶
| Signature | Description |
|---|---|
void resolveQRCodePendencies(QRCodePendenciesRequest request, PaymentCallback paymentCallback) |
Performs the QR Code pending resolution process for the payment list. |
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
request |
QRCodePendenciesRequest |
Yes | Data transfer object that will contain the information from the request for the resolution of pending issues for the QR Code payment list. |
callback |
PaymentCallback |
Yes | Interface that will be executed for notifications of success or error of the pending resolution process for the QR Code payment list. |
Parameter details request (QRCodePendenciesRequest)
| Name | Type | Mandatory | Description |
|---|---|---|---|
applicationId |
Credentials |
Yes | Identification of the application that is requesting the query. |
secretToken |
Credentials |
Yes | Access token of the application requesting the query. |
softwareVersion |
String |
Yes | Version of the application that is requesting the query. |
response
| Name | Type | Description |
|---|---|---|
Value |
BigDecimal |
Payment amount. This is the value that was approved by the acquirer. It must always be validated in the response, even if it has been passed as a parameter, as there are acquirers that, for some situations, approve values different from those requested |
QRType |
QRCodeIntentType |
QR type (sale, cancellation, return). |
appTransactionId |
String |
Integrated transaction identifier. The Identifier referred to is that of the application that originated the payment request. It must not be repeated. |
Date |
String |
Payment date/time. |
qrId |
String |
QrCode identifier generated by the capture terminal. |
Example¶
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.jakewharton.threetenabp.AndroidThreeTen;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
import br.com.phoebus.android.payments.api.ApplicationInfo;
import br.com.phoebus.android.payments.api.Credentials;
import br.com.phoebus.android.payments.api.Payment;
import br.com.phoebus.android.payments.api.PaymentClient;
import br.com.phoebus.android.payments.api.PaymentStatus;
import br.com.phoebus.android.payments.api.provider.PaymentContract;
import br.com.phoebus.android.payments.api.provider.PaymentProviderApi;
import br.com.phoebus.android.payments.api.provider.PaymentProviderRequest;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
Button bt_start;
private PaymentClient paymentClient;
public static final String TEST_APPLICATION_ID = "0";
public static final String TEST_SECRET_TOKEN = "000000000000000000000000";
public static final String TAG = "TAG_DEMO";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bt_start = (Button) this.findViewById(R.id.button);
bt_start.setOnClickListener(this);
paymentClient = new PaymentClient();
AndroidThreeTen.init(getApplication());
}
@Override
public void onClick(View view) {
doExecute();
}
public void doExecute() {
//setting the credentials
Credentials credentials = new Credentials();
credentials.setApplicationId(TEST_APPLICATION_ID);
credentials.setSecretToken(TEST_SECRET_TOKEN);
ApplicationInfo applicationInfo = new ApplicationInfo();
applicationInfo.setCredentials(credentials);
applicationInfo.setSoftwareVersion("1.0");
//creating request object for payment
QRCodePendenciesRequest request = createRequest(applicationInfo);
}
private QRCodePendenciesRequest createRequest(ApplicationInfo appInfo) {
QRCodePendenciesRequest request = new QRCodePendenciesRequest();
request.setApplicationInfo(appInfo);
request.setSecretToken(appInfo.getCredentials());
request.setApplicationId(appInfo.getCredentials());
request.setSoftwareVersion(appInfo.getSoftwareVersion());
return request;
}
}