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 initParallelPayment() { | |
PayPalReceiverDetails receiver0 = new PayPalReceiverDetails(); | |
PayPalReceiverDetails receiver1 = new PayPalReceiverDetails(); | |
// Setup additional information | |
PayPalAdvancedPayment payment = new PayPalAdvancedPayment(); | |
payment.setCurrencyType("EUR"); | |
payment.getReceivers().add(receiver0); | |
payment.getReceivers().add(receiver1); | |
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 initChainedPayment() { | |
PayPalReceiverDetails receiver0 = new PayPalReceiverDetails(); | |
PayPalReceiverDetails receiver1 = new PayPalReceiverDetails(); | |
PayPalReceiverDetails receiver2 = new PayPalReceiverDetails(); | |
receiver0.setIsPrimary(true); | |
// Setup additional information | |
PayPalAdvancedPayment payment = new PayPalAdvancedPayment(); | |
payment.setCurrencyType("EUR"); | |
payment.getReceivers().add(receiver0); |
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, |
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
public void onActivityResult(int requestCode, int resultCode, Intent data) { | |
if (requestCode == REQUEST_PAY) { | |
switch (resultCode) { | |
case RESULT_OK: | |
String payKey = data | |
.getStringExtra(PayPalActivity.EXTRA_PAY_KEY); | |
showToast("Payment succeeded - Key: " + payKey); | |
break; | |
case RESULT_CANCELED: | |
showToast("Payment got canceled"); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Adaptive Payments</title> | |
</head> | |
<body> | |
<p>This example uses parallel payments:</p> | |
<?php | |
// Include the needed files |
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
<?php | |
/**************************************************** | |
web_constants.php | |
Define constants used by web pages in this file | |
****************************************************/ | |
/* Define the PayPal URL. This is the URL that the buyer is | |
first sent to to authorize payment with their paypal account | |
change the URL depending if you are testing on the sandbox | |
or going to the live PayPal site |
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
paypalhere://takePayment? | |
acceped=cash,card,paypal // optional | |
&returnUrl=your app’s callback | |
&as=b64 // optional | |
&step=choosePayment | |
&payerPhone=the payer’s phone number // optional | |
&invoice=your invoice as JSON (encoded) |
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
yourScheme://yourHost/?{result} | |
?Type={Type} | |
&InvoiceId={InvoiceId} | |
&Tip={Tip} | |
&Email={Email} | |
&TxId={TxId} |
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
{ | |
"merchantEmail": "[email protected]", | |
"itemList": { | |
"item": [ | |
{ | |
"name": "Name", | |
"description": "An item", | |
"quantity": "2.0", | |
"unitPrice": "10.0", | |
"taxName": "Tax", |
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
require 'paypal-sdk-rest' | |
require 'sinatra' | |
include PayPal::SDK::REST | |
get '/verify/:payment_id/:total/:currency' do | |
payment_id = params[:payment_id] | |
total = params[:total] | |
currency = params[:currency] | |
OlderNewer