public class MyPayment {
private String intent;
private MyRedirect redirect_urls;
private MyPayer payer;
private List<MyTrans> transactions;
public MyPayment(String intent, MyRedirect redirect_urls, MyPayer payer, List<MyTrans> transactions) {
this.intent = intent;
this.redirect_urls = redirect_urls;
this.payer = payer;
this.transactions = transactions;
}
}
公共类 MyRedirect {
private String return_url;
private String cancel_url;
public MyRedirect(String return_url, String cancel_url) {
this.return_url = return_url;
this.cancel_url = cancel_url;
}
}
公共类 MyPayer {
私有字符串支付方式;
public MyPayer(String payment_method) {
this.payment_method = payment_method;
}
}
公共类 MyTrans {
私人 MyAmount 金额;
public MyTrans(MyAmount amount) {
this.amount = amount;
}
}
公共类 MyAmount {
private String total;
private String currency;
public MyAmount(String total, String currency) {
this.total = total;
this.currency = currency;
}
}
MyRedirect redi = new MyRedirect("http://example.com/your_redirect_url.html","http://example.com/your_cancel_url.html");
MyPayer mypay = new MyPayer("paypal");
List<MyTrans> transs = new ArrayList<MyTrans>();
MyAmount myamo = new MyAmount("6.70","USD");
MyTrans transact = new MyTrans(myamo);
transs.add(transact);
MyPayment mypayment = new MyPayment("sale",redi,mypay,transs);