public static Protos.Payment createPaymentMessage(List<Transaction> transactions,
            @Nullable Coin refundAmount, @Nullable Address refundAddress, @Nullable String memo,
            @Nullable byte[] merchantData) {
        if (refundAddress != null) {
            if (refundAmount == null)
                throw new IllegalArgumentException("Specify refund amount if refund address is specified.");
            return createPaymentMessage(transactions,
                    ImmutableList.of(createPayToAddressOutput(refundAmount, refundAddress)), memo, merchantData);
        } else {
            return createPaymentMessage(transactions, null, memo, merchantData);
        }
    }
public static Protos . Payment createPaymentMessage ( List < Transaction > transactions , @ Nullable Coin refundAmount , @ Nullable Address refundAddress , @ Nullable String memo , @ Nullable byte [ ] merchantData ) { if ( refundAddress != null ) { if ( refundAmount == null ) throw new IllegalArgumentException ( "Specify refund amount if refund address is specified." ) ; return createPaymentMessage ( transactions , ImmutableList . of ( createPayToAddressOutput ( refundAmount , refundAddress ) ) , memo , merchantData ) ; } else { return createPaymentMessage ( transactions , null , memo , merchantData ) ; } }
Create a payment message with one standard pay to address output.

@param transactions one or more transactions that satisfy the requested outputs.
@param refundAmount amount of coins to request as a refund, or null if no refund.
@param refundAddress address to refund coins to
@param memo arbitrary, user readable memo, or null if none
@param merchantData arbitrary merchant data, or null if none
@return created payment message