{"id":13749740,"url":"https://github.com/hansemannn/titanium-paypal","last_synced_at":"2025-08-16T11:11:17.523Z","repository":{"id":142791352,"uuid":"59962077","full_name":"hansemannn/titanium-paypal","owner":"hansemannn","description":"💰 Use the PayPal iOS-SDK 2.x with Titanium Mobile.","archived":false,"fork":false,"pushed_at":"2018-07-17T12:57:38.000Z","size":55789,"stargazers_count":22,"open_issues_count":0,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-29T01:11:16.601Z","etag":null,"topics":["appcelerator","ios","native","paypal","titanium-mobile"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hansemannn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-29T20:17:55.000Z","updated_at":"2019-02-25T05:15:56.000Z","dependencies_parsed_at":"2023-06-26T14:04:33.495Z","dependency_job_id":null,"html_url":"https://github.com/hansemannn/titanium-paypal","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-paypal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-paypal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-paypal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hansemannn%2Ftitanium-paypal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hansemannn","download_url":"https://codeload.github.com/hansemannn/titanium-paypal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249151643,"owners_count":21221080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appcelerator","ios","native","paypal","titanium-mobile"],"created_at":"2024-08-03T07:01:11.345Z","updated_at":"2025-04-15T20:42:17.428Z","avatar_url":"https://github.com/hansemannn.png","language":"Objective-C","funding_links":["https://developer.paypal.com"],"categories":["Objective-C"],"sub_categories":[],"readme":"# PayPal iOS SDK in Appcelerator Titanium\n\n[![Build Status](https://travis-ci.org/hansemannn/titanium-paypal.svg?branch=master)](https://travis-ci.org/hansemannn/titanium-paypal) [![License](http://hans-knoechel.de/shields/shield-license.svg)](./LICENSE) [![Contact](http://hans-knoechel.de/shields/shield-twitter.svg)](http://twitter.com/hansemannnn)\n\n\u003cimg width=\"976\" src=\"https://abload.de/img/showcase3vronaax58.png\"\u003e\n\n## Summary\n\nTi.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:\n- [x] Simple Payments\n- [x] Future Payments\n- [x] Merchant Configuration\n\n\u003e Note: This is the iOS version of Ti.PayPal. You might want to check [appwert/ti.paypal](https://github.com/AppWerft/Ti.Paypal) for the Android equivalent 🚀.\n\n## Requirements\n\n- [x] Titanium Mobile SDK 5.2.0+\n- [x] iOS 7.1+\n\n## Download + Setup\n\n### Download\n\n  * [Stable release](https://github.com/hansemannn/ti.paypal/releases)\n\n### Setup\n\nUnpack the module and place it inside the `modules/iphone/` folder of your project.\nEdit the modules section of your `tiapp.xml` file to include this module:\n```xml\n\u003cmodules\u003e\n    \u003cmodule platform=\"iphone\"\u003eti.paypal\u003c/module\u003e\n\u003c/modules\u003e\n```\n\nIntegrate the following snippet in your tiapp.xml. It is used to enable 1Password support\nthat is used by the PayPal-SDK:\n```xml\n\u003cios\u003e\n    \u003cplist\u003e\n        \u003cdict\u003e\n            \u003ckey\u003eLSApplicationQueriesSchemes\u003c/key\u003e\n            \u003carray\u003e\n                \u003cstring\u003ecom.paypal.ppclient.touch.v1\u003c/string\u003e\n                \u003cstring\u003ecom.paypal.ppclient.touch.v2\u003c/string\u003e\n                \u003cstring\u003eorg-appextension-feature-password-management\u003c/string\u003e\n            \u003c/array\u003e\n        \u003c/dict\u003e\n    \u003c/plist\u003e\n\u003c/ios\u003e\n```\n\nInitialize the module by setting the PayPal credentials which you can get from [here](https://developer.paypal.com).\n```javascript\nvar PayPal = require('ti.paypal');\n\nPayPal.initialize({\n    clientIdSandbox: 'YOUR_CLIENT_ID_SANDBOX',\n    clientIdProduction: 'YOUR_CLIENT_ID_PRODUCTION',\n    environment: PayPal.ENVIRONMENT_SANDBOX // or: ENVIRONMENT_PRODUCTION, or: ENVIRONMENT_NO_NETWORK\n});\n```\n\n## Features\n\n### Simple Payment\nA simple payment is used for do instant payments with items you define. Watch the events for updates on your transaction.\n\n```js\nvar item1 = PayPal.createPaymentItem({\n    name: 'My item',\n    price: 23.99,\n    sku: 'my-item',\n    quantity: 1,\n    currency: 'USD' // Any ISO-4217\n});\n\nvar configuration = PayPal.createConfiguration({\n    locale: 'en', // Any ISO 639-1\n    merchantName: 'John Doe',\n    merchantPrivacyPolicyURL: 'https://google.com',\n    merchantUserAgreementURL: 'https://google.com',\n    defaultUserEmail: 'john@doe.com',\n    defaultUserPhoneNumber: '+1 111 222 333',\n    defaultUserPhoneCountryCode: 'USD',\n    acceptCreditCards: true,\n    alwaysDisplayCurrencyCodes: false\n    disableBlurWhenBackgrounding: false,\n    presentingInPopover: false,\n    forceDefaultsInSandbox: false,\n    sandboxUserPassword: 'paypal_yeeey',\n    sandboxUserPin: '1337',\n    payPalShippingAddressOption: PayPal.PAYPAL_SHIPPING_ADDRESS_OPTION_NONE, // or *_PROVIDED, *_PAYPAL, *_BOTH\n    rememberUser: false,\n    disableShakeAnimations: false\n});\n\nvar payment = PayPal.createPayment({\n    // Required\n    configuration: configuration, // Required payment configuration\n    currencyCode: 'USD', // Required currency code (ISO)\n    shortDescription: 'Your shopping trip at FooBar', // Required short description\n    amount: 23.99, // Required amount, has to match the amount of your items if you set them\n\n    items: [ item1 ] // Optional number of items\n    intent: PayPal.PAYMENT_INTENT_SALE, // or PAYMENT_INTENT_AUTHORIZE or PAYMENT_INTENT_ORDER\n    softDescriptor: 'This will appear in the credit card statement', // Optional credit-card statement description\n    custom: 'my_custom_value', // Optional field, e.g. for tracking numbers\n    invoiceNumber: 'IV101', // Optional invoice number\n    payeeEmail: 'test@example.com', // Optional third-party receiver for single payments.\n    bnCode: 'THE_CODE' // Optional Build Notation code (\"BN code\"), from partnerprogram@paypal.com,\n    shippingAddress: { // Optional shipping address\n        recipientName: 'Tim Travel', // required\n        line1: 'My St. 1337', // required\n        city: 'San Jose', // required\n        line2: 'Apt 3a'\n        state: 'NYC',\n        postalCode: '10001',\n        countryCode: 'US'\n    },\n    paymentDetails: { // Optional payment details\n        subtotal: 0.01,\n        shipping: 23.98,\n        tax: 0.0\n    }\n});\n\npayment.addEventListener('paymentDidCancel', function(e) {\n    Ti.API.warn('paymentDidCancel');\n});\n\npayment.addEventListener('paymentWillComplete', function(e) {\n    Ti.API.warn('paymentWillComplete');\n    Ti.API.warn(e.payment);\n});\n\npayment.addEventListener('paymentDidComplete', function(e) {\n    Ti.API.warn('paymentDidComplete');\n    Ti.API.warn(e.payment);\n});\n\npayment.show();\t\n```\n\n### Future Payment\nA future payment is used to ask the buyer for the permission to charge his account later.\n\n```javascript\nvar configuration = PayPal.createConfiguration({\n    merchantName: 'John Doe',\n    merchantPrivacyPolicyURL: 'https://google.com',\n    merchantUserAgreementURL: 'https://google.com',\n    locale: 'en'\n    // See full configuration above\n});\n\nvar payment = PayPal.createFuturePayment({\n    configuration: configuration\n});\n\npayment.addEventListener('futurePaymentDidCancel', function(e) {\n    Ti.API.warn('futurePaymentDidCancel');\n});\n\npayment.addEventListener('futurePaymentWillComplete', function(e) {\n    Ti.API.warn('futurePaymentWillComplete');\n    Ti.API.warn(e.payment);\n});\n\npayment.addEventListener('futurePaymentDidComplete', function(e) {\n    Ti.API.warn('futurePaymentDidComplete');\n    Ti.API.warn(e.payment);\n});\n\npayment.show();\t\n```\n\n### Profile Sharing\nProfile sharing is used to share a user profile by defining different scopes that can be authorized. Available Scopes:\n\n- [x] SCOPE_FUTURE_PAYMENTS\n- [x] SCOPE_PROFILE\n- [x] SCOPE_OPEN_ID\n- [x] SCOPE_PAYPAL_ATTRIBUTES\n- [x] SCOPE_EMAIL\n- [x] SCOPE_ADDRESS\n- [x] SCOPE_PHONE\n\n```javascript\nvar configuration = PayPal.createConfiguration({\n    merchantName: 'John Doe',\n    merchantPrivacyPolicyURL: 'https://google.com',\n    merchantUserAgreementURL: 'https://google.com',\n    locale: 'en'\n    // See full configuration above\n});\n\nvar profile = PayPal.createProfileSharing({\n    configuration: configuration,\n    scopes: [PayPal.SCOPE_PROFILE, PayPal.SCOPE_EMAIL]\n});\n\nprofile.addEventListener('profileSharingDidCancel', function(e) {\n    Ti.API.warn('profileSharingDidCancel');\n});\n\nprofile.addEventListener('profileSharingWillLogIn', function(e) {\n    Ti.API.warn('profileSharingWillLogIn');\n    Ti.API.warn(e.authorization);\n});\n\nprofile.addEventListener('profileSharingDidLogIn', function(e) {\n    Ti.API.warn('profileSharingDidLogIn');\n    Ti.API.warn(e.authorization);\n});\n\nprofile.show();\n```\n\n## Example\n\nFor a full example covering all API's, check the demo in `iphone/example/app.js`.\n\n## Author\n\nHans Knoechel ([@hansemannnn](https://twitter.com/hansemannnn) / [Web](http://hans-knoechel.de))\n\n## License\n\nApache 2.0\n\n## Contributing\n\nCode contributions are greatly appreciated, please submit a new [pull request](https://github.com/hansemannn/titanium-paypal/pull/new/master)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansemannn%2Ftitanium-paypal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhansemannn%2Ftitanium-paypal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhansemannn%2Ftitanium-paypal/lists"}