Skip to content

Instantly share code, notes, and snippets.

@SeraphimSerapis
Created November 19, 2012 15:54
Show Gist options
  • Save SeraphimSerapis/4111417 to your computer and use it in GitHub Desktop.
Save SeraphimSerapis/4111417 to your computer and use it in GitHub Desktop.
Initializes the PayPal MPL
private void initLibrary() {
new Thread() {
@Override
public void run() {
pp = PayPal.getInstance();
if (pp == null) {
pp = PayPal.initWithAppID(context, "APP-80W284485P519543T",
PayPal.ENV_SANDBOX);
}
final CheckoutButton button = pp.getCheckoutButton(context,
PayPal.BUTTON_294x45, CheckoutButton.TEXT_PAY);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
initPayment();
}
});
handler.post(new Runnable() {
@Override
public void run() {
rootLayout.addView(button);
}
});
}
}.start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment