wepay / nodejs-sdk Goto Github PK
View Code? Open in Web Editor NEWOfficial Wepay NodeJS SDK
License: MIT License
Official Wepay NodeJS SDK
License: MIT License
Do to the checkout/call being async
console.log("%s",response) prints:
{"checkout_id":1142912238,"account_id":1484170267,"type":"service","short_description":"Test Checkout","currency":"USD","amount":50,"state":"new","soft_descriptor":"WPY*David Small Stage","auto_capture":true,"create_time":1468179813,"delivery_type":"subscription","gross":0,"reference_id":null,"callback_uri":null,"long_description":null,"fee":{"app_fee":0,"processing_fee":0,"fee_payer":"payer"},"chargeback":{"amount_charged_back":0,"dispute_uri":null},"refund":{"amount_refunded":0,"refund_reason":null},"hosted_checkout":{"checkout_uri":"https://stage.wepay.com/api/checkout/1142912238/e5e2b1aa","redirect_uri":null,"shipping_fee":0,"require_shipp
You can see at the end, "require_shipp" is cut off and the rest is missing.
When you do wepay.call('/checkout/create', {......., payer_rbits:rbits] where rbits is an array with one object being an address rbit, if the address's city includes an accent, it fails.
Sample rbit:
receive_time: credit_card.created_at.getTime(),
source: 'user',
type: 'address',
properties: {
address: {
address1: credit_card.address.street,
city: credit_card.address.city,
region: credit_card.address.province,
postal_code: credit_card.address.postal_code,
country: credit_card.address.country
}
}
In our case, city was Montréal, failing the call. Making the same call with Montreal was accepted.
Stacktrace:
Error: Input could not be parsed
at ....
at IncomingMessage.<anonymous> (/app/node_modules/wepay/lib/wepay.js:84:25)
I have not tested if this issue where you include an accented character in any other places fails the call but I would assume it might.
call for response is asynchronous
I am getting this error when i call to /checkout/create method .
?xml version="1.0" encoding="utf-8"?>
<title>503 first byte timeout</title>first byte timeout
Details: cache-lax1431-LAX 1469176127 1060265685
Varnish cache server
The response should be parsed into object before sending to the callback.
Hi,
Not sure if this is the right repo, but my wife encountered an issue with Freshbooks (who uses wepay for their invoice transactions), where a valid email address was used, but wepay returned with an invalid_request
("Invalid parameter 'email' expected a valid email addresss", which also has a typo sss
btw).
This seems to be cause by email addresses that use an &
or -
(didn't have the time to narrow it down more).
Example: foo.bar+hi&[email protected]
is a perfectly valid email address, but wepay seems to trip over it.
Email address formats like these are used fairly frequently in the Canadian Government, so this seems to be an issue that's worth investigating and fixing ;)
You can move it to the proper repo if this isn't the one (couldn't really find the "main" repo for Wepay which, I assume, is private).
The options passed to the WEPAY constructor are not used anywhere (eg, client_id, & client_secret). They should be automatically merged with the parameters that are sent in the request.
Hello.
I am using this npm module in meteor project, and this is my code implementation.
// local variables
var wepay_settings = {
'client_id' : 'XXXXXXX',
'client_secret' : 'XXXXXXX',
'access_token' : 'XXXXXXXXX', // used for oAuth2
// 'api_version': 'API_VERSION'
}
var wp = new wepay.WEPAY(wepay_settings);
wp.use_staging(); // use staging environment (payments are not charged)
wp.call('/checkout/create',
{
'account_id': XXXX,
'amount': 5,
'currency': 'USD',
'short_description': 'Test: Selling 42 Pens',
'type': 'goods'
},
function(response) {
console.log('%s', response);
}
);
I have got below errors when calling this API
I am pulling my hairs for few days to solve this problem, but I couldn't find any solution yet.
Is there the problem of this package module.
Please help me with this issue. Thank you so mcuh.
The version of this SDK on npm is out of date. It does not reflect the changes made in most recent commit (e945f250f1d4b416fd5ff0793196f64cbb22c111) .
Not sure what's up, but I keep running into this running server.js:
Error: Cannot find module 'wepay'
Any ideas?
Update API to use promises instead of callbacks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.