All Projects → hansemannn → titanium-paypal

hansemannn / titanium-paypal

Licence: other
💰 Use the PayPal iOS-SDK 2.x with Titanium Mobile.

Programming Languages

objective c
16641 projects - #2 most used programming language
python
139335 projects - #7 most used programming language
javascript
184084 projects - #8 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to titanium-paypal

av.imageview
Titanium native ImageView module that extends the default Titanium ImageView with more capabilities and a different caching system.
Stars: ✭ 97 (+340.91%)
Mutual labels:  native, titanium-mobile, appcelerator
titanium-turbo
Axway Amplify module that adds some enhancements for Appcelerator Titanium Alloy
Stars: ✭ 15 (-31.82%)
Mutual labels:  native, titanium-mobile, appcelerator
ti.admob
Use the Google AdMob SDK on iOS and Android with Titanium
Stars: ✭ 51 (+131.82%)
Mutual labels:  native, appcelerator
ti.map
Use native Apple Maps & Google Maps in iOS and Android with Axway Titanium
Stars: ✭ 49 (+122.73%)
Mutual labels:  native, appcelerator
titanium-material
Use the native Material UI/UX framework (https://github.com/CosmicMind/Material) in Titanium!
Stars: ✭ 14 (-36.36%)
Mutual labels:  native, appcelerator
Titanium mobile
🚀 Native iOS- and Android- Apps with JavaScript
Stars: ✭ 2,553 (+11504.55%)
Mutual labels:  native, appcelerator
titanium-firebase-analytics
Use the Firebase Analytics SDK in Axway Titanium 🚀
Stars: ✭ 33 (+50%)
Mutual labels:  native, appcelerator
ti.paint
Touch-based painting with the Titanium SDK.
Stars: ✭ 27 (+22.73%)
Mutual labels:  native, appcelerator
TiFastlane
With TiFastlane you'll be able to fully optimize the way you submit your app updates and maintain your certificates and provisioning profiles of all your Titanium Apps.
Stars: ✭ 83 (+277.27%)
Mutual labels:  titanium-mobile, appcelerator
ti.coremotion
Support for the native iOS CoreMotion framework in Appcelerator Titanium
Stars: ✭ 15 (-31.82%)
Mutual labels:  native, appcelerator
titanium-arkit
Use the iOS 11 ARKit API in Axway Titanium
Stars: ✭ 28 (+27.27%)
Mutual labels:  native, appcelerator
ti.playservices
Titanium module for Google Play Services
Stars: ✭ 19 (-13.64%)
Mutual labels:  native, appcelerator
griffin-app-opensource
The Axway Griffin App goes open source!
Stars: ✭ 19 (-13.64%)
Mutual labels:  native, appcelerator
procesa-pagos-con-laravel
Código fuente resultado del curso "Procesa pagos con Laravel y las mejores plataformas de pagos"
Stars: ✭ 38 (+72.73%)
Mutual labels:  paypal
webviewhs
🌐 A Haskell binding to the webview library created by Serge Zaitsev.
Stars: ✭ 109 (+395.45%)
Mutual labels:  native
EmbeddedTools
Additions to the model-based DSL for deploying Java and Native projects to remote targets
Stars: ✭ 14 (-36.36%)
Mutual labels:  native
cosmicverge
A systematic, sandbox MMO still in the concept phase. Will be built with Rust atop BonsaiDb and Gooey
Stars: ✭ 18 (-18.18%)
Mutual labels:  native
srtdroid
Secure Reliable Transport (SRT) Protocol for Android
Stars: ✭ 35 (+59.09%)
Mutual labels:  native
PayumYiiExtension
Rich payment solutions for Yii framework. Paypal, payex, authorize.net, be2bill, omnipay, recurring paymens, instant notifications and many more
Stars: ✭ 13 (-40.91%)
Mutual labels:  paypal
appbuilders18app
The App Builders 2018 iOS and Android app built as an experiment in React Native.
Stars: ✭ 29 (+31.82%)
Mutual labels:  native

PayPal iOS SDK in Appcelerator Titanium

Build Status License Contact

Summary

Ti.PayPal is an open-source project to support the PayPal iOS-SDK 2.x in Appcelerator's Titanium Mobile. The module currently supports the following API's:

  • Simple Payments
  • Future Payments
  • Merchant Configuration

Note: This is the iOS version of Ti.PayPal. You might want to check appwert/ti.paypal for the Android equivalent 🚀.

Requirements

  • Titanium Mobile SDK 5.2.0+
  • iOS 7.1+

Download + Setup

Download

Setup

Unpack the module and place it inside the modules/iphone/ folder of your project. Edit the modules section of your tiapp.xml file to include this module:

<modules>
    <module platform="iphone">ti.paypal</module>
</modules>

Integrate the following snippet in your tiapp.xml. It is used to enable 1Password support that is used by the PayPal-SDK:

<ios>
    <plist>
        <dict>
            <key>LSApplicationQueriesSchemes</key>
            <array>
                <string>com.paypal.ppclient.touch.v1</string>
                <string>com.paypal.ppclient.touch.v2</string>
                <string>org-appextension-feature-password-management</string>
            </array>
        </dict>
    </plist>
</ios>

Initialize the module by setting the PayPal credentials which you can get from here.

var PayPal = require('ti.paypal');

PayPal.initialize({
    clientIdSandbox: 'YOUR_CLIENT_ID_SANDBOX',
    clientIdProduction: 'YOUR_CLIENT_ID_PRODUCTION',
    environment: PayPal.ENVIRONMENT_SANDBOX // or: ENVIRONMENT_PRODUCTION, or: ENVIRONMENT_NO_NETWORK
});

Features

Simple Payment

A simple payment is used for do instant payments with items you define. Watch the events for updates on your transaction.

var item1 = PayPal.createPaymentItem({
    name: 'My item',
    price: 23.99,
    sku: 'my-item',
    quantity: 1,
    currency: 'USD' // Any ISO-4217
});

var configuration = PayPal.createConfiguration({
    locale: 'en', // Any ISO 639-1
    merchantName: 'John Doe',
    merchantPrivacyPolicyURL: 'https://google.com',
    merchantUserAgreementURL: 'https://google.com',
    defaultUserEmail: '[email protected]',
    defaultUserPhoneNumber: '+1 111 222 333',
    defaultUserPhoneCountryCode: 'USD',
    acceptCreditCards: true,
    alwaysDisplayCurrencyCodes: false
    disableBlurWhenBackgrounding: false,
    presentingInPopover: false,
    forceDefaultsInSandbox: false,
    sandboxUserPassword: 'paypal_yeeey',
    sandboxUserPin: '1337',
    payPalShippingAddressOption: PayPal.PAYPAL_SHIPPING_ADDRESS_OPTION_NONE, // or *_PROVIDED, *_PAYPAL, *_BOTH
    rememberUser: false,
    disableShakeAnimations: false
});

var payment = PayPal.createPayment({
    // Required
    configuration: configuration, // Required payment configuration
    currencyCode: 'USD', // Required currency code (ISO)
    shortDescription: 'Your shopping trip at FooBar', // Required short description
    amount: 23.99, // Required amount, has to match the amount of your items if you set them

    items: [ item1 ] // Optional number of items
    intent: PayPal.PAYMENT_INTENT_SALE, // or PAYMENT_INTENT_AUTHORIZE or PAYMENT_INTENT_ORDER
    softDescriptor: 'This will appear in the credit card statement', // Optional credit-card statement description
    custom: 'my_custom_value', // Optional field, e.g. for tracking numbers
    invoiceNumber: 'IV101', // Optional invoice number
    payeeEmail: '[email protected]', // Optional third-party receiver for single payments.
    bnCode: 'THE_CODE' // Optional Build Notation code ("BN code"), from [email protected],
    shippingAddress: { // Optional shipping address
        recipientName: 'Tim Travel', // required
        line1: 'My St. 1337', // required
        city: 'San Jose', // required
        line2: 'Apt 3a'
        state: 'NYC',
        postalCode: '10001',
        countryCode: 'US'
    },
    paymentDetails: { // Optional payment details
        subtotal: 0.01,
        shipping: 23.98,
        tax: 0.0
    }
});

payment.addEventListener('paymentDidCancel', function(e) {
    Ti.API.warn('paymentDidCancel');
});

payment.addEventListener('paymentWillComplete', function(e) {
    Ti.API.warn('paymentWillComplete');
    Ti.API.warn(e.payment);
});

payment.addEventListener('paymentDidComplete', function(e) {
    Ti.API.warn('paymentDidComplete');
    Ti.API.warn(e.payment);
});

payment.show();	

Future Payment

A future payment is used to ask the buyer for the permission to charge his account later.

var configuration = PayPal.createConfiguration({
    merchantName: 'John Doe',
    merchantPrivacyPolicyURL: 'https://google.com',
    merchantUserAgreementURL: 'https://google.com',
    locale: 'en'
    // See full configuration above
});

var payment = PayPal.createFuturePayment({
    configuration: configuration
});

payment.addEventListener('futurePaymentDidCancel', function(e) {
    Ti.API.warn('futurePaymentDidCancel');
});

payment.addEventListener('futurePaymentWillComplete', function(e) {
    Ti.API.warn('futurePaymentWillComplete');
    Ti.API.warn(e.payment);
});

payment.addEventListener('futurePaymentDidComplete', function(e) {
    Ti.API.warn('futurePaymentDidComplete');
    Ti.API.warn(e.payment);
});

payment.show();	

Profile Sharing

Profile sharing is used to share a user profile by defining different scopes that can be authorized. Available Scopes:

  • SCOPE_FUTURE_PAYMENTS
  • SCOPE_PROFILE
  • SCOPE_OPEN_ID
  • SCOPE_PAYPAL_ATTRIBUTES
  • SCOPE_EMAIL
  • SCOPE_ADDRESS
  • SCOPE_PHONE
var configuration = PayPal.createConfiguration({
    merchantName: 'John Doe',
    merchantPrivacyPolicyURL: 'https://google.com',
    merchantUserAgreementURL: 'https://google.com',
    locale: 'en'
    // See full configuration above
});

var profile = PayPal.createProfileSharing({
    configuration: configuration,
    scopes: [PayPal.SCOPE_PROFILE, PayPal.SCOPE_EMAIL]
});

profile.addEventListener('profileSharingDidCancel', function(e) {
    Ti.API.warn('profileSharingDidCancel');
});

profile.addEventListener('profileSharingWillLogIn', function(e) {
    Ti.API.warn('profileSharingWillLogIn');
    Ti.API.warn(e.authorization);
});

profile.addEventListener('profileSharingDidLogIn', function(e) {
    Ti.API.warn('profileSharingDidLogIn');
    Ti.API.warn(e.authorization);
});

profile.show();

Example

For a full example covering all API's, check the demo in iphone/example/app.js.

Author

Hans Knoechel (@hansemannnn / Web)

License

Apache 2.0

Contributing

Code contributions are greatly appreciated, please submit a new pull request!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].