Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@angular_faruk/paypal
Advanced tools
This library was generated with Angular CLI version 17.2.0.
Run ng generate component component-name --project paypal
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project paypal
.
Note: Don't forget to add
--project paypal
or else it will be added to the default project in yourangular.json
file.
Run ng build paypal
to build the project. The build artifacts will be stored in the dist/
directory.
To use the PaypalModule
in your Angular application, follow these steps:
Import PaypalModule into AppModule:
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { PaypalModule } from '@angular_faruk/paypal';
import { IS_TESTING_MODE } from '@angular_faruk/paypal';
import { PaypalComponent } from '@angular_faruk/paypal';
@NgModule({
declarations: [
AppComponent
],
imports: [
PaypalModule
],
bootstrap: [AppComponent],
providers: [PaypalComponent,
{ provide: IS_TESTING_MODE, useValue: true }
]
})
export class AppModule {}
Option 2: You can import in any componet.
Example:
import { IS_TESTING_MODE, PaypalComponent } from '@angular_faruk/paypal';
import{PaypalService}from '@angular_faruk/paypal'
import { Component, Inject } from '@angular/core';
@Component({
selector: 'app-demo',
templateUrl: './demo.component.html',
styleUrls: ['./demo.component.css']
})
export class LandingPageCoffeeComponent {
constructor( private PaypalComponent:PaypalComponent , private paypalService: PaypalService,@Inject(IS_TESTING_MODE) private isTestingMode: boolean ) {
}
}
get_Access_token(ClientID:string,Secret_id:string) {
this.PaypalComponent.Access_token(ClientID,Secret_id).then((response) => {
// Handle successful response here
}).catch((error) => {
// You can display a notification to the user or perform any other error handling logic here
});
}
// create_order payload for single items
let OrderformData:any= {
name: string;
description: string;
quantity: number;
currency_code: string; //USD
value: number;
return_url: string; // Replace with your success page URL
cancel_url: string; // Replace with your cancel page URL
}
const intent = 'CAPTURE'; // This can be 'CAPTURE' or any other value you want
// create_order payload for multiple items
let OrderformData:any= {
name: string;
description: string;
quantity: number;
currency_code: string; //USD
value: number;
return_url: string;// Replace with your success page URL
cancel_url: string; // Replace with your cancel page URL
items: Array<{
name: string;
description: string;
quantity: number;
unit_amount: {
currency_code: string;
value: number;
};
}>;
}
const intent = 'CAPTURE'; // This can be 'CAPTURE' or any other value you want
this.PaypalComponent.create_order(OrderformData).then((response) => {
// Handle successful response here
}).catch((error) => {
// You can display a notification to the user or perform any other error handling logic here
});
this.PaypalComponent.order_details(order_id).then((response) => {
// Handle successful response here
}).catch((error) => {
// You can display a notification to the user or perform any other error handling logic here
});
this.PaypalComponent.capturePayment(order_id).then((response) => {
// Handle successful response here
}).catch((error) => {
// You can display a notification to the user or perform any other error handling logic here
});
Run ng test paypal
to execute the unit tests via Karma.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.
FAQs
this is new package with api
The npm package @angular_faruk/paypal receives a total of 0 weekly downloads. As such, @angular_faruk/paypal popularity was classified as not popular.
We found that @angular_faruk/paypal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.