2

Hello everyone,

    I need to integrate paypal guest payment via credit card.


The android paypal sdk as far as i know, allows you to pay via paypal account.


So what I searched, I will be needing adaptive payments to achieve it, but I didn't got any success with it.

So can anyone of you provide any help of some kind.......... ?

Charles
  • 50,943
  • 13
  • 104
  • 142
viv
  • 6,158
  • 6
  • 39
  • 54
  • I'd suggest checking with PayPal Developer Technical Services at https://www.paypal.com/dts/ -- this is more a features question, and we're unlikely to know the answer unless we stumbled on it previously. Seeing as you haven't had a response yet, it might be worth checking with the source. Feel of course free to share with us when you find the answer! – Robert Sep 07 '11 at 21:43
  • yes i have done a bit and will share, when it is finished.... – viv Sep 12 '11 at 05:37

2 Answers2

2

Paypal give access to pay via credit card .but now its depricated .If you want to use it remove exclude creditcard.io from your app gradel in android

0

Android PayPal adaptive payment integration

first implement method
   private void initLibrary() {
        PayPal pp = PayPal.getInstance();
        if(pp == null) {
            pp = PayPal.initWithAppID(this, PAYPAL_APP_ID, PayPal.ENV_SANDBOX);
            pp.setLanguage("en_US"); // Sets the language for the library.
            pp.setFeesPayer(PayPal.FEEPAYER_EACHRECEIVER);
//            pp.setShippingEnabled(true);
            pp.setDynamicAmountCalculationEnabled(false);
        }
    }    

===================================

**paypal button click event code**

     double secondary_payment = 0;
    double primary_payment = 0;

      PayPalAdvancedPayment advPayment = makeChainedPayment(secondary_payment,primary_payment,"primary_email","secondary_email");

      Intent checkoutIntent = PayPal.getInstance().checkout(advPayment, your_current_activity);
                    startActivityForResult(checkoutIntent, 1); 

    =============================================
    private PayPalAdvancedPayment makeChainedPayment(double priceSecondary, double pricePrimary, String primary_email, String secondary_email) {
            PayPalAdvancedPayment payment = new PayPalAdvancedPayment();
            payment.setCurrencyType("USD");
    //        payment.setMerchantName("PushND");
            BigDecimal bigDecimalPrimary=new BigDecimal(pricePrimary);
            PayPalReceiverDetails receiverPrimary = new PayPalReceiverDetails();
            receiverPrimary.setRecipient(primary_email);
            //receiverPrimary.setRecipient("adaptive_receiver_1@pushnd.com");
            receiverPrimary.setSubtotal(bigDecimalPrimary);
            receiverPrimary.setIsPrimary(true);
            payment.getReceivers().add(receiverPrimary);

            PayPalReceiverDetails receiverSecondary= new PayPalReceiverDetails();
            receiverSecondary.setRecipient(secondary_email);
            BigDecimal bigDecimalSecond=new BigDecimal(priceSecondary);
            receiverSecondary.setSubtotal(bigDecimalSecond);
            payment.getReceivers().add(receiverSecondary);

            return payment;
        }