Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1435] TiPaypal does not make a Delayed Chain Payment

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNot Our Bug
Resolution Date2014-11-05T19:04:49.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator Modules
LabelsTCSupportTriage
ReporterJoseph Sachs
AssigneeMauro Parra-Miranda
Created2014-10-04T14:09:47.000+0000
Updated2016-03-08T07:37:51.000+0000

Description

The Module located here: https://github.com/appcelerator-modules/ti.paypal +Solution:+ The TiPaypal Module does Not have a property for *actionType*. I think this will solve the issue if added. +Details:+ While trying to Implement a **Delayed Chain Payment**, I've added the following code:
button = Paypal.createPaypalButton({
    width: 194, height: 37,
    buttonStyle: Paypal.BUTTON_194x37,
    top: 100,
     
    language: 'en_US',
    textStyle: Paypal.PAYPAL_TEXT_PAY,
     
    appID: payPalAppID,
    paypalEnvironment: Paypal.PAYPAL_ENV_SANDBOX, // Sandbox, None or Live
     
    feePaidByReceiver: true, 
    enableShipping: false,

    actionType: 'PAY_PRIMARY', // Not Part of the Module
     
    advancedPayment: { // The payment itself
        payments: [
            {
                isPrimary: true, // Mark this as the primary vendor; this marks this as a chain payment.
                merchantName: 'Book App',
                paymentType: Paypal.PAYMENT_TYPE_SERVICE,
                subtotal: 20,
                tax: 0,
                shipping: 0,
                recipient: 'owner@somedomain.ca', // Sandbox Business Account
                customID: 'anythingYouWant',
                invoiceItems: [
                    { name: 'Book Title', totalPrice: 20, itemPrice: 20, itemCount: 1 }
                ]
            },
            {
                isPrimary: false, // Delay it?
                merchantName: 'Book Seller',
                paymentType: Paypal.PAYMENT_TYPE_SERVICE,
                subtotal: 10,
                tax: 0,
                shipping: 0,
                recipient: 'tester2@domain.ca', // Sandbox Account
                customID: 'anythingYouWant',
                invoiceItems: [
                    { name: 'Book Title', totalPrice: 10, itemPrice: 10, itemCount: 1 }
                ]
            }
        ],
        ipnUrl: 'someurl.com',
        currency: 'CAD',
        memo: 'Book purchase'
        }
    });
 
        // Events available
    button.addEventListener('paymentCancelled', function (e) {
        alert('Payment cancelled. Please try again!');
        addButtonToWindow();
    });
    button.addEventListener('paymentSuccess', function (e) {
        alert('Payment successfull. Please get your Policy No.!');
        Ti.API.info(JSON.stringify(e));
        transID = e.transactionID; // HERE: This should return payKey, but is returning transactionID.
        win.remove(button);
    });
    button.addEventListener('paymentError', function (e) {
        alert('Payment Error. Please try again!');
            addButtonToWindow();
        });
 
        button.addEventListener('buttonDisplayed', function () {
            win.remove(status);
        });
 
        button.addEventListener('buttonError', function () {
        alert('Button Error.');
    });
 
win.add(button);
The Code above returns in **paymentSuccess** event:
transactionID	:	AP-XXXXXXD595635X		
bubbles	:	true
type	:	paymentSuccess
	source 
           .... ....
The API Explorer https://devtools-paypal.com/apiexplorer/AdaptivePayments when trying out the same credentials, returns a *''payKey"* property instead of a "transactionID". The PayKey is used later to make the second payment. The code above does the chain payment immediately, however I'd like it to pay the primary receiver only, and then do the second payment at a later date (before 90 days as PayPal suggests). +Possible Solution+: The TiPaypal Module does Not have a property for *actionType* . I think this will solve the issue if added, so we can give it a value of: *"PAY_PRIMARY"*. I've attached a screenshot of the API explorer.

Attachments

FileDateSize
Screen Shot 2014-10-04 at 10.11.48 AM.png2014-10-04T14:13:29.000+0000116965

Comments

  1. Joseph Sachs 2014-10-04

    Additional Information on Delayed Chain Payments: https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/ht_ap-delayedChainedPayment-curl-etc/ You notice this:
       actionType=PAY_PRIMARY
       &receiverList.receiver(0).primary=true    // Receiver designation (there can be only 1 primary receiver)
       &receiverList.receiver(1).primary=false  // Delay second receiver
       
    The TiPaypal Module does Not have a property for *actionType*. I think this will solve the issue if added.
  2. Joseph Sachs 2014-10-08

    Update: It seems that Paypal has no support in the iOS nor Android SDK yet: https://github.com/paypal/PayPal-iOS-SDK/issues/9 You can Close this issue.
  3. Mauro Parra-Miranda 2014-11-05

    Update: It seems that Paypal has no support in the iOS nor Android SDK yet: https://github.com/paypal/PayPal-iOS-SDK/issues/9 You can Close this issue.

JSON Source