Paiement PayPal avec Android
Je veux utiliser un module de payment PayPal dans mon application Android. J'ai cherché des tutoriel qui peut m'aider voilà un https://cms.paypal.com/cms_content/U...ce_Android.pdf
j'ai essayé de poursuivre ses etapes de le debut. le premier etape est d'affiché le button PayPal déjà faite. Mais dans le code de clique sur le button j 'ai mais le code suivant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
PayPalPayment newPayment = new PayPalPayment();
Log.d("hh", "hh1");
BigDecimal a = new BigDecimal(10);
newPayment.setSubtotal(a);
Log.d("hh", "hh2");
newPayment.setCurrencyType("USD");
Log.d("hh", "hh3");
newPayment.setRecipient("younestlili5001@gmail.com");
Log.d("hh", "hh4");
newPayment.setMerchantName("My Company");
Log.d("hh", "hh5");
Intent paypalIntent = PayPal.getInstance().checkout(newPayment, this);
Log.d("hh", "hh6");
this.startActivityForResult(paypalIntent, 1);
Log.d("hh", "hh7");
} |
// les log juste pour connaitre s'il y a des erreurs
l'application se bloque
le premier code est
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.payer);
PayPal ppObj = PayPal.initWithAppID(this.getBaseContext(), "APP-80W284485P519543T", PayPal.ENV_SANDBOX);
CheckoutButton launchPayPalButton = ppObj.getCheckoutButton(this, PayPal.BUTTON_278x43, CheckoutButton.TEXT_PAY);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
params.bottomMargin = 10;
launchPayPalButton.setLayoutParams(params);
launchPayPalButton.setOnClickListener(this);
((RelativeLayout)findViewById(R.id.relativeLayout1)).addView(launchPayPalButton); |
Quelqu'un peut m'aider ?
merci