1

我是 android 开发的新手,我试图将 pay pal 与我的 android 应用程序集成,我已经做到了,但现在我想按月订阅,这意味着当用户第一次注册时它是免费的要注册然后从下个月开始,他需要先在 pay pal 上付款,然后他才能到那里。这是我目前的支付宝付款代码

public class Paypal extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);


   // Intent i = new Intent(this, PaypalExpressCheckout.class);
    //this.startActivity(i);
    invokeSimplePayment();
}


//===============================================================
private void invokeSimplePayment(){

    try{

        PayPalPayment newPayment = new PayPalPayment();
        newPayment.setSubtotal(BigDecimal.valueOf(0.99));
        newPayment.setCurrencyType("USD");
        //.setCurrency("USD");
        newPayment.setRecipient("waleed@balianti.com");
        newPayment.setMerchantName("balianti");

        PayPal pp = PayPal.getInstance();
        if(pp==null)
            pp = PayPal.initWithAppID(this, "APP-80W284485P519543T", PayPal.ENV_SANDBOX);

        Intent paypalIntent = pp.checkout(newPayment, this);
        this.startActivityForResult(paypalIntent, 1);

    }catch(Exception e){e.printStackTrace();}
}

}

请让我知道我做了什么。

4

0 回答 0