lib/WalletManager.php
/*
     * Get an integrated address from wallet address and a payment id
     *
     * @param string A 109 hex character wallet address
     * @param string An 8 byte hex string to use as a payment id
     */
Get an integrated address from wallet address and a payment id
@param string A 109 hex character wallet address
@param string An 8 byte hex string to use as a payment id
Get an integrated address from wallet address and a payment id @param string A 109 hex character wallet address @param string An 8 byte hex string to use as a payment id
public function integrated_encode_address($address, $payment_id = null)
    {
        if (strlen($address) !== 98) {
            throw new Exception('Error: Invalid wallet address length');
        }
        if (empty($payment_id)) {
            $payment_id = $this->generate_payment_id($this->payment_id_length_integrated);
        }
        if (strlen($payment_id) !== $this->payment_id_length_integrated) {
            throw new Exception('Error: Invalid integrated payment id length');
        }
        $keys = $this->decode_address($address);
        return $this->integrated_encode($keys['spendKey'], $keys['viewKey'], $payment_id);
    }
public function integrated_encode_address ( $ address , $ payment_id = null ) { if ( strlen ( $ address ) !== 98 ) { throw new Exception ( 'Error: Invalid wallet address length' ) ; } if ( empty ( $ payment_id ) ) { $ payment_id = $ this -> generate_payment_id ( $ this -> payment_id_length_integrated ) ; } if ( strlen ( $ payment_id ) !== $ this -> payment_id_length_integrated ) { throw new Exception ( 'Error: Invalid integrated payment id length' ) ; } $ keys = $ this -> decode_address ( $ address ) ; return $ this -> integrated_encode ( $ keys [ 'spendKey' ] , $ keys [ 'viewKey' ] , $ payment_id ) ; }
Get an integrated address from wallet address and a payment id
 @param string A 109 hex character wallet address
 @param string An 8 byte hex string to use as a payment id
Get an integrated address from wallet address and a payment id @param string A 109 hex character wallet address @param string An 8 byte hex string to use as a payment id
// Validate wallet address length. // Generate payment id if required. // Validate payment id length. // Get the public keys from the wallet address.