This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
F3::route('POST /cart_order', | |
function() { | |
//gets the schema URI, parses it | |
$json_schema = Web::http('GET '.F3::get('SESSION.cart_uri')); | |
error_log($json_schema); | |
$avro_schema = AvroSchema::parse($json_schema); | |
$datum_writer = new AvroIODatumWriter($avro_schema); | |
$write_io = new AvroStringIO(); | |
$encoder = new AvroIOBinaryEncoder($write_io); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s --insecure https://api-3t.sandbox.paypal.com/nvp -d | |
"USER=<Caller_ID> | |
&PWD=<Caller_Pswd> | |
&SIGNATURE=<Caller_Sig> | |
&METHOD=DoExpressCheckoutPayment | |
&VERSION=93 | |
&TOKEN=<Token> # TOKEN value returned from SetExpressCheckout | |
&PAYERID=<PayerID> # PAYERID value returned from GetExpressCheckoutDetails | |
&PAYMENTREQUEST_0_AMT=250 # first payment details | |
&PAYMENTREQUEST_0_CURRENCYCODE=USD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang=en> | |
<head> | |
<meta charset=utf-8> | |
<title>Testing a PayPal Payments Standard Button</title> | |
</head> | |
<body> | |
<h2>Buy Strings!</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=merchant_user_name | |
&PWD=merchant_password | |
&SIGNATURE=merchant_signature | |
&METHOD=RefundTransaction | |
&VERSION=94 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=insert_merchant_user_name_here | |
&PWD=insert_merchant_password_here | |
&SIGNATURE=insert_merchant_signature_value_here | |
&METHOD=CreateRecurringPaymentsProfile | |
&VERSION=94 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=insert_merchant_user_name_here | |
&PWD=insert_merchant_password_here | |
&SIGNATURE=insert_merchant_signature_value_here | |
&METHOD=DoDirectPayment | |
&VERSION=86 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once('services/PayPalApi/PayPalAPIInterfaceServiceService.php'); | |
/* setup payment details */ | |
orderTotal = new BasicAmountType( '-your-currency-code-', '-your-amount-'); | |
$PaymentDetails= new PaymentDetailsType(); | |
$PaymentDetails->OrderTotal = $orderTotal; | |
/* create DoExpressCheckout request details */ | |
$DoECRequestDetails = new DoExpressCheckoutPaymentRequestDetailsType(); | |
$DoECRequestDetails->PayerID = '-payer-id-from-get-EC-call'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Get Access Token | |
* | |
* After the user is forwarded back to the application callback (defined in | |
* the application at devportal.x.com) and the code parameter is available on | |
* the query string, exchange the code parameter for an access token. | |
* | |
*/ | |
public function get_access_token(){ | |
$code = $_GET['code']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=insert_merchant_user_name_here | |
&PWD=insert_merchant_password_here | |
&SIGNATURE=insert_merchant_signature_value_here | |
&METHOD=DoExpressCheckoutPayment | |
&VERSION=86 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Request | |
------- | |
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp | |
HTTP method: POST | |
POST data: | |
USER=insert_merchant_user_name_here | |
&PWD=insert_merchant_password_here | |
&SIGNATURE=insert_merchant_signature_value_here | |
&METHOD=CreateBillingAgreement | |
&VERSION=86 |