嘿伙计们我按照这个教程
http://www.sanwebe.com/2014/09/paypal-rest-api-payment-system
我有贝宝沙盒模式工作完美.现在是时候启动网站了,我想把它切换到现场.我已经搞乱了好几个小时,无法弄清楚如何将它指向实时模式.
任何帮助都将非常感谢.
我是Paypal API的新手。我正在尝试的是在用户使用webhooks api购买商品时收到通知。
在Webhooks模拟器中,我介绍了URL,贝宝可以在其中通知我有关销售的信息,并且我模拟了“付款销售已完成”。该URL处的页面被调用,并且贝宝(Paypal)说“已发送事件数据”,并且发送了一个JSON对象。一切都很好,但是如何在PHP中获取该json对象呢?它通过POST发送吗?
谢谢
我是NodeJS的新手,我正在制作一个需要接受付款的应用程序.例如,用户必须输入他们的付款信息,但是在稍后的事件发生之前(可能是几天),付款将不会进行.所以,我需要在我的数据库中保存这些信息(我正在使用MongoDB)我想知道最好的方法是什么.我应该如何加密信用卡信息以将其存储在我的数据库中,并在事件发生时进行付款.我正在查看PayPal REST SDK,但我不确定这是否是最好的方法.什么是最好的库?
我们已经在http://paypal.github.io/PayPal-PHP-SDK/sample/上解释了我们网站上的"计费方案和协议" .
我们已经实施了每周定期付款,只想通过API取消结算协议.
我正在尝试将PayPal设置为在我的网站上进行付款,并且我想指定用于付款的订单项(使用新的SDK,而不是javascript版本)
我尝试遍历此处列出的API文档:https : //developer.paypal.com/docs/api/orders/v2/。但是,它说我语法无效或缺少字段。
<head>
<script>
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
currency_code: 'USD',
value: '0.01',
amount_breakdown: {
}
},
items: {
item: {
name: 'Cake',
quantity:'1',
unit_amount:{
currency_code:'USD',
value:'0.01'
}
}
}
}],
application_context: {
shipping_preference: 'NO_SHIPPING',
}
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
alert('Transaction completed by ' + details.payer.name.given_name);
// Call your server to save the transaction
return fetch('/paypal-transaction-complete', {
method: 'post',
body: JSON.stringify({
orderID: data.orderID
})
}); …Run Code Online (Sandbox Code Playgroud) 我正在尝试从智能支付按钮订阅贝宝计费计划。但我不断收到错误“指定的资源不存在”。
paypal.Buttons({
createSubscription: function (data, actions) {
return actions.subscription.create({
'plan_id': 'P-1G3183167U24246113LMNZLY'
});
},
onApprove: function (data, actions) {
alert('You have successfully created subscription ' + data.subscriptionID);
}
}).render('#paypal-button-container');
Run Code Online (Sandbox Code Playgroud)
订阅API响应错误:
{ "name": "RESOURCE_NOT_FOUND", "message": "指定的资源不存在。", "debug_id": "82ac38ce75745", "details": [ { "issue": "INVALID_RESOURCE_ID", "description": "找不到请求的资源 ID。” } ], "links": [ { "href": " https://developer.paypal.com/webapps/developer/docs/api/#INVALID_RESOURCE_ID ", "rel": "information_link", "method": "GET “ } ] }
错误图像:
我发现了一些处理 PHP 和此代码示例的旧答案,但我不确定这现在是否已经过时,因为存储库已存档,而且我知道 PayPal 通常转向仅使用 REST API 的方法。
如果有人可以在这里提供有关最新建议是什么以及 2015 年的代码现在是否已过时的更新,我会很高兴。
/* Copyright 2015-2016 PayPal, Inc. */
"use strict";
var paypal = require('../../../');
require('../../configure');
// Sends the webhook event data to PayPal to verify the webhook event signature is correct and
// the event data came from PayPal.
// Note this sample is only for illustrative purposes. You must have a valid webhook configured with your
// client ID and secret. This sample may not work due to …Run Code Online (Sandbox Code Playgroud) 休息api工作正常,但它没有显示数量按顺序"按顺序总和数量没有显示,但说明显示?" "我使用下面的代码来传递金额和描述"
require DIR . '/../bootstrap.php';
use PayPal\Api\Address;
use PayPal\Api\Amount;
use PayPal\Api\Payer;
use PayPal\Api\Payment;
use PayPal\Api\FundingInstrument;
use PayPal\Api\RedirectUrls;
use PayPal\Api\Transaction;
$charge = trim($_POST['amount']);
$currency = trim($_POST['currency']);
$desc = trim($_POST['desc']);
$get_url=trim($_SESSION['get_url']);
$payer = new Payer();
$payer->setPayment_method("paypal");
$amount = new Amount();
$amount->setCurrency($currency);
$amount->setTotal($charge);
$transaction = new Transaction();
$transaction->setAmount($amount);
$transaction->setDescription($desc);
}
"In order summery its showing description but amount is not showing."
Please help me to sort out this problem"
Thank for you help.
Sunil
Run Code Online (Sandbox Code Playgroud) 我正在使用PAYPAL Rest API进行支付交易.我正在调用上下文(/ v1/payments/payment)进行授权,并将ItemList作为Transaction对象的一部分传递.
要求:在Paypal身份验证页面上显示折扣/ GiftCard金额作为ItemList的一部分.
问题:API不允许将负数放入项目并且抛出验证错误.
谁能告诉我是否有可能显示折扣/礼品卡负数.(虽然可以在Classic API中使用)
没有 react-paypal-button-v2 ~~~有 60KB 的开销
类似的问题在这里,但他们建议react-paypal-button-v2
我正在尝试制作一个 React PayPal 按钮来更改道具更改的账单金额。
我使用道具价格调用以下组件,每次价格更改时,我都想重新渲染按钮以更新实际价格。没有 react-paypal-button-v2
const PaypalForm = props => {
let paypalRef = useRef();
useEffect(() => {
window.paypal
.Buttons({
createOrder: (data, actions) => {
return actions.order.create({
purchase_units: [
{
description: "test",
amount: {
currency_code: "USD",
value: props.price
}
}
]
});
},
onApprove: async (data, actions) => {
const order = await actions.order.capture();
console.log(order);
},
onError: err => {
setError(err);
console.error(err);
}
})
.render(paypalRef.current);
}, [props.price]);
return ( …Run Code Online (Sandbox Code Playgroud) 我在这里想做的就是能够从后端 api 获取 paypal_api_key ,例如:
app.get("/api/keys/paypal", (req, res) => {
res.send(process.env.PAYPAL_CLIENT_ID || "sb");
});
Run Code Online (Sandbox Code Playgroud)
前端侧:
const loadPaypalScript = async () => {
const { data: clientId } = await axios.get("/api/keys/paypal", {
headers: { authorization: `Bearer ${userInfo.token}` },
});
paypalDispatch({
type: "resetOptions",
value: {
"client-id": clientId,
currency: "GBP",
},
});
paypalDispatch({ type: "setLoadingStatus", value: "pending" });
};
loadPaypalScript();
Run Code Online (Sandbox Code Playgroud)
错误:
Uncaught Error: Attempted to load sdk version 5.0.343 on page, but window.paypal at version undefined already loaded.
To load this sdk alongside …Run Code Online (Sandbox Code Playgroud) paypal-rest-sdk ×11
paypal ×9
php ×4
node.js ×3
reactjs ×2
credit-card ×1
encryption ×1
javascript ×1
mongodb ×1