Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public sendPaypal(price: string): void {
- this.reservation();
- this.hidden = true;
- this.loadExternalScript('https://www.paypalobjects.com/api/checkout.js').then(() => {
- paypal.Button.render({
- env: 'sandbox',
- client: {
- production: '',
- sandbox: 'AcUXHundjcOxwZFDFGU2rluWl9nSUtB_J83azAMEWyU7vPEcG56hsZzTCuO4Hqx1GNADkTMjc5ObWJsi'
- },
- locale: 'fr_FR',
- style: {
- color: 'blue',
- shape: 'rect',
- size: 'medium'
- },
- commit: true,
- payment: function (data, actions) {
- return actions.payment.create({
- 'intent': 'sale',
- 'payer': {
- 'payment_method': 'paypal'
- },
- 'transactions': [
- {
- 'amount': {
- 'total': price,
- 'currency': 'EUR',
- },
- 'description': 'Réservation de places de cinéma',
- 'payment_options': {
- 'allowed_payment_method': 'INSTANT_FUNDING_SOURCE'
- }
- }
- ],
- 'redirect_urls': {
- 'return_url': 'http://imagix-api20171119050303.azurewebsites.net/home',
- 'cancel_url': 'http://imagix-api20171119050303.azurewebsites.net/home'
- }
- })
- },
- onAuthorize: function(data, actions) {
- return actions.payment.execute().then(function(payment) {
- })
- }
- }, '#paypal-button');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement