initial commit

This commit is contained in:
equippedcoding-master
2025-09-17 09:37:06 -05:00
parent 86108ca47e
commit e2c98790b2
55389 changed files with 6206730 additions and 0 deletions

View File

@@ -0,0 +1,105 @@
AFSSdk.InitializeClientSDK("appfactorystudio", function(resp){
console.log(resp);
let directPayments = AFSSdk.payments.createNewDirectPayment();
directPayments.initialize("2337-5434-4216-3400", function(processor){
console.log(processor);
// directPayments.createPaymentHtml("#main_card_container");
directPayments.getProcessor().setupCheckout({
containerId: "#main_card_container",
options: {
appendNow: false,
paypal_error_message: "Sorry, your transaction could not be processed, please try again.",
showPaypalButton: true,
showPaypalForm: true,
billingAddressEnabled: false,
billingAddressNameEnabled: false,
onSubmit: {
showButton: true,
id: "submit",
className: "paypal-donate-btn",
label: "Donate",
}
},
/**
* Executed after a successful transaction.
*
* @param {object} paypalObj
*/
button_onApprove_callback: function(paypalObj){
},
button_onClick_callback: function(){
// let amount = app.utils.moneyFormat(app.extra._level.price);
// if(amount==undefined || amount==""){
// amount = "5.00";
// }
// let floatAmount = parseFloat(amount);
// if(floatAmount < 0.5){ amount = "1.00"; }
},
/**
* Called when the order is created. You should retrieve amount
* then validate amount return. If the amount is validate
* successufully then return pass:true otherwise pass:false.
* The amount also needs to be passed.
*
*
* @returns
*/
validate_price_callback: function(){
let textObj = document.getElementById("dollar-amount");
let amount = app.utils.moneyFormat(textObj);
return {pass:true,value:amount};
},
/**
* Called right before submit. Validate any input then return object
* with any data that needs to be passed through with the required
* property pass = true|false.
* @returns
*/
validation_callback: function(){
return {pass: true};
},
/**
* Called when the transaction has been made successfully.
* @param {*} orderData
*/
success_callback: function(paypalObj){
},
error_callback: function(err){
console.log(err);
},
success_content: function(paypalObj){
console.log(paypalObj);
return "";
}
});
});
},__PLAY_MODE__);

View File

@@ -0,0 +1,46 @@
<?php
require_once dirname(__DIR__, 5) . '/core/php/indexcore.php';
header_remove("X-Powered-By");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- <link
rel="stylesheet"
type="text/css"
href="https://www.paypalobjects.com/webstatic/en_US/developer/docs/css/cardfields.css"
/> -->
</head>
<body>
<div id="main_card_container"></div>
<!-- https://www.appfactory.studio/portal/admin/playground/client/payments/paypal/ -->
<!-- portal/admin/playground/client/payments/paypal/index/index.php -->
<p id="result-message"></p>
<!-- <script src="https://www.paypal.com/sdk/js?components=buttons,card-fields&client-id=%PAYPAL_CLIENT_ID%"></script> -->
<!-- <script src="https://www.paypal.com/sdk/js?components=buttons,card-fields&client-id=AR2VfeqErRvgVHp6B9ZPRAtfLzEA4tTz__C1EU0F60lsq9GgCLYPAomMgxscP3xEA9qiptKgnEgbJiBQ"></script> -->
<script> const __PLAY_MODE__ = "development"; </script>
<script src="https://api-sandbox.appfactory.studio/sdk/js/afssdk-dev.js"></script>
<script src="https://api-sandbox.appfactory.studio/sdk/js/afssdk-internal.js"></script>
<script src="./app.js"></script>
</body>
</html>

View File

@@ -0,0 +1,8 @@
.spacer {
width: 100%;
height:325px;
}

View File

@@ -0,0 +1,7 @@
<div class="spacer"></div>

View File

@@ -0,0 +1,10 @@
<?php
require_once dirname(__DIR__, 5) . '/core/php/indexcore.php';
header_remove("X-Powered-By");

View File

@@ -0,0 +1,8 @@
.spacer {
width: 100%;
height:325px;
}

View File

@@ -0,0 +1,7 @@
<div class="spacer"></div>