Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
29bfa9a
Removes old REST framework, 219
Apr 20, 2025
c0c8966
Updates gitignore, #219
Apr 20, 2025
7de09d7
Updates required PHP to 8.0.x+, #219
Apr 21, 2025
725d08c
Adds missing var declarations for PHP 8 compatibility, #219
Apr 21, 2025
bb588be
Adds .vscode/ to gitignore.
Sep 13, 2025
3044cb8
NVP to REST Impelentation Started
meet-creedally Oct 8, 2025
80ce751
Set Flag for the NVP and REST Conversion
meet-creedally Oct 9, 2025
17e06f6
Missing File Added
meet-creedally Oct 9, 2025
e68147b
Remove Unwanted File as now
meet-creedally Oct 9, 2025
8094575
Remove Unwanted Code from Classes
meet-creedally Oct 9, 2025
511947d
GetBalance File Completion in REST Templates
meet-creedally Oct 14, 2025
72135e1
GetBalance File Completion in REST Templates Remaining
meet-creedally Oct 15, 2025
1beed2a
Adaptive Method for AddBankAccount Work In Progress
meet-creedally Oct 15, 2025
9e904d0
Continue in Banking Common Methods
meet-creedally Oct 16, 2025
44d03d8
Minor Code Added
meet-creedally Oct 24, 2025
3313445
Completed SetExpressCheckout and DoExpressCheckoutPayment
meet-creedally Oct 24, 2025
b7bc343
DoDirect and ExcutePayment Method Conversion
meet-creedally Oct 27, 2025
dd2cd02
ExpressCheckout Demo with REST V2 with Capture Intent
meet-creedally Oct 31, 2025
88763a0
Completed ExpressCheckout Payment Flow Demo with Toggle of Capture an…
meet-creedally Oct 31, 2025
ea9aa30
DoReferenceTransaction Method Completed
meet-creedally Nov 3, 2025
b07132e
CreateRecurringPaymentsProfile, GetRecurringPaymentsProfileDetails, M…
meet-creedally Nov 3, 2025
015911c
Completed UpdateRecurringPaymentProfile, GetPalDetails and MassPay Me…
meet-creedally Nov 4, 2025
f875bdc
Payment Options Method Completed
meet-creedally Nov 5, 2025
931e93c
Add README File for the REST Sample Files
meet-creedally Nov 10, 2025
ca698ac
Refund and RequestPermissions Methods Conversion
meet-creedally Nov 11, 2025
9945362
UpdateAuthorization Method Conversion Completed
meet-creedally Nov 11, 2025
26b5995
CreateInvoice, SendInvoice and CreateAndSendInvoice Method Conversion…
meet-creedally Nov 12, 2025
6cc97c0
GetInvoiceDetails, CancelInvoice and DeleteInvoice Conversion Completed
meet-creedally Nov 12, 2025
d93a1af
MarkInvoiceAsPaid and MarkInvoiceAsRefunded Method Conversion Completed
meet-creedally Nov 12, 2025
018266c
Completed RemindInvoice and SearchInvoices Methods
meet-creedally Nov 12, 2025
a824273
Added Upgrade Flag and Converted GetBalance Mapping
meet-creedally Nov 13, 2025
b88e61d
SetExpressCheckout, GetExpressCheckout and DoExpresCheckout Method Co…
meet-creedally Nov 14, 2025
3b9e00c
Conversion of GetPalDetails Completed
meet-creedally Nov 24, 2025
383a98e
Conversion of GetPaymentOptions Completed
meet-creedally Nov 24, 2025
254e628
Conversion of CreateRecurringPaymentsProfile Completed
meet-creedally Nov 24, 2025
084c6f8
Conversion of GetRecurringPaymentsProfileDetails Completed
meet-creedally Nov 24, 2025
2a3c474
Conversion of ManageSubscriptionProfile Completed
meet-creedally Nov 24, 2025
5709f86
Conversion of CreateInvoice Completed
meet-creedally Nov 24, 2025
a0a7f3f
Conversion of MarkInvoiceAsPaid Completed
meet-creedally Nov 24, 2025
4c259f3
Conversion of RemindInvoice Completed
meet-creedally Nov 24, 2025
e910328
Conversion of SendInvoice Completed
meet-creedally Nov 25, 2025
b6473e7
Conversion of SearchInvoices Completed
meet-creedally Nov 25, 2025
c58b632
Conversion of MarkInvoiceAsRefunded Completed
meet-creedally Nov 25, 2025
570be67
Conversion of MarkInvoiceAsRefunded Completed
meet-creedally Nov 25, 2025
1f4e92e
Conversion of CancelInvoice Completed
meet-creedally Nov 25, 2025
339bd66
Conversion of CreateAndSendInvoice Completed
meet-creedally Nov 25, 2025
1cded42
Conversion of DeleteInvoice Completed
meet-creedally Nov 25, 2025
243b8b2
Conversion of DoDirectPayment Completed
meet-creedally Nov 25, 2025
86a50fa
Conversion of GetInvoiceDetails Completed
meet-creedally Nov 26, 2025
ee7a2e3
Conversion of MassPay Completed
meet-creedally Nov 26, 2025
063af39
Conversion of Refund Completed
meet-creedally Nov 26, 2025
d34a22f
Conversion of RequestPermissions Completed
meet-creedally Nov 26, 2025
2459602
Conversion of UpdateAuthorization Completed
meet-creedally Nov 26, 2025
ae08cab
Conversion of UpdateRecurringPaymentsProfile Completed
meet-creedally Nov 26, 2025
0cda7d7
Sample Methods in Templates
meet-creedally Dec 1, 2025
f7f54dd
Merge branch 'PPL-174' of github.com:angelleye/paypal-php-library int…
meet-creedally Dec 1, 2025
d7e3a6d
Templates Samples Added
meet-creedally Dec 1, 2025
dedb20d
DemoKit Implementation for the ExpressCheckout Basic with Switching L…
meet-creedally Dec 10, 2025
fdb1269
Updates BN code, PPL-174
Dec 19, 2025
88fabed
Merge branch 'PPL-174' of github.com:angelleye/paypal-php-library int…
meet-creedally Dec 23, 2025
69792fd
Added BN Code for the both Classic and REST via Main PayPal Class
meet-creedally Dec 23, 2025
1d005a7
Logging added for the REST and Updated for Classic
meet-creedally Dec 23, 2025
23d3791
Added Function for PayPal Button using JS SDKv6 and not for the Class…
meet-creedally Dec 25, 2025
17f0a4b
Updated ButtonSource in Classic same as REST
meet-creedally Dec 29, 2025
acb7cc4
Merge branch 'PPL-174' of github.com:angelleye/paypal-php-library int…
meet-creedally Dec 29, 2025
2b96217
Structurize Demo Folder and Update Index File
meet-creedally Dec 29, 2025
594a194
Updated Slug for the Express Checkout Basic
meet-creedally Dec 30, 2025
a6c3217
PayPal Checkout with Line Items Completed
meet-creedally Dec 30, 2025
c9e8022
Completed Recurring Subscriptions
meet-creedally Jan 1, 2026
bec2c97
Completed PayPal Checkout Shipped Items + Recurring Payments Demo
meet-creedally Jan 2, 2026
442ba1a
Added Vaulting Methods in REST for future use
meet-creedally Jan 6, 2026
7113b0a
Completed PayPal Checkout MultiParty
meet-creedally Jan 7, 2026
0178906
Completed Onboarding DemoKit
meet-creedally Jan 7, 2026
b5e1605
Remove Tracking ID from Onboarded Table
meet-creedally Jan 8, 2026
15866a9
Completed PayPal Checkout Advanced Credit Cards
meet-creedally Jan 8, 2026
8c8c99d
PayPal Pay Later DemoKit Completed
meet-creedally Jan 14, 2026
c55429c
Added Condition Checks for the Classic Mode
meet-creedally Jan 16, 2026
1279d9a
GooglePay Configuration Done
meet-creedally Jan 16, 2026
b9f6194
Apple Pay Demo Configuration Setup
meet-creedally Jan 16, 2026
a088afb
Completed Vaulting Payments
meet-creedally Jan 19, 2026
511c4fe
Sample Config Up-to Date
meet-creedally Jan 20, 2026
df91172
Added Page Type where missing
meet-creedally Feb 2, 2026
b5c1105
Added Capabilities in Onboarding
meet-creedally Feb 2, 2026
ecbd210
Added Capabilities in Onboarding for Payment Methods
meet-creedally Feb 2, 2026
42aea0c
Buyer Email and Returned User added order payload
meet-creedally Feb 5, 2026
435441d
Minor Fixes
meet-creedally Feb 5, 2026
8714055
Accept text header added
meet-creedally Feb 5, 2026
b2ee488
Return User Logic
meet-creedally Feb 6, 2026
aced024
Added Payment Method
meet-creedally Feb 6, 2026
e75898f
Minor Fix
meet-creedally Feb 6, 2026
a63acb4
Onboarding Fixed
meet-creedally Feb 6, 2026
960c574
Onboarding Minor CHanges
meet-creedally Feb 6, 2026
a947b01
SDK Error Handled
meet-creedally Feb 10, 2026
ded3868
Donation Category Added in One Demo
meet-creedally Feb 10, 2026
4f467d1
Case Handled for error
meet-creedally Feb 10, 2026
1cc591d
Vaulting Checklists
meet-creedally Feb 13, 2026
9314e31
Minor Changes for Apple and Google Pay
meet-creedally Feb 13, 2026
d897c50
Advanced Cards Completed
meet-creedally Feb 13, 2026
965dbef
PayLater Checklists
meet-creedally Feb 16, 2026
fc6a6da
Venmo Changes
meet-creedally Feb 17, 2026
c294243
Minor Source Added
meet-creedally Feb 17, 2026
d9b2b4b
Minor Changes
meet-creedally Feb 17, 2026
493c852
Onboarding URLs and Digital Goods Changes
meet-creedally Feb 24, 2026
ec3ae0e
Minor Labeling added
meet-creedally Feb 25, 2026
ea78654
Shipping Callback Added
meet-creedally Feb 26, 2026
d60291d
Minor Fixes
meet-creedally Feb 26, 2026
2ee2a18
Minor Changes
meet-creedally Feb 26, 2026
c9950c8
MInor Chjage
meet-creedally Feb 26, 2026
b7f45a9
Minor Fixes
meet-creedally Feb 26, 2026
993cbef
MInor Donation Fixes
meet-creedally Feb 26, 2026
773408f
Changes in Thank you
meet-creedally Feb 26, 2026
0e2d747
Changes
meet-creedally Feb 27, 2026
4cd07cb
Session Variable Fixes
meet-creedally Feb 27, 2026
ddb3ff2
Minor Fixes
meet-creedally Feb 27, 2026
955d278
ACDC Changes
meet-creedally Mar 2, 2026
e2cf0ab
Minor CHanges
meet-creedally Mar 2, 2026
9c8a7fe
MInor Changes
meet-creedally Mar 3, 2026
48a890d
OR Wrapper Added
meet-creedally Mar 3, 2026
a324c00
Guest Checkout Complete in 3DS
meet-creedally Mar 3, 2026
384a482
Venmo Setup
meet-creedally Mar 3, 2026
addb2b9
SHipping Callback Minor Chanegs
meet-creedally Mar 5, 2026
388418b
Minor Venmo Changes
meet-creedally Mar 6, 2026
2395c1a
Added One All Payments Demo
meet-creedally Mar 6, 2026
089b2dc
Minor Chnages
meet-creedally Mar 6, 2026
e0d5767
Minor Changes
meet-creedally Mar 6, 2026
f37bb23
Minor Change
meet-creedally Mar 9, 2026
4961ac4
Shipping Callback Changes
meet-creedally Mar 13, 2026
c73be71
Basic Demo Implemented
meet-creedally Mar 13, 2026
06cf173
Line Items CHanges
meet-creedally Mar 13, 2026
ce245d8
Print Header Changes
meet-creedally Mar 13, 2026
948a987
Headers Passed
meet-creedally Mar 13, 2026
fc757b4
Minor Changes
meet-creedally Mar 13, 2026
4351ebc
Minor Changes
meet-creedally Mar 13, 2026
71d6665
Minor Changes for Type
meet-creedally Mar 13, 2026
2dd1b1a
Donation Completion
meet-creedally Mar 13, 2026
5b52ac8
Minor Changes for shipping callback
meet-creedally Mar 14, 2026
2effaea
Multiparty Changes
meet-creedally Mar 14, 2026
c969c4e
DirectPayment Changes
meet-creedally Mar 14, 2026
50ec736
Minor Changes in Direct Payment
meet-creedally Mar 14, 2026
f9e381d
JS Improvemtns
meet-creedally Mar 14, 2026
3c6c6f8
Changes for the Subscription Items
meet-creedally Mar 16, 2026
3d3e847
Venmo Checkout
meet-creedally Mar 16, 2026
315bdda
PayLater Order
meet-creedally Mar 16, 2026
bdea9fa
Minor Change
meet-creedally Mar 16, 2026
a25afdd
Minor CHanges
meet-creedally Mar 16, 2026
4eb4076
Vaulting
meet-creedally Mar 16, 2026
7929f05
Minor Shipping Callback Fixes
meet-creedally Mar 16, 2026
8f2733c
Minor Shipping Callback Changes
meet-creedally Mar 17, 2026
ca17bcf
Multi Checkout Demo Completed
meet-creedally Mar 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
64 changes: 50 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
/_notes
*/_notes
/temp
/test
/includes/config.php
/.settings
!empty
/.idea
# General Ignored Files
.DS_Store
Thumbs.db

# OS-generated files
*.swp
*.swo
*.bak

# PHPStorm and IDE-related files
.idea/
*.iml
*.xml
.vscode/

# Composer dependencies and related files
/vendor/
/composer.lock
/vendor/*
# exclude everything
logs/*
# exception to the rule
!logs/.gitkeep
/includes

# Node.js (if npm/yarn is used for assets)
node_modules/

# Temporary files
*.log
*.cache
*.tmp
/tmp/
/logs/
!logs/.gitkeep # Exclude logs/.gitkeep, keep the directory structure

# Private/sensitive files
/includes/config.php
/admin/config.php

# Git merge conflict files
*.orig

# PHPUnit
.phpunit.result.cache

# Coverage and build
/coverage/
/build/

# PHP-specific files
.env
.env.* # Include files like .env.testing, .env.production
/phpunit.xml
/phpunit.xml.dist

# Ignoring nbproject if NetBeans IDE is used
/nbproject/private/
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
}
],
"require": {
"php": ">=5.3.0",
"ext-curl": "*",
"paypal/rest-api-sdk-php":"*"
"php": ">=8.0.0",
"ext-curl": "*"
},
"autoload": {
"psr-0": {
Expand Down
182 changes: 182 additions & 0 deletions demo/apple-pay/applepay.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
document.addEventListener("DOMContentLoaded", function () {
const applepayButtonContainer = document.getElementById("applepay-button-container");
if ( !applepayButtonContainer ) return;

const purchaseAmount = applepayButtonContainer.dataset.amount;
const buyerEmail = applepayButtonContainer.dataset.email;

async function createOrder(purchaseAmount) {
try {
const orderPayload = {
intent: "CAPTURE",
payer: {
email_address: buyerEmail,
},
purchase_units: [
{
amount: {
currency_code: "USD",
value: purchaseAmount,
breakdown: {
item_total: {
currency_code: "USD",
value: purchaseAmount,
},
},
},
},
],
};

const response = await fetch('../../src/angelleye/PayPal/api/paypal-api.php?action=ae_create_order', {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(orderPayload)
})

const data = await response.json();

if (!data.id) {
throw new Error(data.message || "Unable to create PayPal order.");
}

return data.id;
} catch (err) {
showPaypalError(err.message);
throw err;
}
}

function showPaypalError(message) {
applepayButtonContainer.innerHTML = message;
}

async function init() {
try {
if (!window.ApplePaySession || !ApplePaySession.canMakePayments()) {
showPaypalError("Apple Pay is not available on this device or browser. Please use Safari on macOS or iOS.");
return;
}

const res = await fetch('../../src/angelleye/PayPal/api/paypal-api.php?action=ae_client_token');
const { token } = await res.json();

const sdkInstance = await window.paypal.createInstance({
clientToken: token,
components: ["applepay-payments"],
pageType: 'checkout',
});

const applePaySession = sdkInstance.createApplePayOneTimePaymentSession();

const { merchantCapabilities, supportedNetworks } = await applePaySession.config();

// Create Apple Pay button
const ApplePayButton = window.customElements.get("apple-pay-button");
const applePayBtn = new ApplePayButton();

if (typeof applePayBtn.buttonStyle !== "undefined") {
applePayBtn.buttonStyle = "black";
applePayBtn.type = "buy";
applePayBtn.locale = "en";
} else {
applePayBtn.textContent = "Apple Pay";
applePayBtn.style.backgroundColor = "black";
applePayBtn.style.color = "white";
applePayBtn.style.borderRadius = "4px";
applePayBtn.style.padding = "10px 20px";
}

async function onApplePayButtonClick() {
try {
const paymentRequest = {
countryCode: "US",
currencyCode: "USD",
merchantCapabilities,
supportedNetworks,
requiredBillingContactFields: [
"name", "phone", "email", "postalAddress",
],
requiredShippingContactFields: [],
total: {
label: "AngellEYE Payment Demo",
amount: purchaseAmount,
type: "final",
},
};

let session = new ApplePaySession(4, paymentRequest);

session.onvalidatemerchant = (event) => {
applePaySession
.validateMerchant({
validationUrl: event.validationURL,
})
.then((payload) => {
session.completeMerchantValidation(payload.merchantSession);
})
.catch((err) => {
showPaypalError(err.message || "Apple Pay merchant validation failed.");
console.error(err);
session.abort();
});
};

session.onpaymentmethodselected = () => {
session.completePaymentMethodSelection({
newTotal: paymentRequest.total,
});
};

session.onpaymentauthorized = async (event) => {
try {
const createdOrder = await createOrder(purchaseAmount);

await applePaySession.confirmOrder({
orderId: createdOrder,
token: event.payment.token,
billingContact: event.payment.billingContact,
shippingContact: event.payment.shippingContact,
});

console.log("Capturing payment...");
const response = await fetch('../../src/angelleye/PayPal/api/paypal-api.php?action=ae_capture_order', {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ id: createdOrder }),
});

const captureResult = await response.json();

if (captureResult.status === "COMPLETED") {
window.location.href = `getOrder.php?order_id=${createdOrder}`;
session.completePayment({status: window.ApplePaySession.STATUS_SUCCESS});
} else {
throw new Error("Payment capture failed.");
}
} catch (err) {
showPaypalError(err.message || "Apple Pay payment failed.");
console.error(err);
session.completePayment({status: window.ApplePaySession.STATUS_FAILURE});
}
};

session.oncancel = () => {
console.log("Apple Pay payment cancelled by user");
};

session.begin();
} catch (error) {
console.error(`Error starting Apple Pay: ${error.message}`);
}
}

applePayBtn.addEventListener("click", onApplePayButtonClick);
applepayButtonContainer.appendChild(applePayBtn);
} catch (error) {
showPaypalError(error.statusMessage || "Failed to initialize Apple Pay.");
console.error(error);
}
}
init();
});
83 changes: 83 additions & 0 deletions demo/apple-pay/getOrder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php
/**
* Include our config file and the PayPal library.
*/
require_once('../../includes/config.php');
require_once('../../vendor/autoload.php');

// Redirect to Pay Later Product Page if API mode is classic
if ($api_mode === 'classic') {
header('Location: ./');
}

/**
* Setup configuration for the PayPal library using vars from the config file.
* Then load the PayPal object into $PayPal
*/
$PayPalConfig = array(
'Sandbox' => $sandbox,
'PayPalAPIMode' => $api_mode,
'PayPalAPIUpgrade' => $api_upgrade,
'ClientID' => $rest_client_id,
'ClientSecret' => $rest_client_secret,
'PrintHeaders' => $print_headers,
'LogResults' => $log_results,
'LogPath' => $log_path,
);
$PayPal = angelleye\PayPal\PayPal::init($PayPalConfig);

$PayPalResult = $PayPal->getOrder($_GET['order_id']);

if ( $PayPalResult['success'] ) {
/**
* Here we'll pull out data from the PayPal response.
*/
$_SESSION['paypal_transaction_id'] = $_GET['order_id'];
$_SESSION['paypal_payer_id'] = isset($PayPalResult['order']['payer']['payer_id']) ? $PayPalResult['order']['payer']['payer_id'] : '';
$_SESSION['phone_number'] = isset($PayPalResult['order']['payer']['phone']['phone_number']['national_number']) ? $PayPalResult['order']['payer']['phone']['phone_number']['national_number'] : '';
$_SESSION['email'] = isset($PayPalResult['order']['payer']['email_address']) ? $PayPalResult['order']['payer']['email_address'] : '';
$_SESSION['first_name'] = isset($PayPalResult['order']['payer']['name']['given_name']) ? $PayPalResult['order']['payer']['name']['given_name'] : '';
$_SESSION['last_name'] = isset($PayPalResult['order']['payer']['name']['surname']) ? $PayPalResult['order']['payer']['name']['surname'] : '';
$_SESSION['billing_country_code'] = isset($PayPalResult['order']['payer']['address']['country_code']) ? $PayPalResult['order']['payer']['address']['country_code'] : '';

$purchaseUnit = $PayPalResult['order']['purchase_units'][0];
$shipping = isset( $purchaseUnit['shipping'] ) ? $purchaseUnit['shipping'] : [];
$_SESSION['shipping_name'] = isset($shipping['name']['full_name']) ? $shipping['name']['full_name'] : '';
$_SESSION['shipping_street'] = isset($shipping['address']['address_line_1']) ? $shipping['address']['address_line_1'] : '';
$_SESSION['shipping_city'] = isset($shipping['address']['admin_area_2']) ? $shipping['address']['admin_area_2'] : '';
$_SESSION['shipping_state'] = isset($shipping['address']['admin_area_1']) ? $shipping['address']['admin_area_1'] : '';
$_SESSION['shipping_zip'] = isset($shipping['address']['postal_code']) ? $shipping['address']['postal_code'] : '';
$_SESSION['shipping_country_code'] = isset($shipping['address']['country_code']) ? $shipping['address']['country_code'] : '';
$_SESSION['shipping_country_name'] = 'United States';

/**
* At this point, we now have the buyer's shipping address available in our app.
* We could now run the data through a shipping calculator to retrieve rate
* information for this particular order.
*
* This would also be the time to calculate any sales tax you may need to
* add to the order, as well as handling fees.
*
* We're going to set static values for these things in our static
* shopping cart, and then re-calculate our grand total.
*/
$_SESSION['shopping_cart']['shipping'] = 10.00;
$_SESSION['shopping_cart']['handling'] = 2.50;
$_SESSION['shopping_cart']['tax'] = 1.50;

$_SESSION['shopping_cart']['grand_total'] = number_format(
$_SESSION['shopping_cart']['subtotal']
+ $_SESSION['shopping_cart']['shipping']
+ $_SESSION['shopping_cart']['handling']
+ $_SESSION['shopping_cart']['tax'],2);

/**
* Now we will redirect the user to a final review
* page so they can see the shipping/handling/tax
* that has been added to the order.
*/
header('Location: order-complete.php');
} else {
$_SESSION['paypal_errors'] = $PayPalResult['error'];
header('Location: ../error.php');
}
Loading