Coder Social home page Coder Social logo

sample-code-node's People

Contributors

adavidw avatar akankaria avatar anuragg29 avatar brianmc avatar divyavarghs13 avatar fijiwebdesign avatar gnongsie avatar gnongsiej avatar karthikeyanrzp avatar maria-simon avatar sinayak avatar snavinch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sample-code-node's Issues

Recurring payments, update Subscription

Hi,
I came across your node SDK for recurring billing and realized that the code is incomplete compared to the python and other language implementations. I found an away to solve this issue if you want me to?

Example for calling getAnAcceptPaymentPage(callback)?

Hi all, I've gotten the getAnAcceptPayment(callback); function working properly with console.log(response.getToken()); within the function itself, but does anyone have any idea how to actually return the response.getToken(); value on calling the function? I'm really struggling on trying to return this value, and don't know if I'm missing something really simple.

Implementation on ReactJS

How can I use AcceptJS on the client side? I am using ReactJS on the front end and Serverless, NodeJS on the backend. It is a bit confusing to implement AcceptJS. Previously when I have used stripe , it was pretty much straight forward.

import StripeCheckout from 'react-stripe-checkout';

import config from '../config';

class PayButton extends React.Component {
  constructor(props) {
    super(props);
    this.onToken = this.onToken.bind(this);
  }

  async onToken(token) { // On a successful tokenization request,
    const res = await fetch(config.stripe.apiUrl, { // POST to our backend server with the token and charge details
      method: 'POST',
      body: JSON.stringify({
        token,
        charge: {
          amount: this.props.amount,
          currency: config.stripe.currency,
        },
      }),
    });
    const data = await res.json();
    console.log('onToken');
    console.log(data);
  }

  render() {
    return (
      <StripeCheckout
        name="Serverless Stripe Store Inc."
        token={this.onToken}
        amount={this.props.amount}
        currency={config.stripe.currency}
        stripeKey={config.stripe.apiKey} // Stripe publishable API Key
        allowRememberMe={false}
      />
    );
  }
}```

In the backend though, it is
```const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY);

module.exports.handler = (event, context, callback) => {
  const requestBody = JSON.parse(event.body);
  const token = requestBody.token.id;
  const amount = requestBody.charge.amount;
  const currency = requestBody.charge.currency;

  return stripe.charges.create({ // Create Stripe charge with token
    amount,
    currency,
    description: 'Serverless Stripe Test charge',
    source: token,
  })
    .then((charge) => { // Success response
      const response = {
        statusCode: 200,
        headers: {
          'Access-Control-Allow-Origin': '*',
        },
        body: JSON.stringify({
          message: `Charge processed succesfully!`,
          charge,
        }),
      };
      callback(null, response);
    })
    .catch((err) => { // Error response
      const response = {
        statusCode: 500,
        headers: {
          'Access-Control-Allow-Origin': '*',
        },
        body: JSON.stringify({
          error: err.message,
        }),
      };
      callback(null, response);
    })
};```

Is there an equivalent method to implement this?

Issue in createCustomerProfile

I have a same coding in createCustomerProfile which is mention in github https://github.com/AuthorizeNet/sample-code-node/blob/master/CustomerProfiles/create-customer-profile.js

using this i am getting error in live mode,

{ customerPaymentProfileIdList: [],
customerShippingAddressIdList: [],
validationDirectResponseList: [ '3,1,290**,There is one or more missing or invalid required fields**.,,P,0,none,Test transaction for ValidateCustomerPaymentProfile.,0.00,CC,auth_only,406,,,,,,,,,,,[email protected],,,,,,,,,0.00,0.00,0.00,FALSE,none,F68A9C87C1E1472521704EF38C21F647,,,,,,,,,,,,,XXXX6602,Visa,,,,,,,,,,,,,,,,,' ],
messages: { resultCode: 'Error', message: [ [Object] ] } }

any idea?

Get Subscription by credit card number

Is there a way to get the subscription by credit card number so the user can cancel it, even if it wasn't added as a customer profile?

If subscription was added via: https://github.com/AuthorizeNet/sample-code-node/blob/master/RecurringBilling/create-subscription.js

Is there a way to list/cancel it, using only the credit card number? I would like to avoid listing all subscriptions and I would like to avoid storing credit card numbers, but still allow a user be able to cancel the subscription if they know the pertinent details of their card.

Errors running tests in test-runner.js

There are some typos and missing files in the samples which causes the node test-runner.js to fail.

  • get-list-of-subscriptions.js declares getListOfSubscription() which should be getListOfSubscriptions().
  • test-runner.js requires ./ApplePayTransactions which does not exist. See the line in test-runner.js:11 which states var ApplePayTransactionsModule = require('./ApplePayTransactions');
  • TransactionReporting/get-settled-batch-list.js errors due to Error Code: E00013 since Error message: First Settlement Date can not be older than the year of 2017.

Get only active subscription ids with customer profile

Is there any way using Which i can get only active subscription id of user with customer profile data

image

In Above image I have only one active subscription which is 7673669

I am retrieving subscription from array of subscriptionIds

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.