[AC-1435] TiPaypal does not make a Delayed Chain Payment
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2014-11-05T19:04:49.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Appcelerator Modules |
Labels | TCSupportTriage |
Reporter | Joseph Sachs |
Assignee | Mauro Parra-Miranda |
Created | 2014-10-04T14:09:47.000+0000 |
Updated | 2016-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
File | Date | Size |
---|---|---|
Screen Shot 2014-10-04 at 10.11.48 AM.png | 2014-10-04T14:13:29.000+0000 | 116965 |
Additional Information on Delayed Chain Payments: https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/ht_ap-delayedChainedPayment-curl-etc/ You notice this:
The TiPaypal Module does Not have a property for *actionType*. I think this will solve the issue if added.
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.
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.