Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String getCreditPaymentXml(String cardHolder, String cardNum, String cardSec, String cardExp) {
        StringBuffer buffer = new StringBuffer();
        buffer.append("<payment>");
        buffer.append("<type>Credit</type>");
        buffer.append("<cardHolder>" + cardHolder + "</cardHolder>");
        buffer.append("<cardNum>" + cardNum + "</cardNum>");
        buffer.append("<cardSec>" + cardSec + "</cardSec>");
        buffer.append("<cardExp>" + cardExp + "</cardExp>");
        buffer.append("</payment>");

        return buffer.toString();
    }
}