Created
November 19, 2012 15:54
-
-
Save SeraphimSerapis/4111417 to your computer and use it in GitHub Desktop.
Initializes the PayPal MPL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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