Académique Documents
Professionnel Documents
Culture Documents
Video Tutorials
Home
Ubuntu
PDF's
PPT's
Android Training
My Apps
Follow by Email
Email address...
Submit
Popular Posts
Create Your Own Custom
Keyboard for Android Devices
In this post i Created Simple
Keyboard which contains Some
special keys like ( France keys
) and it's supported Ca...
How to call Android contacts
list?
Hi this is very import concept to
Read Existing Contacts from
Your Emulator or Device There
are three steps to this process.
1) Permissions ...
PayPal intigration in Android
If our app has payment option then only one
thing can help us and that is paypal .Actually
working with payment system is li...
How Create Pie Chart In Android
In Genearl Graphs Play very
important role , but in android
we don't have any Graphs
related API . But with the help
of general andro...
OutOfMemory exception when decoding with
BitmapFactory
Google Android, Memory, and Bitmaps
Working on mobile devices forces one to make
conscious decisions regarding coding choices,
if for...
Solve the Debug certificate expired on error
message , Android Error: Error generating final
archive: Debug certificate expired on
long ago i tried to run my running suddenly it
showed error , but i didn't find any error in my
source code in java & XML also , T...
How to send Post data to PHP server in
android
public boolean PostData() { try { // creating
default Client HttpClient mClient = new
DefaultHttpClient(); // Connect URL ...
Android Interview Questions And Answers
What is android? Android is a stack of
software for mobile devices which has
Operating System, middleware and some key
appli...
How To Drag and Rotate Image
Using TouchEvent in Android
here i used two imageviews, one
is for Rotation another one is for
Drag classes : ===== main.xml
Tangram11.java main.xnml -------
and make acco unt .Fo r verificat io n ,paypal send yo u mail aft er verify it will be
act ivat ed in sanbo x enviro nment
-------...
no t wo rk fo r live paypal and it is reco mmended t hat yo u sho uld no t use any real info
in sanbo x enviro nment .
Time
creat e o ne perso nal and o ne Business acco unt fo r t est ing t ransact io n
aft er creat ing t wo acco unt , it will sho w bo t h acco unt 's info rmat io n
fo r perso nal acco unt id is so met hing like t his
==>> hello xyz_1300948766_per@gmail.co m
fo r business acco unt id is so met hing like t his
==>> hello xyz22_1300937866_biz@gmail.co m
here '_per' means perso nal acco unt and '_biz' means business acco unt
no w i ho pe yo u have creat ed t wo acco unt ....let s mo ve t o seco nd t ask
but here we will do some modification in code ...like we will add receipt
name .
so first understand how this library works ........
initWithAppID Method
The initWithAppID method creates and returns the PayPal object. You must pass in the
context and the unique application ID (appID) that PayPal has provided. You can choose
whether to use the live or sandbox server, or use non-networked (Demo) mode (see
below).
Total Pageviews
19 65 2 2
hungry Fishes
Followers
Join this site
w ith Google Friend Connect
payment flows without requiring production or test accounts on PayPal servers. Network
calls within the library are simulated by using demonstration data held within the
library.
getCheckoutButton Method
You must get the Pay with
PayPal payment button from the Mobile Payments Library. Use this
method, which returns a CheckoutButton (a subclass of LinearLayout),
which you can place in your application.
public CheckoutButton getCheckoutButton(Context context, int style, int
textType);
Example code of getting the Payment button from the Library
is:CheckoutButton launchPayPalButton = ppObj.getCheckoutButton(this,
Blog Archive
11 (131)
12 (21)
PayPal.BUTTON_278x43, CheckoutButton.TEXT_PAY);
Jan (1)
Feb (1)
Mar (2)
RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,
Apr (4)
LayoutParams.WRAP_CONTENT);
May (4)
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
launchPayPalButton.setLayoutParams(params);
launchPayPalButton.setOnClickListener(this);
((RelativeLayout)findViewById(R.id.RelativeLayout01)).addView(launchPay
Jun (3)
PalButton);
we can customize button like
Aug (4)
Sep (1)
PayPal.BUTTON_152x33
Nov (1)
PayPal.BUTTON_194x37
13 (16)
PayPal.BUTTON_278x43
PayPal.BUTTON_294x45
and we can change text using
CheckoutButton.TEXT_PAYCheckoutButton.TEXT_DONATE
Parallel Payments :Parallel Payments allow you to make payments for any amount
to any number of recipients. A parallel payment is created by making a payment
with multiple recipients with no primary recipient. From the end-user's
standpoint, a parallel payment will affect the UI by showing the details for each
ActivityThe Library uses the native Android Activity mechanism to start the
checkout flow, and to communicate completion back to you. In addition to the
onActivityResult callback, you can implement PayPalResultDelegate to be informed
immediately upon successful completion of a payment.
To start the PayPal payment, you must start the Library activity, using the
Android method startActivityForResult. Do this when buyers touch the Pay with
PayPal button (which you placed on your page with the getCheckoutButton method)
You must first create the PayPal intent and give it the Payment object. There are
two types of payment objects. PayPalPayment handles simple payments, which
support single receivers of payments with one transaction and a few details.
PayPalAdvancedPayment handles parallel and chained payments, which support
multiple receivers of payment with one transaction and with additional details,
such as invoice data.In the following example, the buyer checks out with a simple
payment for a single recipient:
below code is already given in sample demo provided by paypalhere you can modify
setRecipient() method and put mail id
whether you want shipping or not ,modify tax related calculation ,add invoice
data ,,it is pretty easy ...better refer Paypal reference guide for more detail
/**
* Create a PayPalPayment w hich is used for simple payments.
*
* @return Returns a PayPalPayment.
*/
private PayPalPayment exampleSimplePayment() {
// Create a basic PayPalPayment.
PayPalPayment payment = new PayPalPayment();
// Sets the currency type for this payment.
payment.setCurrencyType("USD");
// Sets the recipient for the payment. This can also be a phone number.
payment.setRecipient("helloxyz22_1300937866_biz@gmail.com");
// Sets the amount of the payment, not including tax and shipping amounts.
payment.setSubtotal(new BigDecimal("8.25"));
// Sets the payment type. This can be PAYMENT_TYPE_GOODS, PAYMENT_TYPE_SERVICE,
PAYMENT_TYPE_PERSONAL, or PAYMENT_TYPE_NONE.
payment.setPaymentType(PayPal.PAYMENT_TYPE_GOODS);
// PayPalInvoiceData can contain tax and shipping amounts. It also contains an ArrayList
of PayPalInvoiceItem w hich can
// be filled out. These are not required for any transaction.
PayPalInvoiceData invoice = new PayPalInvoiceData();
// Sets the tax amount.
invoice.setTax(new BigDecimal("10.25"));
return payment;
}
After Payment you w ill get Transcation Id in ResultDelegate class through PayPalResultDelegate
interface
/**
* Notification that the payment has been completed successfully.
*
* @param payKey
* @param paymentStatus
*/
public void onPaymentSucceeded(String payKey, String paymentStatus) {
//after successfull trancation it w ill give pay key through w hich w e can retrive transcation
detail in future using API call
}
/**
* Notification that the payment has failed.
*
* @param paymentStatus
* @param correlationID
* @param payKey
* @param errorID
* @param errorMessage
*/
public void onPaymentFailed(String paymentStatus, String correlationID,
}
/**
* Notification that the payment w as canceled.
*
* @param paymentStatus
*/
public void onPaymentCanceled(String paymentStatus) {
this is end of paypal integration in android , i hope you feel very easy to grasp all those
things but i recommend to go through reference given by paypal for android OS
######## How t o ret rieve Transact ion det ail by using Pay key ...######
Lets see....
For that w e use paypal api call and w e need below s details :-]
only business and premier account user can retrieve payment details ,bcoz for that you need
Api user name ,pw d and signature .those things w ill be provided to only
account user .
"payKey=AP-3TY0117788428730
&requestEnvelope.errorLanguage=en_US"
That is it ...yo u will get payment det ails in nv [name vale pair fo rmat ].....
I also have at t ached so me screen sho t s ..fo r reference ..
ht t ps://developer.pay pal.com/us/cgi-bin/devscr?cmd=_logout
ht t ps://www.x.com/developers/pay pal/sandbox
happy coding... :)
For Sample Source
No comments:
Post a Comment
Enter your comment...
Comment as:
Publish
Google Accoun
Preview
Newer Post
Home
Older Post
Google+ Followers
2