Skip to content

Instantly share code, notes, and snippets.

import React, { useMemo, useContext } from 'react';
import { Image } from 'react-native';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { View } from 'react-native';
import { SvgWithCss } from 'react-native-svg';
import { BrandingContext } from 'contexts';
import { actions, selectors } from 'store/cards';
import styles from './styles';
import { createAppContainer } from 'react-navigation';
import { Provider as StoreProvider } from 'react-redux';
import React from 'react';
import store from 'store';
import Navigation from 'navigation';
import { BrandingProvider } from 'contexts';
const AppContainer = createAppContainer(Navigation);
import React, { createContext } from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
import { split, trimEnd, toNumber } from 'lodash';
import colors from 'res/colors';
import { selectors } from 'store/branding';
import { hexToHSL } from 'utils/helpers';
export const BrandingContext = createContext({});
onAuthorize: function(data, actions)
{
return actions.payment.execute().then(function()
{
// Show a confirmation message to the buyer
window.alert('Thank you for your purchase!');
});
}
payment: function(data, actions) {
return actions.payment.create({
transactions: [{
amount: {
total: '30.11',
currency: 'USD',
details: {
subtotal: '30.00',
tax: '0.07',
shipping: '0.03',
payment: function(data, actions) {
return actions.payment.create({
transactions: [{
amount: {
total: '0.01',
currency: 'USD'
}
}]
});
}
<div id="paypal-button"></div>
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<script>
paypal.Button.render({
// Configure environment
env: 'sandbox',
client: {
sandbox: 'demo_sandbox_client_id',
production: 'demo_production_client_id'
},
https://mws.amazonservices.com/OffAmazonPayments_Sandbox/2013-01-01 ?AWSAccessKeyId=AKIAJKYFSJU7PEXAMPLE
&Action=AuthorizeOnBillingAgreement
&AmazonBillingAgreementId=C01-1234567-1234567
&AuthorizationAmount.Amount=10
&AuthorizationAmount.CurrencyCode=USD
&AuthorizationReferenceId=test_authorize_1
&MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE
&SellerId=YOUR_SELLER_ID_HERE
&SellerAuthorizationNote=ForNovemberOrder
&SellerOrderAttributes.SellerOrderId=testSellerOrderId
https://mws.amazonservices.com/OffAmazonPayments_Sandbox/2013-01-01?AWSAccessKeyId=AKIAJKYFSJU7PEXAMPLE
&AmazonBillingAgreementId=C01-8824045-7416542
&Action=ValidateBillingAgreement
&MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE
&SellerId=YOUR_SELLER_ID_HERE
&SignatureMethod=HmacSHA256
&SignatureVersion=2
&Timestamp=2013-12-11T10%3A38%3A44.000Z
&Version=2013-01-01
&Signature=gP11oEBaaiQdASWsLDyid18Wn%2BB%2FKZQQtKgpHCtDHdc%3D
https://mws.amazonservices.com/OffAmazonPayments_Sandbox/2013-01-01?
AWSAccessKeyId=AKIAJKYFSJU7PEXAMPLE
&AmazonBillingAgreementId=C01-8824045-7416542
&Action=SetBillingAgreementDetails
&BillingAgreementAttributes.PlatformId=PLATFORM_ID_HERE
&BillingAgreementAttributes.SellerNote=APPROVE LITE APPROVE HEAVY
&BillingAgreementAttributes.SellerBillingAgreementAttributes.CustomInformati
on=Example Customer Info
&BillingAgreementAttributes.SellerBillingAgreementAttributes.StoreName=Test Store Name
&MWSAuthToken=amzn.mws.4ea38b7b-f563-7709-4bae-87aeaEXAMPLE