Freeze Card
The card can be frozen using the Freeze card API. The freeze card is a soft block and action can be undone.
Unfreeze card
The card can be unfrozen using the Unfreeze card API. The freeze card is a soft block and action can be undone.
Terminate Card
The card can be terminated using the Terminate card API. Card termination is a hard block and action can’t be undone.
Update card limits
Card limits can be changed using the Update card limits API.
The main limits categories are:
- “purchases” – purchases in POS
- “internetPurchases” – online purchases
- “contactlessPayments” – contactless payments in POS
- “withdrawals” – cash withdrawals from ATM
- “overallLimits” – these limits override all above-mentioned limits. Other limits can’t be higher than “overallLimits”
- “availableAmount” – how much of the limits is still available
- “usedAmount” – how much of the limit is already used
Change PIN (only for ChipAndPin)
Card PIN can be changed using Change card PIN API. New PIN must be encrypted using provided permanent public RSA key (to be requested from ConnectPay representative). For changes to take effect one successful operation is required in POS or ATM. We recommend always using ATMs as not all POS support change PIN functionality.
Sample Program to encrypt PIN:
package com.connectpay.card.crypto.utils;
import java.nio.charset.StandardCharsets;
import java.security.KeyFactory;
import java.security.PublicKey;
import java.security.spec.MGF1ParameterSpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Base64;
import javax.crypto.Cipher;
import javax.crypto.spec.OAEPParameterSpec;
import javax.crypto.spec.PSource;
public class EncryptionProcess {
public static void main(String[] args) throws Exception {
// Create a KeyFactory instance with RSA algorithm
KeyFactory kf = KeyFactory.getInstance("RSA");
// Need to use different Public key string for PROD and NONPROD
String pubString = "publicKeyProvidedByConnectPayRepresentative";
// Decode the public key string from Base64
byte[] encodedPubKey = Base64.getDecoder().decode(pubString.getBytes(StandardCharsets.US_ASCII));
// Create an X509EncodedKeySpec with the decoded public key bytes
X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encodedPubKey);
// Generate the PublicKey object from the key spec
PublicKey publicKey = kf.generatePublic(keySpec);
// Generate the PIN to be encrypted
String pinToEncrypt = "9825";
// Encryption
Cipher encryptCipher = Cipher.getInstance("RSA/ECB/OAEPPadding");
// Specify the OAEP parameters (PIN, CVV2, CardNumber)
OAEPParameterSpec oaepParams = new OAEPParameterSpec("SHA-256", "MGF1", new MGF1ParameterSpec("SHA-256"),
new PSource.PSpecified("PIN".getBytes(StandardCharsets.US_ASCII)));
// Initialize the encryption cipher with the public key and OAEP parameters
encryptCipher.init(Cipher.ENCRYPT_MODE, publicKey, oaepParams);
// Encrypt the PIN
byte[] encryptedPin = encryptCipher.doFinal(pinToEncrypt.getBytes(StandardCharsets.UTF_8));
// Encode the encrypted PIN in Base64 and format the message
String encodeToString = Base64.getEncoder().encodeToString(encryptedPin);
System.out.println("EncodeToString: " + encodeToString);
String encryptedPinBase64 = "-----BEGIN PIN MESSAGE-----\n" + encodeToString + "\n-----END PIN MESSAGE-----";
// Print the Base64 encoded encrypted PIN
System.out.println("encryptedPin:" + Base64.getEncoder().encodeToString(encryptedPinBase64.getBytes()));
}
}Update Card Security settings
Card security settings can be changed using the Update card security settings API. The main categories are:
- “contactlessPayments” – contactless payments are on/off
- “withdrawals” – withdrawals are on/off
- “internetPurchases” – internet purchases are on/off
- “overallPurchases” – if the overall purchases setting is on, then “overallLimits” will apply. Please check Update card limits API
Update Card 3DS security settings
Card 3DS security settings should be updated using the Update Card 3DS security settings API. The settings should be set to allow internet purchases. APIs is used to update values and set values initially.
The password must be 8–36 characters long and may contain uppercase letters (A–Z), lowercase letters (a–z), digits (0–9), and the following special characters: ! " # : ; ? * ( ) + = / \ , . [ ] { }; spaces are not allowed.